Daniel Danciu wrote:
> Well, it's me again, with another question. I tried for hours to find a
> suitable way to put a motto before each chapter, but I failed. The motto
> should be above the chapter name, right aligned, as any normal motto.
>
> So I wrote my motto, formatted it as described above, but after
> rendering the document, the motto appeared on a page and the chapter
> title on the next page (that shouldn't be a surprise since chapters
> normally start on a new page).
> I searched the net to see if there is any "motto.sty" file available for
> latex, and I couldn't find one.
>
> Does anybody have a suggestion on how to make my chapter remain on the
> same page as the motto? I guess there should be a latex command to
> disable chapters starting on the new page.
it's much more easier to have them after the chapter title.
but you can try this:
in preamble
\newcommand{\@chaptermotto}{%
\setbox\@tempboxa=\hbox{\savechaptermotto}%
\setlength{\@tempdima}{\textwidth-\wd\@tempboxa}%
\edef\pushmotto{\strip@pt\@tempdima}%
\begin{picture}(0,0)
\put(\pushmotto,100){\savechaptermotto}
\end{picture}%
}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{\@chaptermotto #2}]%
\else
\@makechapterhead{%
\@chaptermotto #2}%
\@afterheading
\fi
\chaptermotto{}%
}
and just right before you start in LyX a new chapter write
in tex(red) f.ex.:
\chaptermotto{Thus speake the master programmer: \\
``When you have learned to snatch the error code \\
from the trap frame, it will be time for you to leave.''}
Herbert
--
http://www.lyx.org/help/