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. CONTENTS LISTSRemember that the \chapter command uses \insertchapterspace to insert verticalspaces into the LoF and LoT. If you want similar spaces added to your new listing then youhave to modify \insertchapterspace. <strong>The</strong> easiest way to do this is via the \addtodefmacro, like:\addtodef{\insertchapterspace}{}%{\addtocontents{ans}{\protect\addvspace{10pt}}}<strong>The</strong> \addtodef macro is described later in §18.10.<strong>The</strong> other part of creating a new ‘List of. . . ’, is to specify the formatting of the entries,i.e., define an appropriate \l@kind macro.\newlistentry[〈within〉]{〈cntr〉}{〈ext〉}{〈level-1〉}<strong>The</strong> command \newlistentry creates the commands necessary for typesetting an entryin a ‘List of. . . ’. <strong>The</strong> first required argument, 〈cntr〉 is used to define a new countercalled cntr, unless cntr is already defined. <strong>The</strong> optional 〈within〉 argument can be usedso that cntr gets reset to one every time the counter called within is changed. Thatis, the first two arguments when cntr is not already defined, are equivalent to calling\newcounter{〈cntr〉}[〈within〉]. If cntr is already defined, \newcounter is not called.cntr is used for the number that goes along with the title of the entry.<strong>The</strong> second required argument, 〈ext〉, is the file extension for the entry listing. <strong>The</strong> lastargument, 〈level-1〉, is a number specifying the numbering level minus one, of the entry ina listing.Calling \newlistentry creates several new commands used to configure the entry.So in order to configure the list look of our previous answer example we would add\newlistentry{answer}{ans}{0}Assuming that \newlistentry is called as \newlistentry[within]{K}{X}{N},where K and X are similar to the previous uses of them (e.g., K is the kind of entry X isthe file extension), and N is an integer number, then the following commands are madeavailable.<strong>The</strong> set of commands \cftbeforeKskip, \cftKfont, \cftKpresnum,\cftKaftersnum, \cftKaftersnumb, \cftKleader, \cftKdotsep, \cftKpagefont,and \cftKafterpnum, are analagous to the commands of the same names described in§9.2.2. <strong>The</strong>ir default values are also as described earlier.<strong>The</strong> default values of \cftKindent and \cftKnumwidth are set according to the valueof the 〈level-1〉 argument (i.e., N in this example). For N=0 the settings correspond to thosefor figures and tables, as listed in Table 9.1 for the <strong>memoir</strong> <strong>class</strong>. For N=1 the settingscorrespond to subfigures, and so on. For values of N less than zero or greater than four, orfor non-default values, use the \cftsetindents command to set the values.\l@K is an internal command that typesets an entry in the list, and is defined in termsof the above \cft*K* commands. It will not typeset an entry if Xdepth is N or less, whereX is the listing’s file extension.<strong>The</strong> command \theK prints the value of the K counter. It is initially defined so that itprints arabic numerals. If the optional 〈within〉 argument is used, \theK is defined as\renewcommand{\theK}{\thewithin.\arabic{K}}otherwise as\renewcommand{\theK}{\arabic{K}}164

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

Saved successfully!

Ooh no, something went wrong!