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.

9.2. <strong>The</strong> <strong>class</strong> ToC methods\renewcommand*{\cftchapterfont}{\hfill\sffamily}\renewcommand*{\cftchapterleader}{ \textperiodcentered\space}\renewcommand*{\cftchapterafterpnum}{\cftparfillskip}%% \setpnumwidth{0em}%% \setpnumwidth{1.5em}\renewcommand*{\cftchapterfillnum}[1]{%{\cftchapterleader}\nobreak\hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}\setrmarg{0.3\textwidth}\setlength{\unitlength}{\@tocrmarg}\addtolength{\unitlength}{1.5em}\let\oldcftpartformatpnum\cftpartformatpnum\renewcommand*{\cftpartformatpnum}[1]{%\hbox to\unitlength{{\cftpartpagefont ##1}}}}\let\oldcftbookformatpnum\cftbookformatpnum\renewcommand*{\cftbookformatpnum}[1]{%\hbox to\unitlength{{\cftbookpagefont ##1}}}}You can do many things using the \cft... macros to change the appearance of a ToCbut they can’t be entirely coerced into specifying the paragraphing of the \subsectiontitles. <strong>The</strong> \setupparasubsecs also went in the preamble.\newcommand*{\setupparasubsecs}{%\let\oldnumberline\numberline\renewcommand*{\cftsubsectionfont}{\itshape}\renewcommand*{\cftsubsectionpagefont}{\itshape}\renewcommand{\l@subsection}[2]{%\def\numberline####1{\textit{####1}~}%\leftskip=\cftsubsectionindent\rightskip=\@tocrmarg%% \advance\rightskip 0pt plus \hsize % uncomment this for raggedright%% \advance\rightskip 0pt plus 2em % uncomment this for semi-raggedright\parfillskip=\fill\ifhmode ,\ \else\noindent\fi\ignorespaces{\cftsubsectionfont ##1}~{\cftsubsectionpagefont##2}%\let\numberline\oldnumberline\ignorespaces}}\AtEndDocument{\addtocontents{toc}{\par}<strong>The</strong> above code changes the appearance of subsection titles in the ToC, setting each groupas a single paragraph (each is normally set with a paragraph to itself). By uncommentingor commenting the noted lines in the code you can change the layout a little.Normally, section titles (and below) are set as individual paragraphs. Effectively thefirst thing that is done is to end any previous paragraph, and also the last thing is to end thecurrent paragraph. Notice that the main code above neither starts nor finishes a paragraph.If the group of subsections is followed by a section title, that supplies the paragraph end.<strong>The</strong> last line above ensures that the last entry in the toc file is \par as this might be neededto finish off a group of subsections if these are the last entries.161

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

Saved successfully!

Ooh no, something went wrong!