12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.5. Chapter headings\newcommand{\chapnamefont}{\normalfont\huge\bfseries}\newcommand{\chapnumfont}{\normalfont\huge\bfseries}\newcommand{\chaptitlefont}{\normalfont\Huge\bfseries}\newlength{\beforechapskip}\setlength{\beforechapskip}{50pt}\newlength{\midchapskip}\setlength{\midchapskip}{20pt}\newlength{\afterchapskip}\setlength{\afterchapskip}{40pt}\chapterstyle{default}(<strong>The</strong> mysterious \@chapapp is the internal macro that La<strong>TeX</strong> uses to store normally thechapter name. 3 It will normally have different values, set automatically, when typesettinga chapter in the main body (e.g., Chapter) or in the appendices where it would usually beset to Appendix, but you can specify these names yourself.)As an example of setting up a simple chapterstyle, here is the code for defining thesection chapterstyle. In this case it is principally a question of eliminating most of theprinting and zeroing some spacing.\makechapterstyle{section}{%\renewcommand*{\printchaptername}{}\renewcommand*{\chapternamenum}{}\renewcommand*{\chapnumfont}{\chaptitlefont}\renewcommand*{\printchapternum}{\chapnumfont \thechapter\space}\renewcommand*{\afterchapternum}{}}In this style, \printchaptername is vacuous, so the normal ‘Chapter’ is never typeset.<strong>The</strong> same font is used for the number and the title, and the number is typeset with a spaceafter it. <strong>The</strong> macro \afterchapternum is vacuous, so the chapter title will be typesetimmediately after the number.In the standard <strong>class</strong>es the title of an unnumbered chapter is typeset at the sameposition on the page as the word ‘Chapter’ for numbered chapters. <strong>The</strong> macro\printchapternonum is called just before an unnumbered chapter title text is typeset. Bydefault this does nothing but you can use \renewcommand to change this. For example, ifyou wished the title text for both numbered and unnumbered chapters to be at the sameheight on the page then you could redefine \printchapternonum to insert the amountof vertical space taken by any ‘Chapter N’ line. For example, as \printchapternonum isvaucuous in the default chapterstyle the vertical position of a title depends on whether ornot it is numbered.<strong>The</strong> hangnum style, which is like section except that it puts the number in the margin,is defined as follows:\makechapterstyle{hangnum}{%\renewcommand*{\chapnumfont}{\chaptitlefont}% allow for 99 chapters!\settowidth{\chapindent}{\chapnumfont 999}\renewcommand*{\printchaptername}{}\renewcommand*{\chapternamenum}{}\renewcommand*{\chapnumfont}{\chaptitlefont}\renewcommand*{\printchapternum}{%3 Remember, if you use a macro that has an @ in its name it must be in a place where @ is treated as a letter.87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!