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. DOCUMENT DIVISIONS\chapterstyle{fred}Different styles can be used in the same document.<strong>The</strong> simpler predefined styles include:default <strong>The</strong> normal La<strong>TeX</strong> book <strong>class</strong> chapter styling; shown in Figure B.1.section <strong>The</strong> heading is typeset like a section; that is, there is just the number and the title onone line. This is illustrated in Figure B.2.hangnum Like the section style except that the chapter number is put in the margin, as shownin Figure B.3.companion This produces chapter headings like those of the La<strong>TeX</strong> Companion series of books.An example is in Figure B.4.article <strong>The</strong> heading is typeset like a \section heading in the article <strong>class</strong>. This is similar tothe section style but different fonts and spacings are used, as shown in Figure B.5.reparticle When the article <strong>class</strong> option is used the default chapter and section styles are close,but not identical, to the corresponding division heads in the article <strong>class</strong>. <strong>The</strong> reparticlechapterstyle makes \chapter replicate the appearance of \section in the article<strong>class</strong>.If you use only the predefined chapterstyles there is no need to plough through the restof this section, except to look at the illustrations of the remaining predefined chapterstylesshown a little later.<strong>The</strong> various macros shown in the \chapterhead code above are initially set up as:\newcommand{\chapterheadstart}{\vspace*{\beforechapskip}}\newcommand{\printchaptername}{\chapnamefont \@chapapp}\newcommand{\chapternamenum}{\space}\newcommand{\printchapternum}{\chapnumfont \thechapter}\newcommand{\afterchapternum}{\par\nobreak\vskip \midchapskip}\newcommand{\printchapternonum}{}\newcommand{\printchaptertitle}[1]{\chaptitlefont #1}\newcommand{\afterchaptertitle}{\par\nobreak\vskip \afterchapskip}A new style is specified by changing the definitions of this last set of macros and/orthe various font and skip specifications.\makechapterstyle{〈style〉}{〈text〉}Chapter styles are defined via the \makechapterstyle command, where 〈style〉 is thestyle being defined and 〈text〉 is the La<strong>TeX</strong> code defining the style.To start things off, here is the code for the default chapter style, which mimics thechapter heads in the standard book and report <strong>class</strong>es, as it appears in <strong>memoir</strong>.cls.\makechapterstyle{default}{%\def\chapterheadstart{\vspace*{\beforechapskip}\def\printchaptername{\chapnamefont \@chapapp}\def\chapternamenum{\space}\def\printchapternum{\chapnumfont \thechapter}\def\afterchapternum{\par\nobreak\vskip \midchapskip}\def\printchapternonum{}\def\printchaptertitle##1{\chaptitlefont ##1}\de\afterchaptertitle{\par\nobreak\vskip \afterchapskip}}86

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

Saved successfully!

Ooh no, something went wrong!