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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9. CONTENTS LISTSAnd thirdly for the main ToC, the macro \setupmaintoc reverts everything back tonormal.\newcommand*{\setupmaintoc}{%\renewcommand{\contentsname}{Contents}\let\changetocdepth\oldchangetocdepth\let\precistoctext\oldprecistoctext\let\cftchapterfillnum\oldcftchapterfillnum\addtodef{\cftchapterbreak}{\par}{}\renewcommand*{\cftchapterfont}{\normalfont\sffamily}\renewcommand*{\cftchapterleader}{%\sffamily\cftdotfill{\cftchapterdotsep}}\renewcommand*{\cftchapterafterpnum}{}\renewcommand{\cftchapterbreak}{\par\addpenalty{-\@highpenalty}}\setpnumwidth{2.55em}\setrmarg{3.55em}\setcounter{tocdepth}{2}}\let\cftpartformatpnum\oldcftpartformatpnum\addtodef{\cftpartbreak}{\par}{}\let\cftbookformatpnum\oldcftbookformatpnum\addtodef{\cftbookbreak}{\par}{}<strong>The</strong> first few lines restore some macros to their original definitions.\addtodef{\cftchapterbreak}{\par}{}ensures that a chapter entry starts off with a \par; this is needed when the previous entryis a group of subsections and their paragraph has to be ended. <strong>The</strong> remaining code linessimply set the appearance of the chapter titles and restore that for parts and books, as wellas ensuring that they start off new paragraphs.In the document itself, \tableofcontents was called twice, after the appropriate setups:...\setupshorttoc\tableofcontents\clearpage\setupparasubsecs\setupmaintoc\tableofcontents\setlength{\unitlength}{1pt}...After all this note that I ensured that \unitlength was set to its default value (it had beenused as a scratch length in the code for \setupparasubsecs).9.3 NEW ‘LIST OF. . . ’ AND ENTRIES\newlistof{〈listofcom〉}{〈ext〉}{〈listofname〉}<strong>The</strong> command \newlistof creates a new ‘List of. . . ’, and assorted commands to goalong with it. <strong>The</strong> first argument, 〈listofcom〉 is used to define a new command called162

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

Saved successfully!

Ooh no, something went wrong!