The tocloft package^{∗}

Peter Wilson Catholic University of America

          Now at peter.r.wilson@boeing.com

2003/01/20

Abstract

The tocloft package provides means of controlling the typographic design of the Table of Contents, List of Figures and List of Tables. New kinds of ‘List of … ’ can be defined.

The package has been tested with the tocbibind, minitoc, ccaption, subfigure, float, fncychap, and hyperref packages.

Contents

1 Introduction 2 1.1 L^{A}TEX’s methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 The tocloft package 6 2.1 Package options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Changing the titles . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Typesetting the entries . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 New list of. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.5 Experimental utilities . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6 Usage with other packages . . . . . . . . . . . . . . . . . . . . . . . 15

3 The package code 17 3.1 Support for the subfigure package . . . . . . . . . . . . . . . . . . . 35 3.2 New list of. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3 Switching page numbering . . . . . . . . . . . . . . . . . . . . . . . 42 3.4 Experimental utilities . . . . . . . . . . . . . . . . . . . . . . . . . 44

List of Figures

1 Layout of a ToC (LoF, LoT) entry . . . . . . . . . . . 3

List of Tables

1 Indents and Numwidths . . . . . . . . . . . . . . 4

∗This file has version number v2.3b, last revised 2003/01/20.

1 Introduction

In the standard classes the typographic design of the Table of Contents (ToC), the List of Figures (LoF) and List of Tables (LoT) is fixed or, more precisely, it is buried within the class definitions. The tocloft package provides handles for an author to change the design to meet the needs of the particular document.

Elements of the package were developed as part of a class and package bundle for typesetting ISO standards [Wil96b]. This manual is typeset according to the conventions of the L^{A}TEX docstrip utility which enables the automatic extraction of the L^{A}TEX macro source files [GMS94].

Section 2 describes the usage of the package. Commented source code for the package is in Section 3.

The package has been tested in combination with at least the tocbibind package [Wil00], the minitoc package [Dru99], the ccaption package [Wil01], the subfigure package [Coc95] (versions 2.0 and 2.1), the algorithm package [Wil96a] (which, in turn, calls the float package [Lin95]) and the fncychap package [Lin97]. It also works with the hyperref package. Please send me any comments as to how you think that the package can be improved, or of any interesting examples of how you have used it.^{1}

1.1 L^{A}TEX’s methods

This is a general description of how L^{A}TEX does the processing for a Table of Contents. As the processing for List of Figures and List of Tables is similar I will, without loss of generality, just discuss the ToC.

\addcontentsline L^{A}TEX generates a .toc file if the document contains a \tableofcontents command. The sectioning commands^{2} put entries into the .toc file by calling the L^{A}TEX \addcontentsline{⟨file⟩}{⟨kind⟩}{⟨title⟩} command, where ⟨file⟩ is the file extension (e.g., toc), ⟨kind⟩ is the kind of entry (e.g., section or subsection), and ⟨title⟩ is the (numberered) title text. In the cases where there is a number, the ⟨title⟩ argument is given in the form {\numberline{number} title-text}.

NOTE: The hyperref package dislikes authors using \addcontentsline. To get it to work properly with hyperref you normally have to put \phantomsection (a macro defined within the hyperref package) immediately before \addcontentsline.

\contentsline The \addcontentsline command writes an entry to the given file in the form \contentsline{⟨kind⟩}{⟨title⟩}{⟨page⟩} where ⟨page⟩ is the page number. For each ⟨kind⟩, L^{A}TEX provides a command \l@kind{⟨title⟩}{⟨page⟩} which performs the actual typesetting of the \contentsline entry.

\@pnumwidth The general layout of a typeset entry is illustrated in Figure 1. There are three

\@tocrmarg
\@dotsep

internal L^{A}TEX commands that are used in the typesetting. The page number is typeset flushright in a box of width \@pnumwidth, and the box is at the righthand margin. If the page number is too long to fit into the box it will stick out into the righthand margin. The title text is indented from the righthand margin by an amount given by \@tocrmarg. Note that \@tocrmarg should be greater than \@pnumwidth. Some entries are typeset with a dotted leader between the end of the title title text and the righthand margin indentation. The distance, in math

1Thanks to Rowland (rebecca@astrid.u-net.com), John Foster (john@isjf.demon.co.uk), Kasper (kbg@dkik.dk), Lee Nave (nave@math.washington.edu), and Andrew Thurber (athurber@emba.uvm.edu) for their suggestions.

2For figures and tables it is the \caption command that populates the .lof and .lot files.

[figure: \linewidth; \@pnumwidth; \@tocrmarg; indent; numwidth; 487; title end; continue…; … title; 3.5; Heading…; … title; .; .; .; .; .; .; .; .; .; .; .; .; \@dotsep]

Figure 1: Layout of a ToC (LoF, LoT) entry

units^{3} between the dots in the leader is given by the value of \@dotsep. In the standard classes the same values are used for the ToC, LoF and the LoT.

The standard values for these internal commands are:

   • \@pnumwidth = 1.55em
   • \@tocrmarg = 2.55em
   • \@dotsep = 4.5

The values can be changed by using \renewcommand, in spite of the fact that the first two appear to be lengths.

Dotted leaders are not available for Part and Chapter ToC entries (nor for Section entries in the article class and its derivatives).

\numberline Each \l@kind macro is responsible for setting the general indent from the lefthand margin, and the numwidth. The \numberline{⟨number⟩} macro is responsible for typesetting the number flushleft in a box of width numwidth. If the number is too long for the box then it will protrude into the title text. The title text is indented by (indent + numwidth) from the lefthand margin. That is, the title text is typeset in a block of width

(\linewidth - indent - numwidth - \@tocrmarg).

Table 1 lists the standard values for the indent and numwidth. There is no explicit numwidth for a part; instead a gap of 1em is put between the number and the title text. Note that for a sectioning command the values depend on whether or not the document class provides the \chapter command. Also, which somewhat surprises me, the table and figure entries are all indented.

\@dottedtocline Most of the \l@kind commands are defined in terms of the \@dottedtocline command. This command takes three arguments: \@dottedtocline{⟨seclevel⟩}{⟨indent⟩}{⟨numwidth⟩}. For example, one definition of the \l@section command is:

\newcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.3em}}

If it is necessary to change the default typesetting of the entries, then it is usually

3There are 18mu to 1em.

Table 1: Indents and Numwidths (in ems)

Entry Level Chaptered Otherwise
indent numwidth indent numwidth
part  -1  0  —  0  —
chapter  0  0  1.5
section  1  1.5  2.3  0  1.5
subsection  2  3.8  3.2  1.5  2.3
subsubsection  3  7.0  4.1  3.8  3.2
paragraph  4  10.0  5.0  7.0  4.1
subparagraph  5  12.0  6.0  10.0  5.0
figure/table  (1)  1.5  2.3  1.5  2.3

necessary to change these definitions (but the tocloft package gives you handles to easily alter things without having to know the L^{A}TEX internals).

You can use the \addcontentsline command to add \contentsline com-

mands to a file.

\addtocontents L^{A}TEX also provides the \addtocontents{⟨file⟩}{⟨text⟩} command that will insert ⟨text⟩ into ⟨file⟩. You can use this for adding extra text and/or macros into the file, for processing when the file is typeset by \tableofcontents (or whatever other command is used for ⟨file⟩ processing, such as \listoftables for a .lot file).

As \addcontentsline and \addtocontents write their arguments to a file, any fragile commands used in their arguments must be \protected.

You can make certain adjustments to the ToC etc., layout without using any package. Some examples are:

• If your page numbers stick out into the righthand margin

\renewcommand{\@pnumwidth}{3em} \renewcommand{\@tocrmarg}{4em}

but using lengths appropriate to your document.

• To have the (sectional) titles in the ToC, etc., typeset ragged right with no hyphenation

\renewcommand{\@tocrmarg}{2.55em plus1fil}

where the value 2.55em can be changed for whatever margin space you want.

• The dots in the leaders can be eliminated by increasing \@dotsep to a large value:

\renewcommand{\@dotsep}{10000}

• To have dotted leaders in your ToC and LoF but not in your LoT:

...

 \tableofcontents
 \makeatletter \renewcommand{\@dotsep}{10000} \makeatother
 \listoftables
 \makeatletter \renewcommand{\@dotsep}{4.5} \makeatother
 \listoffigures
 ...

For this document I used this method to double the dot spacing for the LoF with respect to that for the ToC. As you can see, it is much better that all dot leaders have the same spacing.

• To add a horizontal line across the whole width of the ToC below an entry for a Part:

 \part{Part title}
 \addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par}

Note that as both \addtocontents and \addcontentsline write their ar-

guments to a file, it means that any fragile commands in their arguments must be protected by preceeding each fragile command with \protect. The result of the example above would be the following two lines in the .toc file (assuming that it is the second Part and is on page 34):

 \contentsline {part}{II\hspace {1em}Part title}{34}
 \mbox {}\hrulefill \par

If the \protects were not used, then the second line would instead be:

 \unhbox \voidb@x \hbox {}\unhbox \voidb@x \leaders \hrule \hfill \kern \z@ \par

• You may get undesired page breaks in the ToC. For example you may have a long multiline section title and in the ToC there is a page break between the lines. After your document is stable you can use \addtocontents at appropriate places in the body of the document to adjust the page breaking in the ToC. As examples:

  – \addtocontents{toc}{\protect\newpage} to force a page break.
  – \addtocontents{toc}{\protect\enlargethispage{2\baselineskip}}

to make the page longer.

  – \addtocontents{toc}{\protect\needspace{2\baselineskip}} to spec-

ify that if there is not a vertical space of two baselines left on the page then start a new page (the \needspace macro is defined in the needspace package).

Remember, if you are modifying any command that includes an @ sign then this must be done in either a .sty file or if in the document itself it must be surrounded by \makeatletter and \makeatother. For example, if you want to modify \@dotsep in the preamble to your document you have to do it like this:

 \makeatletter
 \renewcommand{\@dotsep}{9.0}
 \makeatother

2 The tocloft package

The tocloft package provides means of specifying the typography of the Table of Contents (ToC), the List of Figures (LoF) and the List of Tables (LoT).

\tableofcontents The ToC, LoF, and LoT are printed at the point in the document where these

\listoffigures
\listoftables

commands are called, as per normal L^{A}TEX. However, there is one difference between the standard L^{A}TEX behaviour and the behaviour with the tocloft package. In the standard L^{A}TEX classes that have \chapter headings, the ToC, LoF and LoT each appear on a new page. With the tocloft package they do not necessarily start new pages; if you want them to be on new pages you may have to specifically issue an appropriate command beforehand. For example:

  ...
 \clearpage
 \tableofcontents
 \clearpage
 \listoftables
 ...

\tocloftpagestyle The \thispagestyle page style of the ToC, LoF and/or LoT is set by the command \tocloftpagestyle{⟨style⟩}, where ⟨style⟩ is one of the available page styles. The package initially sets \tocloftpagestyle{plain}.

2.1 Package options

The package takes the following options:

subfigure This option is required if, and only if, the tocloft and subfigure packages are being used together. The two packages can be specified in any order.

titles The titles option causes the titles of the ToC, LoF, and LoT lists to be typeset using the default L^{A}TEX methods. This can be useful, for example, when the tocloft and fncychap packages are used together and the ‘fancy’ chapter styles should be used for the ToC, etc., titles.

If you use the titles option you can ignore the next section and continue reading at section 2.3.

2.2 Changing the titles

Commands are provided for controlling the appearance of the titles. Following L^{A}TEX custom, the title texts are the values of the \contentsname,

\listfigurename and \listtablename commands.

Similar sets of commands are provided for ToC, LoF and LoT title typsetting control. For convenience (certainly mine, and hopefully yours) in the following descriptions I will use Z to stand for ‘toc’ or ‘lof’ or ‘lot’. For example, \cftmarkZ

stands for \cftmarktoc or \cftmarklof or \cftmarklot.

\cftmarkZ These macros set the appearance of the running heads on the ToC, LoF, and

LoT pages. You probably don’t need to change these.

\cftbeforeZtitleskip These lengths control the vertical spacing before and after the titles. You can \cftafterZtitleskip change them from their default values by using \setlength.

\cftZtitlefont The code used for typesetting the ToC title looks like

\cftafterZtitle
 {\cfttoctitlefont \contentsname}{\cftaftertoctitle}\par

By default, \cftZtitlefont is defined as a font specification (e.g., \Large\bfseries), and \cftafterZtitle is empty. These commands can be changed (via \renewcommand) to change the typesetting. As examples:

   • \renewcommand{\cftZtitlefont}{\hfill\Large\itshape} will result in

a Large italic title typeset flushright.

   • \renewcommand{\cftZtitlefont}{\hfill\Large\bfseries} together with
     \renewcommand{\cftafterZtitle}{\hfill} will give a centered Large

bold title.

• Doing

      \renewcommand{\cftafterZtitle}{%
        \\[\baselineskip]\mbox{}\hfill{\normalfont Page}}

will put the word ‘Page’ flushright on the line following the title. (If you do this, then you may need to decrease \cftafterZtitleskip).

   • \renewcommand{\cftafterZtitle}{\thispagestyle{empty}} will make

the page with the title empty (i.e., the page number will not be printed).

2.3 Typesetting the entries

Commands are also provided to enable finer control over the typesetting of the different kinds of entries. The parameters defining the default layout of the entries are illustrated as part of the layouts package or in [GMS94, page 34], and are repeated in Figure 1.

\cftdot In the default ToC typsetting only the more minor entries have dotted leader lines between the sectioning title and the page number. The tocloft package provides for general leaders for all entries. The ‘dot’ in a leader is given by the value of \cftdot. Its default definition is \newcommand{\cftdot}{.} which gives the default dotted leader. By changing \cftdot you can use symbols other than a period in the leader. For example

 \renewcommand{\cftdot}{\ensuremath{\ast}}

will result in a dotted leader using asterisks as the symbol.

\cftdotsep Each kind of entry can control the seperation between the dots in its leader \cftnodots (see below). For consistency though, all dotted leaders should use the same spac-

ing. The macro \cftdotsep specifies the default spacing. Its value is a number.

However, if the seperation is too large then no dots will be actually typeset. The macro \cftnodots is a seperation value that is ‘too large’.

\cftsetpnumwidth The page numbers are typeset in a fixed width box. The command

\cftsetrmarg \cftsetpnumwidth{⟨length⟩} can be used to change the width of the box (L^{A}TEX’s internal \@pnumwidth). The title texts will end before reaching the righthand margin. \cftsetrmarg{⟨length⟩} can be used to set this distance (L^{A}TEX’s internal \@tocrmarg). Note that the length used in \cftsetrmarg should be greater than the length set in \cftsetpnumwidth. These values should remain constant in any given document.

\cftparskip Normally the \parskip in the ToC, etc., is zero. This may be changed by changing the \cftparskip length. Note that the current value of \cftparskip is used for the ToC, LoF and LoT, but you can change the value before calling

\tableofcontents or \listoffigures or \listoftables if one or other of these

should have different values (which is not a good idea).

In the following I will use X to stand for the following:

• part for \part titles

   • chap for \chapter titles
   • sec for \section titles
   • subsec for \subsection titles
   • subsubsec for \subsubsection titles
   • para for \paragraph titles
   • subpara for \subparagraph titles

• fig for figure \caption titles

• subfig for subfigure \caption titles

• tab for table \caption titles

• subtab for subtable \caption titles

\cftbeforeXskip This controls the vertical space before an entry. It can be changed by using

\setlength.

\cftXindent This controls the indentation of an entry from the left margin (indent in Fig-

ure 1). It can be changed using \setlength.

\cftXnumwidth This controls the space allowed for typesetting title numbers (numwidth in Figure 1). It can be changed using \setlength. Second and subsequent lines of a multiline title will be indented by this amount.

The remaining commands are related to the specifics of typesetting an entry. This is a simplified pseudo-code version for the typesetting of numbered and unnumbered entries.

 {\cftXfont {\cftXpresnum SNUM\cftXaftersnum\hfil} \cftXaftersnumb TITLE}%
         {\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par
 {\cftXfont TITLE}{\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par

where SNUM is the section number, TITLE is the title text and PAGE is the page number. In the numbered entry the pseudo-code

{\cftXpresnum SNUM\cftaftersnum\hfil}

is typeset within a box of width \cftXnumwidth.

\cftXfont This controls the appearance of the title (and its preceeding number, if any).

It may be changed using \renewcommand.

\cftXpresnum Normally the section number is typeset within a box of width \cftXnumwidth.

\cftXaftersnum
\cftXaftersnumb

Within the box the macro \cftXpresnum is first called, then the number is typeset, and next the \cftXaftersnum macro is called after the number is typeset. The last command within the box is \hfil to make the box contents flushleft. After the box is typeset the \cftXaftersnumb macro is called before typesetting the title text. All three of these can be changed by \renewcommand. By default they are defined to do nothing.

In the standard classes the ToC entry for a \part is just typeset as the number and title, followed by the page number, with the \cftpartpresnum macro being called before typesetting the number and title. When a standard class is used the

\cftpartaftersnum and \cftpartaftersnumb macros have no effect, but they

may do something if a non-standard class is used.

\cftXleader \cftXleader defines the leader between the title and the page number; it \cftXdotsep can be changed by \renewcommand. The spacing between any dots in the leader

is controlled by \cftXdotsep (\@dotsep in Figure 1). It can be changed by \renewcommand and its value must be either a number (e.g., 6.6 or \cftdotsep) or \cftnodots (to disable the dots). The spacing is in terms of math units where there are 18mu to 1em.

\cftXpagefont This defines the font to be used for typesetting the page number. It can be

changed by \renewcommand.

\cftXafterpnum This macro is called after the page number has been typeset. Its default is to

do nothing. It can be changed by \renewcommand.

\cftsetindents The command \cftsetindents{⟨entry⟩}{⟨indent⟩}{⟨numwidth⟩} sets the ⟨entry⟩’s indent to the length ⟨indent⟩ and its numwidth to the length ⟨numwidth⟩. The ⟨entry⟩ argument is the name of one of the standard entries (e.g., subsection) or the name of entry that has been defined with the tocloft package. For example

\cftsetindents{figure}{0em}{1.5em}

will make figure entries left justified.

Various effects can be achieved by changing the definitions of \cftXfont,

\cftXaftersnum, \cftXaftersnumb, \cftXleader and \cftXafterpnum, either

singly or in combination. For the sake of some examples, assume that we have the following initial definitions

 \newcommand{\cftXfont}{}
 \newcommand{\cftXaftersnum}{}
 \newcommand{\cftXaftersnumb}{}
 \newcommand{\cftXleader}{\cftdotfill{\cftXdotsep}}
 \newcommand{\cftXdotsep}{\cftdotsep}
 \newcommand{\cftXpagefont}{}
 \newcommand{\cftXafterpnum}{}

(Note that the same font should be used for the title, leader and page number to provide a coherent appearance).

• To eliminate the dots in the leader:

 \renewcommand{\cftXdotsep}{\cftnodots}

• To put something (e.g., a name) before the title (number):

 \renewcommand{\cftXpresnum}{SOMETHING }

• To add a colon after the section number:

 \renewcommand{\cftXaftersnum}{:}

• To put something before the title number, add a colon after the the title number, set everything in bold font, and start the title text on the following line:

 \renewcommand{\cftXfont}{\bfseries}
 \renewcommand{\cftXleader}{\bfseries\cftdotfill{\cftXdotsep}}
 \renewcommand{\cftXpagefont}{\bfseries}
 \renewcommand{\cftXpresnum}{SOMETHING }
 \renewcommand{\cftXaftersnum}{:}
 \renewcommand{\cftXaftersnumb}{\\}

If you are adding text in the number box in addition to the number, then you will probably have to increase the width of the box so that multiline titles have a neat vertical alignment; changing box widths usually implies that the indents will require modification as well.^{4} One possible method of adjusting the box width for the above example is:

 \newlength{\mylen}   % a "scratch" length
 \settowidth{\mylen}{\bfseries\cftXpresnum\cftXaftersnum} % extra space
 \addtolength{\cftXnumwidth}{\mylen} % add the extra space

• To set the section numbers flushright:^{5}

 \setlength{\mylen}{0.5em}   % need some extra space at end of number
 \renewcommand{\cftXpresnum}{\hfill}  % note the double `l'
 \renewcommand{\cftXaftersnum}{\hspace*{\mylen}}
 \addtolength{\cftXnumwidth}{\mylen}

In the above, the added initial \hfill in the box overrides the final \hfil in the box, thus shifting everything to the right hand end of the box. The extra space is so that the number is not typeset immediately at the left of the title text.

4Lyndon Dudding (lyndon.dudding@totalise.co.uk) discovered this.

5With thanks to David Holz (lbda@earthlink.net) for requesting this.

• To set the entry ragged left (but this only looks good for single line titles):

      \renewcommand{\cftXfont}{\hfill\bfseries}
      \renewcommand{\cftXleader}{}

• To set the page number immediately after the entry text instead of at the righthand margin:

      \renewcommand{\cftXleader}{}
      \renewcommand{\cftXafterpnum}{\cftparfillskip}

By default the \parfillskip value is locally set to fill up the last line of a paragraph. Just changing \cftXleader puts horrible interword spaces into the last line of the title. The \cftparfillskip command is part of the tocloft package and is provided just so that the above effect can be achieved.

\cftpagenumbersoff The command \cftpagenumbersoff{⟨entry⟩} will eliminate the page numbers \cftpagenumberson for ⟨entry⟩ in the listing, where ⟨entry⟩ is the name of one of the standard kinds

of entries (e.g., subsection, or figure — including subfigure if the subfigure package is used — etc.), or the name of a new entry defined wih the tocloft package.

The command \cftpagenumberson{⟨entry⟩} reverses the effect of a corre-

sponding \cftpagenumbersoff.

One question that appeared on the comp.text.tex newsgroup asked how to get the titles of Appendices list in the ToC without page numbers. Here is a simple way of doing it, assuming the document has chapters

 ...
 \appendix
 \addtocontents{toc}{\cftpagenumbersoff{chapter}}
 \chapter{First appendix}

If there are other chaptered headings to go into the ToC after the appendices, then it will be necessary to do a similar

\addtocontents{toc}{\cftpagenumberson{chapter}}

to restore the page numbering in the ToC.

Similarly, if you are using the subfigure package you may want to eliminate the page numbers for the subfigure captions. This can be accomplished by:

\cftpagenumbersoff{subfigure}

At this point, I leave it up to your ingenuity as to other effects that you can achieve. However, if you come up with further examples, let me know for possible inclusion in a later version of this document.

2.4 New list of…

\newlistof The command \newlistof[⟨within⟩]{⟨entry⟩}{⟨ext⟩}{⟨listofname⟩} creates a

new List of …, and assorted commands to go along with it.

The first required argument, ⟨entry⟩ is used to define a new counter called entry. The optional ⟨within⟩ argument can be used so that entry gets reset to one every time the counter called within is changed. That is, the first two arguments are equivalent to calling \newcounter{⟨entry⟩}[⟨within⟩].

The next argument, ⟨ext⟩, is the file extension for the new List of. The last argument, ⟨listofname⟩, is the text for the heading of the new List of. As an example:

 \newcommand{\listanswername}{List of Answers}
 \newlistof[chapter]{answer}{ans}{\listanswername}

will create a new answer counter that will be reset at the start of each \chapter{...}. Any answer titles will be written to the file jobname.ans and \listanswername will be used as the list heading. A command \listofanswer is created which can be used just like the \listoftables or tableofcontents commands to generate a listing. It is up to you to specify how the entries are put into the new List of Answers. Here is a very simple example, remembering that an answer counter has been created.

 \newcommand{\answer}[1]{%
   \refstepcounter{answer}
   \par\noindent\textbf{Answer \theanswer. #1}
   \addcontentsline{ans}{answer}{\protect\numberline{\theanswer}#1}\par}

which, when used like:

\answer{Hard} The \ldots will print as:

Answer 1. Hard The … As mentioned above, the \newlistof command creates several new commands,

most of which you should now be familiar with. For convenience, assume that \newlistof{X}{Z}{...} has been issued; so X is the name of the new counter and corresponds to the X in section 2.3, and Z is the new file extension and corresponds to the Z in section 2.2. Then, among others, the following new commands will be made available.

   The five commands, \cftmarkZ, \cftbeforeZtitleskip, \cftafterZtitleskip,

\cftZtitlefont, and \cftafterZtitle, are analagous to the commands of the same names described in section 2.2.

\listofX The command \listofX is similar to \listoftables, etc., in that it typesets

the new listing at the point where it is called.

\Zdepth The command \Zdepth{⟨number⟩} is analagous to the standard \tocdepth{⟨number⟩} command, in that it specifies that entries in the new listing should not be typeset if their numbering level is greater than ⟨number⟩. The default definition is

\setcounter{Zdepth}{1}.

\newlistentry The command \newlistentry[⟨within⟩]{⟨entry⟩}{⟨ext⟩}{⟨level-1 ⟩} creates new commands for typesetting a new kind of entry in a listing. It is used internally by the \newlistof command but may be used independently.

The first required argument, ⟨entry⟩ is used to define a new counter called entry. The optional ⟨within⟩ argument can be used so that entry gets reset to one every time the counter called within is changed. That is, the first two arguments are equivalent to calling \newcounter{⟨entry⟩}[⟨within⟩]. The second required argument, ⟨ext⟩, is the file extension for the entry listing. The last argument, ⟨level-1 ⟩, is a number specifying the numbering level minus one, of the entry in a listing. For example, the command

\newlistof[chapter]{answer}{ans}{\listanswername}

will call the command:

\newlistentry[chapter]{answer}{ans}{0}

Calling \newlistentry creates several new commands. Assuming that it is

called as \newlistentry[within]{X}{Z}{N}, where X and Z are similar to the

previous uses of them, and N is an integer number, then the following commands are made available.

   The set of commands \cftbeforeXskip, \cftXfont, \cftXpresnum, \cftXaftersnum,
\cftXaftersnumb, \cftXleader, \cftXdotsep, \cftXpagefont, and \cftXafterpnum,

are analagous to the commands of the same names described in section 2.3. Their default values are also as described earlier.

The default values of \cftXindent and \cftXnumwidth are set according to the value of the ⟨level-1 ⟩ argument (i.e., N in this example). For N=0 the settings correspond to those for sections in non-chaptered documents, as listed in Table 1. For N=4 the settings correspond to subparagraphs in non-chaptered documents, and for intermediate values correspond to the matching sectional division in chaptered documents. For values of N less than zero or greater than four, or for non-default values, use the \cftsetindents command to set the values.

\l@X \l@X is an internal command that typesets an entry in the list, and is defined in terms of the above \cft*X* commands. It will not typeset an entry if \Zdepth is N or less, where Z is the listing’s file extension.

\theX The command \theX prints the value of the X counter. It is initially defined so that it prints arabic numerals. If the optional ⟨within⟩ argument is used, \theX is defined as

\renewcommand{\theX}{\thewithin.\arabic{X}} otherwise as
\renewcommand{\theX}{\arabic{X}}.

As an example of the independent use of \newlistentry, the following will set up for sub-answers.

 \newlistentry[answer]{subanswer}{1}
 \cftsetindents{subanswer}{1.5em}{3.0em}
 \renewcommand{\thesubanswer}{\theanswer.\alph{subanswer}}
 \newcommand{\subanswer}[1]{%
    \refstepcounter{subanswer}
    \par\textbf{\thesubanswer) #1}
    \addcontentsline{ans}{subanswer{\protect\numberline{\thesubanswer}#1}}
 \setcounter{ansdepth}{2}

And then:

 \answer{Harder} The \ldots
   \subanswer{Reformulate the problem} It assists \ldots

will be typeset as: Answer 2. Harder

The …

2.a) Reformulate the problem It assists …

By default the answer entries will appear in the List of Answers listing (typeset by the \listofanswer command). In order to get the subanswers to appear, the

\setcounter{ansdepth}{2} command was used above.

To turn off page numbering for the subanswers, do

\cftpagenumbersoff{subanswer}

As another example of \newlistentry, suppose that an extra sectioning division below subparagraph is required, called subsubpara. The \subsubpara command itself can be defined via the LaTeX kernel \@startsection command. Also it is necessary to define a \subsubparamark macro, a new subsubpara counter, a \thesubsubpara macro and a \l@subsubpara macro. Using the tocloft package’s \newlistentry takes care of most of these as shown below (remember the caveats about commands with @ signs in them).

 \newcommand{\subsubpara}{\@startsection{subpara}%
    {6}%                                                level
    {\parindent}%                     indent from left margin
    {3.25ex \@plus1ex \@minus .2ex}%       skip above heading
    {-1em}%       runin heading with 1em between title & text
    {\normalfont\normalsize\itshape}% italic number and title
 }
 \newlistentry[subparagraph]{subsubpara}{toc}{5}
 \cftsetindents{subsubpara}{14.0em}{7.0em}
 \newcommand*{\subsubparamark}[1]{}     % gobble heading mark

Each List of… uses a file to store the list entries, and these files must remain open for writing throughout the document processing. TeX has only a limited number of files that it can keep open, and this puts a limit on the number of listings that can be used. For a document that includes a ToC but no other extra ancilliary files (e.g., no index or bibliography output files) the maximum number of LoX’s, including a LoF and LoT, is no more than about eleven. If you try and create too many new listings LaTeX will respond with the error message:

                      No room for a new write

If you get such a message the only recourse is to redesign your document.

The tocloft package does not provide a simple means of specifying new Lists of Floats or float environments. For those, I recommend the ccaption package [Wil01].

2.5 Experimental utilities

The macros described in this section are even more experimental than those described previously.

\cftchapterprecis Some old style novels, and even some modern text books,^{6} include a short synopsis of the contents of the chapter either immediately after the chapter heading or in the Toc, or in both places.

The command \cftchapterprecis{⟨text⟩} prints its argument both at the point in the document where it is called, and also adds it to the .toc file. For example:

 ...

6For example, Robert Sedgewick, Algorithms, Addison-Wesley, 1983.

 \chapter{} % first chapter
 \cftchapterprecis{Our hero is introduced; family tree; early days.}
 ...

\cftchapterprecishere The \cftchapterprecis command calls these two commands to print the text \cftchapterprecistoc in the document (the \...here{⟨text⟩} command) and to put it into the ToC (the

\...toc{⟨text⟩} command). These can be used individually if required.

Sometimes it may be desirable to make a change to the global parameters for an individual entry. For example, a figure might be placed on the end paper of a book (the inside of the front or back cover), and this needs to be placed in a LoF with the page number set as, say ‘inside front cover’. If ‘inside front cover’ is typeset as an ordinary page number it will stick out into the margin. Therefore, the parameters for this particular entry need to be changed.

\cftlocalchange The command \cftlocalchange{⟨file⟩}{⟨pnumwidth⟩}{⟨tocrmarg⟩} will write an entry into ⟨file⟩ to reset the global parameters. The command should be called again after any special entry to reset the parameters back to their usual values. Any fragile commands used in the arguments must be protected.

\cftaddtitleline The command \cftaddtitleline{⟨file⟩}{⟨kind⟩}{⟨title⟩}{⟨page⟩} will write a \contentsline entry into ⟨file⟩ for a ⟨kind⟩ entry with title ⟨title⟩ and page number ⟨page⟩. That is, an entry is made of the form:

\contentsline{kind}{title}{page}

Any fragile commands used in the arguments must be protected.

\cftaddnumtitleline  The command \cftaddnumtitleline{⟨file⟩}{⟨kind⟩}{⟨num⟩}{⟨title⟩}{⟨page⟩}

is similar except that it also includes ⟨num⟩ as the argument to the \numberline. That is, an entry is made of the form:

\contentsline{kind}{\numberline{num} title}{page}

Any fragile commands used in the arguments must be protected.

As an example of the use of these commands, noting that the default L^{A}TEX values for \@pnumwidth and \@tocrmarg are 1.55em and 2.55em respectively, one might do the following for a figure on the frontispiece page.

 ...
 % this is the frontispiece page with no number
 % draw or import the picture (with no \caption)
 \cftlocalchange{lof}{4em}{5em} % make pnumwidth big enough for
                                % frontispiece and change margin to suit
 \cftaddtitleline{lof}{figure}{The title}{frontispiece}
 \cftlocalchange{lof}{1.55em}{2.55em} % return to normal settings
 ...

Recall that a \caption command will put an entry in the .lof file, which is not wanted here. If a caption is required, then you can either craft one youself or, assuming that your general captions are not too exotic, use the \legend command from the ccaption package. If the illustration is numbered, use the

\cftaddnumtitleline command instead of \cftaddtitleline.

2.6 Usage with other packages

The tocloft and tocbibind packages can be used together in the same document. The tocbibind package provides easy means of adding document elements like the bibliography or the index to the Table of Contents. However there are two known potential problems:

• The 1998/11/15 version of tocbibind may give surprising results if the

     \toctocname, \toclotname or \toclofname commands have been used.

You should consider getting the current version of tocbibind.

• If the argument to the \tocotherhead command is other than one of the normal sectioning divisions (i.e., part through to sub-paragraph) such as \tocotherhead{clause}, then this will almost certainly cause a problem (as the tocloft package will not know how to define the corresponding \l@clause command). In such a case you will have to supply the appropriate macros youself.

\@cftbsnum Some packages, like the float package by Anselm Lingnau, enable the creation of

\@cftasnum
\@cftasnumb

other kinds of List of …. The tocloft package is only minimally able to change the formatting of these, principally because the packages are independent of each other and, in the case of the float package, new kinds of float environments and their associated lists can be created on the fly at any point in a document. Some aspects of the typesetting are controlled by \@cftbsnum, \@cftasnum and \@cftasnumb commands. These are equivalent to the \cftXpresnum, \cftXaftersnum and \cftXaftersnumb commands described earlier. By default they are defined to do nothing, but may be renewed to do something.

The tocloft and minitoc packages have an unfortunate interaction,^{7} which fortunately can be fixed. In the normal course of events, when minitoc is used in a chaptered document it will typeset section entries in the minitocs in bold font. If tocloft is used in conjunction with minitoc, then the minitoc section entries are typeset in the normal font, except for the page numbers which are in bold font, while the ToC section entries are all in normal font.

One cure, if you want the minitoc section entries to be all in normal font is to put:

 \renewcommand{\mtcSfont}{\small\normalfont}

in the preamble.

Otherwise, the cure is the following incantation:

 \renewcommand{\cftsecfont}{\bfseries}
 \renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftdotsep}}
 \renewcommand{\cftsecpagefont}{\bfseries}

To have the section entries in both the ToC and the minitocs in bold then put the incantation in the preamble. To have only the minitoc section entries in bold while the ToC entries are in the normal font, put the incantation between the \tableofcontents command and the first \chapter command.

In general, use with other packages that redefine any of the macros that tocloft also modifies is likely to be problematic.

7Discovered by Lyndon Dudding (lyndon.dudding@totalise.co.uk).

3 The package code

Announce the name and version of the package, which requires L^{A}TEX 2ε but no extra packages.

1 ⟨∗usc⟩

 2 \NeedsTeXFormat{LaTeX2e}
 3 \ProvidesPackage{tocloft}[2003/01/20 v2.3b parameterised ToC, etc., typesetting]

\PRWPackageNote \PRWPackageNoteNoLine These two commands write a Package Note to the terminal and the log file. Use as: \PRWPackageNote{⟨package name⟩}{⟨note text⟩}. The NoLine version does not show the line number. The commands are intermediate between the kernel

\PackageWarning and \PackageInfo commands. I have \provided the \PRW...

commands as other packages (of mine) may also incorporate them. The code is

based on lterror.dtx.
 4 \providecommand{\PRWPackageNote}[2]{%
 5 \GenericWarning{%
 6  (#1)\@spaces\@spaces\@spaces\@spaces
 7 }{%
 8 Package #1 Note: #2%
 9 }%

10 }

11 \providecommand{\PRWPackageNoteNoLine}[2]{%
12 \PRWPackageNote{#1}{#2\@gobble}%

13 }

In order to try and avoid name clashes with other packages, each internal name will include the character string @cft.

\@cftquit \if@cfthaschapter We will be using either chapter or section type headings for the ToC, etc., so we need to know which of these the document class supports.

14 \newcommand{\@cftquit}{}
15 \newif\if@cfthaschapter

\if@cftkoma The koma classes have different defaults than the standard classes, so we need to know if a koma class has been loaded.

16 \newif\if@cftkoma
17 \@cftkomafalse
18 \@ifclassloaded{scrartcl}{\@cftkomatrue}{}
19 \@ifclassloaded{scrreprt}{\@cftkomatrue}{}
20 \@ifclassloaded{scrbook}{\@cftkomatrue}{}

21

Issue a warning if there are no recognised sectional divisions and then skip the rest of the package code.

22 \@ifundefined{chapter}{%
23 \@cfthaschapterfalse
24 \@ifundefined{section}{%
25  \PackageWarning{tocloft}%
26  {I don't recognize any sectional divisions so I'll do nothing}
27  \renewcommand{\@cftquit}{\endinput}
28  }{\PRWPackageNoteNoLine{tocloft}{The document has section divisions}}
29 }{\@cfthaschaptertrue
30  \PRWPackageNoteNoLine{tocloft}{The document has chapter divisions}}

Perhaps quit now.

31 \@cftquit

Use chapter style if \if@cfthaschapter is TRUE, otherwise section style.

\if@cfttocbibind A flag that is set TRUE iff the tocbibind package has been loaded. The 1998/11/15 version of tocbibind does not necessarily work well with tocloft.

32 \newif\if@cfttocbibind
33 \AtBeginDocument{%
34 \@ifpackageloaded{tocbibind}{\@cfttocbibindtrue}{\@cfttocbibindfalse}
35 \if@cfttocbibind
36  \@ifpackagelater{tocbibind}{1998/11/16}{}{%
37  \PackageWarning{tocloft}{%
38 You are using a version of the tocbibind package\MessageBreak
39 that is not compatible with tocloft.\MessageBreak
40 The results may be surprising.\MessageBreak
41 Consider installing the current version of tocbibind.}}
42 \fi

43 }

\if@cftnctoc A boolean used to implement the titles option. It is TRUE if the ToC, LoT, LoF titles should use the default styles.

44 \newif\if@cftnctoc\@cftnctocfalse
45 \DeclareOption{titles}{\@cftnctoctrue}
46 %% \ProcessOptions\relax

\if@cftsubfigopt A boolean used to implement the subfigure option.

47 \newif\if@cftsubfigopt\@cftsubfigoptfalse
48 \DeclareOption{subfigure}{\@cftsubfigopttrue}

Process the options.

49

50 \ProcessOptions\relax

51

\tocloftpagestyle \@cftpagestyle A user-level macro to set the pagestyle for the first page of the ToC, etc. The default is the plain pagestyle.

52 \newcommand{\tocloftpagestyle}[1]{%
53 \def\@cftpagestyle{\thispagestyle{#1}}}
54 \tocloftpagestyle{plain}

55

\cftmarktoc \cftmarklof \cftmarklot These three macros set the style for running heads. They are initialised to give the default appearance.

56 \newcommand{\cftmarktoc}{%
57 \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
58 \newcommand{\cftmarklof}{%
59 \@mkboth{\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
60 \newcommand{\cftmarklot}{%
61 \@mkboth{\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
62 \if@cftkoma
63 \renewcommand{\cftmarktoc}{%
64  \@mkboth{\contentsname}{\contentsname}}

65 \renewcommand{\cftmarklof}{%
66  \@mkboth{\listfigurename}{\listfigurename}}
67 \renewcommand{\cftmarklot}{%
68  \@mkboth{\listtablename}{\listtablename}}
69 \fi

\@cfttocstart \@cfttocfinish Two macros to perform the actions at the beginning and end of the \tableofcontents command (and friends). \@cfttocstart deals with chaptered documents, ensuring that the ToC is typeset in a single column (see classes.dtx for the original code). These macros are also provided by the ccaption package.

70 \providecommand{\@cfttocstart}{%
71 \if@cfthaschapter
72  \if@twocolumn
73  \@restonecoltrue\onecolumn
74  \else
75  \@restonecolfalse
76  \fi
77 \fi}

\@cfttocfinish resets, if required, twocolumn typesetting.

78 \providecommand{\@cfttocfinish}{%
79 \if@cfthaschapter
80  \if@restonecol\twocolumn\fi
81 \fi}

\phantomsection This is provided because the hyperref package screws with \addcontentsline.

82 \providecommand{\phantomsection}{}

83

\@cftdobibtoc If the tocbibind package has been used and it has redefined \tableofcontents we need to cater for that. The contents of the definition are defined in tocbibind.

84 \newcommand{\@cftdobibtoc}{%
85 \if@dotoctoc
86  \if@bibchapter
87  \phantomsection
88  \addcontentsline{toc}{chapter}{\contentsname}
89  \else
90  \phantomsection
91  \addcontentsline{toc}{\@tocextra}{\contentsname}
92  \fi
93 \fi}

94

\cftparskip The \parskip local to the ToC, etc., is set to the length \cftparskip.

95 \newlength{\cftparskip}
96 \setlength{\cftparskip}{0pt}

97

\tableofcontents This is a parameterised version of the default \tableofcontents command. Each class has its own definition, but we have to cater for all classes in one definition, hence some of the checks. The definition is modified after all packages have been loaded.

If the titles option has been used, then the command is not modified.

 98 \AtBeginDocument{%
 99 \if@cftnctoc\else
100 \renewcommand{\tableofcontents}{%
101  \@cfttocstart

Ensure that any previous paragraph has been finished. Within a group set the local paragraphing style and typeset the title.

102  \par
103  \begingroup
104  \parindent\z@ \parskip\cftparskip
105  \@cftmaketoctitle

If tocbibind has been used, then add the ToC name to the ToC.

106  \if@cfttocbibind
107  \@cftdobibtoc
108  \fi

Finally, read the .toc file and finish up.

109  \@starttoc{toc}%
110  \endgroup
111  \@cfttocfinish}
112 \fi

113 }

\@cftmaketoctitle This command typesets the title for the ToC.

114 \newcommand{\@cftmaketoctitle}{%
115 \addpenalty\@secpenalty
116 \if@cfthaschapter
117  \vspace*{\cftbeforetoctitleskip}
118 \else
119  \vspace{\cftbeforetoctitleskip}
120 \fi
121 \@cftpagestyle
122 {\interlinepenalty\@M
123 {\cfttoctitlefont\contentsname}{\cftaftertoctitle}
124 \cftmarktoc
125 \par\nobreak
126 \vskip \cftaftertoctitleskip
127 \@afterheading}}

\cftbeforetoctitleskip \cftaftertoctitleskip These two lengths control the vertical spacing before and after the ToC title.

128 \newlength{\cftbeforetoctitleskip}
129 \newlength{\cftaftertoctitleskip}

Their values depend on whether the document has chapters or not. In chaptered documents the default ToC title is typeset as a \chapter*, otherwise as a

 \section*.
130 \if@cfthaschapter
131 \setlength{\cftbeforetoctitleskip}{50pt}
132 \setlength{\cftaftertoctitleskip}{40pt}
133 \else
134 \setlength{\cftbeforetoctitleskip}{3.5ex \@plus 1ex \@minus .2ex}
135 \setlength{\cftaftertoctitleskip}{2.3ex \@plus.2ex}
136 \fi

\cfttoctitlefont \cftaftertoctitle The ToC title is typeset in the style given by \cfttoctitlefont. The macro

\cftaftertoctitle is called after typesetting the title. This is initialised to do nothing. Both these macros can be redefined to do other things (e.g., adding an \hfill to \cfttoctitlefont will make the title flushright).

137 \if@cfthaschapter
138 \newcommand{\cfttoctitlefont}{\normalfont\Huge\bfseries}
139 \if@cftkoma\renewcommand{\cfttoctitlefont}{\size@chapter\sectfont}\fi
140 \else
141 \newcommand{\cfttoctitlefont}{\normalfont\Large\bfseries}
142 \if@cftkoma\renewcommand{\cfttoctitlefont}{\size@section\sectfont}\fi
143 \fi
144 \newcommand{\cftaftertoctitle}{}
\cftsetpnumwidth \cftsetrmarg Users commands for setting \@pnumwidth and \@tocrmarg.
145 \newcommand{\cftsetpnumwidth}[1]{\renewcommand{\@pnumwidth}{#1}}
146 \newcommand{\cftsetrmarg}[1]{\renewcommand{\@tocrmarg}{#1}}

\cftdot \cftdotfill In the default ToC, a dotted line can be used to provide a leader between a title and the page number. The definition of this leader is buried in the \@dottedtocline command. The \cftdotfill{⟨sep⟩} command provides a parameterised version of the leader code, where ⟨sep⟩ is the seperation between the dots in mu units. The symbol used for the ‘dots’ in the leader is given by the value of \cftdot. These macros are also provided by the ccaption package.

147 \providecommand{\cftdot}{.}
148 \providecommand{\cftdotfill}[1]{%
149 \leaders\hbox{$\m@th\mkern #1 mu\hbox{\cftdot}\mkern #1 mu$}\hfill}

\cftdotsep \cftnodots \cftdotsep holds the default dot seperation, and is also provided by the ccaption package. If the kerns in \cftdotfill are large enough, then no dots will be printed. \cftnodots should be ‘large enough’.

150 \providecommand{\cftdotsep}{4.5}
151 \newcommand{\cftnodots}{10000}

Now for the trickier bits regarding the typesetting of the ToC entries.

A .toc (also .lof and .lot) file consists of a list of \contentsline{⟨kind⟩}{⟨title⟩}{⟨page⟩} commands, where ⟨kind⟩ is the kind of heading (e.g., part or section or figure), ⟨title⟩ is the title text (including the number), and ⟨page⟩ is the page number. The entries are inserted into the file by calling the \addcontentsline{⟨file⟩}{⟨kind⟩}{⟨title⟩} command, where ⟨file⟩ is the file extension (e.g., toc, lot) and the other arguments are the same as for the \contentsline command. (Arbitrary stuff may also be put into the file via the \addtocontents{⟨file⟩}{⟨text⟩} command). The typesetting of the \contentsline entries is performed by commands of the form \l@kind. The sectioning and captioning commands call \addcontentsline to insert their titles into the .toc etc., files.

For the purposes at hand it is generally impossible to treat the typesetting of a title and its number seperately, as both are bundled into the ⟨title⟩ argument within \contentsline. They could be handled seperately if the \contentsline command was suitably modified. If this was done, then the \addtocontentsline command would also need to be changed which would then require the sectioning and captioning commands to be modified as well. This is certainly possible, but would cause problems if any other package also modified the sectioning or captioning commands, and there are several packages which do this.

Having said this, for all but Part entries, the sectional number is typeset via the \numberline command. We can take advantage of this fact.

I have taken the decision to not touch the \contentsline macro and instead to do what can be done with it as it exists. That is, I will modify the \l@kind commands. Essentially, my new definitions consist of inlined versions of the code

for \@dottedtocline.
\cftparfillskip The \l@kind commands modify (locally) the value of \parfillskip. \cftparfillskip

is a copy of the default TEXbook \parfillskip definition.

152 \newcommand{\cftparfillskip}{\parfillskip=0pt plus1fil}

\numberline The purpose of the \numberline{⟨secnum⟩} command is to typeset ⟨secnum⟩ left justified in a box of width \@tempdima. I redefine it to add three additional

parameters, namely \@cftbsnum, \@cftasnum and \@cftasnumb (see ltsect.dtx

for the original definition).

153 \renewcommand{\numberline}[1]{%
154 \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}

\@cftbsnum \@cftasnum \@cftasnumb Originally these were not defined but were \let to appropriate commands in the \l@... commands, but they have to be defined in case something unexpected calls \numberline, for example through use of the float package.^{8}

155 \newcommand{\@cftbsnum}{}
156 \newcommand{\@cftasnum}{}
157 \newcommand{\@cftasnumb}{}

\l@part \if@cftdopart \l@part{⟨title⟩}{⟨page⟩} typesets the ToC entry for a part heading. It is a parameterised copy of the default \l@part (see classes.dtx for the original definition and the code below for \l@subsection for an explanation of most of this code). By default, Parts (and Chapters) do not have dotted leaders. This package provides for all entries to have dotted leaders.

158 \newif\if@cftdopart
159 \newif\if@cfthaspart
160 \@ifundefined{part}{\@cfthaspartfalse}{\@cfthasparttrue}
161 \if@cfthaspart
162 \renewcommand*{\l@part}[2]{%
163 \@cftdopartfalse
164 \ifnum \c@tocdepth >-2\relax
165  \if@cfthaschapter
166  \@cftdoparttrue
167  \fi
168  \ifnum \c@tocdepth >\m@ne
169  \if@cfthaschapter\else
170  \@cftdoparttrue
171  \fi
172  \fi
173 \fi
174 \if@cftdopart

8This bug was discovered by Andrew Thurber when using the tocloft and algorithm packages together.

175  \if@cfthaschapter
176  \addpenalty{-\@highpenalty}%
177  \else
178  \addpenalty\@secpenalty
179  \fi
180  \addvspace{\cftbeforepartskip}%
181  \begingroup
182  {\leftskip \cftpartindent\relax
183  \rightskip \@tocrmarg
184  \parfillskip -\rightskip
185  \parindent \cftpartindent\relax\@afterindenttrue
186  \interlinepenalty\@M
187  \leavevmode
188  \@tempdima \cftpartnumwidth\relax
189  \let\@cftbsnum \cftpartpresnum
190  \let\@cftasnum \cftpartaftersnum
191  \let\@cftasnumb \cftpartaftersnumb
192  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
193  {\cftpartfont \cftpartpresnum #1}%
194  \cftpartfillnum{#2}}
195  \nobreak
196  \if@cfthaschapter
197  \global\@nobreaktrue
198  \everypar{\global\@nobreakfalse\everypar{}}%
199  \else
200  \if@compatibility
201  \global\@nobreaktrue
202  \everypar{\global\@nobreakfalse\everypar{}}%
203  \fi
204  \fi
205  \endgroup
206 \fi}
207 \fi
\cftbeforepartskip \cftpartnumwidth \cftpartfont \cftpartpresnum \cftpartaftersnum \cftpartaftersnumb \cftpartleader \cftpartdotsep \cftpartpagefont \cftpartafterpnum \cftpartindent \cftpartfillnum These are the user commands to control the typesetting of Part entries. They are

initialised to give the standard appearance.

208 \if@cfthaspart
209 \newlength{\cftbeforepartskip}
210  \setlength{\cftbeforepartskip}{2.25em \@plus\p@}
211 \newlength{\cftpartnumwidth}
212  \setlength{\cftpartnumwidth}{0em}
213 \newcommand{\cftpartfont}{\large\bfseries}
214 \newcommand{\cftpartpresnum}{}
215 \newcommand{\cftpartaftersnum}{}
216 \newcommand{\cftpartaftersnumb}{}
217 \newcommand{\cftpartleader}{\large\bfseries\cftdotfill{\cftpartdotsep}}
218 \newcommand{\cftpartdotsep}{\cftnodots}
219 \newcommand{\cftpartpagefont}{\large\bfseries}
220 \newcommand{\cftpartafterpnum}{}
221 \newlength{\cftpartindent}
222  \setlength{\cftpartindent}{0em}
223 \newcommand{\cftpartfillnum}[1]{%
224  {\cftpartleader}%
225  {\hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}\cftpartafterpnum\par}

koma classes use some different settings.

226 \if@cftkoma
227  \setlength{\cftpartnumwidth}{2em}
228  \renewcommand{\cftpartfont}{\sectfont\large}
229  \renewcommand{\cftpartpagefont}{\sectfont\large}
230 \fi
231 \fi

232

\l@chapter \l@chapter{⟨title⟩}{⟨page⟩} typesets the ToC entry for a chapter heading. It is a parameterised copy of the default \l@chapter (see classes.dtx for the original definition). This only applies to chaptered documents.

233 \if@cfthaschapter
234 \renewcommand*{\l@chapter}[2]{%
235 \ifnum \c@tocdepth >\m@ne
236  \addpenalty{-\@highpenalty}%
237  \vskip \cftbeforechapskip
238  {\leftskip \cftchapindent\relax
239  \rightskip \@tocrmarg
240  \parfillskip -\rightskip
241  \parindent \cftchapindent\relax\@afterindenttrue
242  \interlinepenalty\@M
243  \leavevmode
244  \@tempdima \cftchapnumwidth\relax
245  \let\@cftbsnum \cftchappresnum
246  \let\@cftasnum \cftchapaftersnum
247  \let\@cftasnumb \cftchapaftersnumb
248  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
249  {\cftchapfont #1}\nobreak
250  \cftchapfillnum{#2}}
251 \fi}
252 \fi
\cftbeforechapskip \cftchapindent \cftchapnumwidth \cftchapfont \cftchappresnum \cftchapaftersnum \cftchapaftersnumb \cftchapleader \cftchapdotsep \cftchappagefont \cftchapafterpnum \cftchapfillnum These are the user commands to control the typesetting of Chapter entries. They

are initialised to give the standard appearance.

253 \if@cfthaschapter
254 \newlength{\cftbeforechapskip}
255  \setlength{\cftbeforechapskip}{1.0em \@plus\p@}
256 \newlength{\cftchapindent}
257  \setlength{\cftchapindent}{0em}
258 \newlength{\cftchapnumwidth}
259  \setlength{\cftchapnumwidth}{1.5em}
260 \newcommand{\cftchapfont}{\bfseries}
261 \newcommand{\cftchappresnum}{}
262 \newcommand{\cftchapaftersnum}{}
263 \newcommand{\cftchapaftersnumb}{}
264 \newcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}}
265 \newcommand{\cftchapdotsep}{\cftnodots}
266 \newcommand{\cftchappagefont}{\bfseries}
267 \newcommand{\cftchapafterpnum}{}
268 \newcommand{\cftchapfillnum}[1]{
269  {\cftchapleader}\nobreak
270  \hb@xt@\@pnumwidth{\hfil\cftchappagefont #1}\cftchapafterpnum\par}

koma classes have different chapter settings.

271 \if@cftkoma
272  \renewcommand{\cftchapfont}{\sectfont}
273 \fi
274 \fi

275

\l@section \l@section{⟨title⟩}{⟨page⟩} typesets the ToC entry for a section heading. It is a parameterised copy of the default \l@section (see classes.dtx for the original definition).

276 \renewcommand*{\l@section}[2]{%
277 \ifnum \c@tocdepth >\z@
278  \if@cfthaschapter
279  \vskip \cftbeforesecskip
280  \else
281  \addpenalty\@secpenalty
282  \addvspace{\cftbeforesecskip}
283  \fi
284  {\leftskip \cftsecindent\relax
285  \rightskip \@tocrmarg
286  \parfillskip -\rightskip
287  \parindent \cftsecindent\relax\@afterindenttrue
288  \interlinepenalty\@M
289  \leavevmode
290  \@tempdima \cftsecnumwidth\relax
291  \let\@cftbsnum \cftsecpresnum
292  \let\@cftasnum \cftsecaftersnum
293  \let\@cftasnumb \cftsecaftersnumb
294  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
295  {\cftsecfont #1}\nobreak
296  \cftsecfillnum{#2}}
297 \fi}
\cftbeforesecskip \cftsecindent \cftsecnumwidth \cftsecfont \cftsecpresnum \cftsecaftersnum \cftsecaftersnumb \cftsecleader \cftsecdotsep \cftsecpagefont \cftsecafterpnum \cftsecfillnum These are the user commands to control the typesetting of Section entries. They

are initialised to give the standard appearance.

298 \newlength{\cftbeforesecskip}
299 \newlength{\cftsecindent}
300 \newlength{\cftsecnumwidth}
301 \newcommand{\cftsecpresnum}{}
302 \newcommand{\cftsecaftersnum}{}
303 \newcommand{\cftsecaftersnumb}{}
304 \if@cfthaschapter
305 \setlength{\cftbeforesecskip}{\z@ \@plus.2\p@}
306 \setlength{\cftsecindent}{1.5em}
307 \setlength{\cftsecnumwidth}{2.3em}
308 \newcommand{\cftsecfont}{\normalfont}
309 \newcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}}
310 \newcommand{\cftsecdotsep}{\cftdotsep}
311 \newcommand{\cftsecpagefont}{\normalfont}
312 \else
313 \setlength{\cftbeforesecskip}{1.0em \@plus\p@}
314 \setlength{\cftsecindent}{0em}
315 \setlength{\cftsecnumwidth}{1.5em}

316 \newcommand{\cftsecfont}{\bfseries}
317 \newcommand{\cftsecleader}{\bfseries\cftdotfill{\cftsecdotsep}}
318 \newcommand{\cftsecdotsep}{\cftnodots}
319 \newcommand{\cftsecpagefont}{\bfseries}
320 \fi
321 \newcommand{\cftsecafterpnum}{}
322 \newcommand{\cftsecfillnum}[1]{%
323 {\cftsecleader}\nobreak
324 \hb@xt@\@pnumwidth{\hfil\cftsecpagefont #1}\cftsecafterpnum\par}

325

\l@subsection \l@subsection{⟨title⟩}{⟨page⟩} typesets the ToC entry for a subsection heading. It is a parameterised copy of the default \l@subsection (see classes.dtx for the original definition).

326 \renewcommand*{\l@subsection}[2]{%

Only typeset the entry if it falls within the tocdepth.

327 \ifnum \c@tocdepth >\@ne

Add some vertical space.

328  \vskip \cftbeforesubsecskip

Start a group to keep paragraphing changes local. Set the \leftskip to the entry’s indentation.

329  {\leftskip \cftsubsecindent\relax

Set the \rightskip to \@tocrmarg to leave room for the page number.

330  \rightskip \@tocrmarg

Ensure that the last line of the entry will be filled. Setting \parfillskip to a negative number prevents any overfull box messages.

331  \parfillskip -\rightskip

Set the paragraph indent to the entry’s indentation.

332  \parindent \cftsubsecindent\relax\@afterindenttrue

Try and prevent breaks between lines in a multiple line entry.

333  \interlinepenalty\@M

Make sure that we have left vertical mode.

334  \leavevmode

Our version of \numberline expects that the width of the number box is in

\@tempdima, and that the three macros \@cftbsnum, \@cftasnum and \@cftasnumb

are defined. We set all these to the values for this entry.

335  \@tempdima \cftsubsecnumwidth\relax
336  \let\@cftbsnum \cftsubsecpresnum
337  \let\@cftasnum \cftsubsecaftersnum
338  \let\@cftasnumb \cftsubsecaftersnumb

Arrange that the (section number and) first line of the title is set at the current indent, and any further lines are further indented.

339  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip

Print the (number and) title, prohibiting any breaking.

340  {\cftsubsecfont #1}\nobreak

Print the leader and the page number, and close the group.

341  \cftsubsecfillnum{#2}}
342 \fi}
\cftbeforesubsecskip \cftsubsecindent \cftsubsecnumwidth \cftsubsecfont \cftsubsecpresnum \cftsubsecaftersnum \cftsubsecaftersnumb \cftsubsecleader \cftsubsecdotsep \cftsubsecpagefont \cftsubsecafterpnum These are the user commands to control the typesetting of Sub-section entries.

They are initialised to give the standard appearance.

343 \newlength{\cftbeforesubsecskip}
344 \setlength{\cftbeforesubsecskip}{\z@ \@plus.2\p@}
345 \newlength{\cftsubsecindent}
346 \newlength{\cftsubsecnumwidth}
347 \if@cfthaschapter
348 \setlength{\cftsubsecindent}{3.8em}
349 \setlength{\cftsubsecnumwidth}{3.2em}
350 \else
351 \setlength{\cftsubsecindent}{1.5em}
352 \setlength{\cftsubsecnumwidth}{2.3em}
353 \fi
354 \newcommand{\cftsubsecfont}{\normalfont}
355 \newcommand{\cftsubsecpresnum}{}
356 \newcommand{\cftsubsecaftersnum}{}
357 \newcommand{\cftsubsecaftersnumb}{}
358 \newcommand{\cftsubsecleader}{\normalfont\cftdotfill{\cftsubsecdotsep}}
359 \newcommand{\cftsubsecdotsep}{\cftdotsep}
360 \newcommand{\cftsubsecpagefont}{\normalfont}
361 \newcommand{\cftsubsecafterpnum}{}

\cftsubsecfillnum \cftsubsecfillnum{⟨page⟩} typesets the leader and the ⟨page⟩ number of a subsection entry. First print the leader and then, with no break, set the page number flushright in a box of width \@pnumwidth, not forgetting to finish the paragraph.

362 \newcommand{\cftsubsecfillnum}[1]{%
363 {\cftsubsecleader}\nobreak
364 \hb@xt@\@pnumwidth{\hfil\cftsubsecpagefont #1}\cftsubsecafterpnum\par}

365

\l@subsubsection  \l@subsubsection{⟨title⟩}{⟨page⟩} typesets the ToC entry for a subsubsection

heading. It is a parameterised copy of the default \l@subsubsection (see classes.dtx for the original definition).

366 \renewcommand*{\l@subsubsection}[2]{%
367 \ifnum \c@tocdepth >\tw@
368  \vskip \cftbeforesubsubsecskip
369  {\leftskip \cftsubsubsecindent\relax
370  \rightskip \@tocrmarg
371  \parfillskip -\rightskip
372  \parindent \cftsubsubsecindent\relax\@afterindenttrue
373  \interlinepenalty\@M
374  \leavevmode
375  \@tempdima \cftsubsubsecnumwidth\relax
376  \let\@cftbsnum \cftsubsubsecpresnum
377  \let\@cftasnum \cftsubsubsecaftersnum
378  \let\@cftasnumb \cftsubsubsecaftersnumb
379  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
380  {\cftsubsubsecfont #1}\nobreak

381  \cftsubsubsecfillnum{#2}}
382 \fi}
\cftbeforesubsubsecskip \cftsubsubsecindent \cftsubsubsecnumwidth \cftsubsubsecfont \cftsubsubsecpresnum \cftsubsubsecaftersnum \cftsubsubsecaftersnumb \cftsubsubsecleader \cftsubsubsecdotsep \cftsubsubsecpagefont \cftsubsubsecafterpnum \cftsubsubsecfillnum These are the user commands to control the typesetting of Sub-sub-section entries.

They are initialised to give the standard appearance.

383 \newlength{\cftbeforesubsubsecskip}
384 \setlength{\cftbeforesubsubsecskip}{\z@ \@plus.2\p@}
385 \newlength{\cftsubsubsecindent}
386 \newlength{\cftsubsubsecnumwidth}
387 \if@cfthaschapter
388 \setlength{\cftsubsubsecindent}{7.0em}
389 \setlength{\cftsubsubsecnumwidth}{4.1em}
390 \else
391 \setlength{\cftsubsubsecindent}{3.8em}
392 \setlength{\cftsubsubsecnumwidth}{3.2em}
393 \fi
394 \newcommand{\cftsubsubsecfont}{\normalfont}
395 \newcommand{\cftsubsubsecpresnum}{}
396 \newcommand{\cftsubsubsecaftersnum}{}
397 \newcommand{\cftsubsubsecaftersnumb}{}
398 \newcommand{\cftsubsubsecleader}{\normalfont\cftdotfill{\cftsubsubsecdotsep}}
399 \newcommand{\cftsubsubsecdotsep}{\cftdotsep}
400 \newcommand{\cftsubsubsecpagefont}{\normalfont}
401 \newcommand{\cftsubsubsecafterpnum}{}
402 \newcommand{\cftsubsubsecfillnum}[1]{%
403 {\cftsubsubsecleader}\nobreak
404 \hb@xt@\@pnumwidth{\hfil\cftsubsubsecpagefont #1}\cftsubsubsecafterpnum\par}

405

\l@paragraph \l@paragraph{⟨title⟩}{⟨page⟩} typesets the ToC entry for a paragraph heading. It is a parameterised copy of the default \l@paragraph (see classes.dtx for the original definition).

406 \renewcommand*{\l@paragraph}[2]{%
407 \ifnum \c@tocdepth >3\relax
408  \vskip \cftbeforeparaskip
409  {\leftskip \cftparaindent\relax
410  \rightskip \@tocrmarg
411  \parfillskip -\rightskip
412  \parindent \cftparaindent\relax\@afterindenttrue
413  \interlinepenalty\@M
414  \leavevmode
415  \@tempdima \cftparanumwidth\relax
416  \let\@cftbsnum \cftparapresnum
417  \let\@cftasnum \cftparaaftersnum
418  \let\@cftasnumb \cftparaaftersnumb
419  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
420  {\cftparafont #1}\nobreak
421  \cftparafillnum{#2}}
422 \fi}
\cftbeforeparaskip \cftparaindent \cftparanumwidth \cftparafont \cftparapresnum \cftparaaftersnum \cftparaaftersnumb \cftparaleader \cftparadotsep \cftparapagefont \cftparaafterpnum \cftparafillnum These are the user commands to control the typesetting of Paragraph entries.

They are initialised to give the standard appearance.

423 \newlength{\cftbeforeparaskip}

424 \setlength{\cftbeforeparaskip}{\z@ \@plus.2\p@}
425 \newlength{\cftparaindent}
426 \newlength{\cftparanumwidth}
427 \if@cfthaschapter
428 \setlength{\cftparaindent}{10em}
429 \setlength{\cftparanumwidth}{5em}
430 \else
431 \setlength{\cftparaindent}{7.0em}
432 \setlength{\cftparanumwidth}{4.1em}
433 \fi
434 \newcommand{\cftparafont}{\normalfont}
435 \newcommand{\cftparapresnum}{}
436 \newcommand{\cftparaaftersnum}{}
437 \newcommand{\cftparaaftersnumb}{}
438 \newcommand{\cftparaleader}{\normalfont\cftdotfill{\cftparadotsep}}
439 \newcommand{\cftparadotsep}{\cftdotsep}
440 \newcommand{\cftparapagefont}{\normalfont}
441 \newcommand{\cftparaafterpnum}{}
442 \newcommand{\cftparafillnum}[1]{%
443 {\cftparaleader}\nobreak
444 \hb@xt@\@pnumwidth{\hfil\cftparapagefont #1}\cftparaafterpnum\par}

445

\l@subparagraph  \l@subparagraph{⟨title⟩}{⟨page⟩} typesets the ToC entry for a subparagraph

heading. It is a parameterised copy of the default \l@subparagraph (see classes.dtx for the original definition).

446 \renewcommand*{\l@subparagraph}[2]{%
447 \ifnum \c@tocdepth >4\relax
448  \vskip \cftbeforesubparaskip
449  {\leftskip \cftsubparaindent\relax
450  \rightskip \@tocrmarg
451  \parfillskip -\rightskip
452  \parindent \cftsubparaindent\relax\@afterindenttrue
453  \interlinepenalty\@M
454  \leavevmode
455  \@tempdima \cftsubparanumwidth\relax
456  \let\@cftbsnum \cftsubparapresnum
457  \let\@cftasnum \cftsubparaaftersnum
458  \let\@cftasnumb \cftsubparaaftersnumb
459  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
460  {\cftsubparafont #1}\nobreak
461  \cftsubparafillnum{#2}}
462 \fi}
\cftbeforesubparaskip \cftsubparaindent \cftsubparanumwidth \cftsubparafont \cftsubparapresnum \cftsubparaaftersnum \cftsubparaaftersnumb \cftsubparaleader \cftsubparadotsep \cftsubparapagefont \cftsubparaafterpnum \cftsubparafillnum These are the user commands to control the typesetting of Sub-paragraph entries.

They are initialised to give the standard appearance.

463 \newlength{\cftbeforesubparaskip}
464 \setlength{\cftbeforesubparaskip}{\z@ \@plus.2\p@}
465 \newlength{\cftsubparaindent}
466 \newlength{\cftsubparanumwidth}
467 \if@cfthaschapter
468 \setlength{\cftsubparaindent}{12em}
469 \setlength{\cftsubparanumwidth}{6em}
470 \else

471 \setlength{\cftsubparaindent}{10em}
472 \setlength{\cftsubparanumwidth}{5em}
473 \fi
474 \newcommand{\cftsubparafont}{\normalfont}
475 \newcommand{\cftsubparapresnum}{}
476 \newcommand{\cftsubparaaftersnum}{}
477 \newcommand{\cftsubparaaftersnumb}{}
478 \newcommand{\cftsubparaleader}{\normalfont\cftdotfill{\cftsubparadotsep}}
479 \newcommand{\cftsubparadotsep}{\cftdotsep}
480 \newcommand{\cftsubparapagefont}{\normalfont}
481 \newcommand{\cftsubparaafterpnum}{}
482 \newcommand{\cftsubparafillnum}[1]{%
483 {\cftsubparaleader}\nobreak
484 \hb@xt@\@pnumwidth{\hfil\cftsubparapagefont #1}\cftsubparaafterpnum\par}

485

\@cftdobiblof If the tocbibind package has been used and it has redefined \listoffigures we need to cater for that. The contents of the definition are defined in tocbibind.

486 \newcommand{\@cftdobiblof}{%
487 \if@dotoclof
488  \if@bibchapter
489  \phantomsection
490  \addcontentsline{toc}{chapter}{\listfigurename}
491  \else
492  \phantomsection
493  \addcontentsline{toc}{\@tocextra}{\listfigurename}
494  \fi
495 \fi}

496

\listoffigures This is a parameterised version of the default \listoffigures command. The changes are postponed until after all packages have been loaded. Each class has its own definition, but we have to cater for all classes in one definition, hence some of the checks. First, perform the default checks for multicolumns. (Do nothing if titles option is used).

497 \AtBeginDocument{
498 \if@cftnctoc\else
499 \renewcommand{\listoffigures}{%
500 \@cfttocstart

Ensure that any previous paragraph has been finished. Within a group set the local paragraphing style. Typeset the title and then do the contents of the .lof file.

501 \par
502 \begingroup
503  \parindent\z@ \parskip\cftparskip
504  \@cftmakeloftitle
505  \if@cfttocbibind
506  \@cftdobiblof
507  \fi
508  \@starttoc{lof}%
509 \endgroup

Finally, restore any multicolumn typesetting.

510 \@cfttocfinish}
511 \fi

512 }

513

\@cftmakeloftitle This command typesets the title for the LoF.

514 \newcommand{\@cftmakeloftitle}{%
515 \addpenalty\@secpenalty
516 \if@cfthaschapter
517  \vspace*{\cftbeforeloftitleskip}
518 \else
519  \vspace{\cftbeforeloftitleskip}
520 \fi
521 \@cftpagestyle
522 {\interlinepenalty\@M
523 {\cftloftitlefont\listfigurename}{\cftafterloftitle}
524 \cftmarklof
525 \par\nobreak
526 \vskip \cftafterloftitleskip
527 \@afterheading}}

528

\cftbeforeloftitleskip \cftafterloftitleskip These two lengths control the vertical spacing before and after the LoF title.

529 \newlength{\cftbeforeloftitleskip}
530 \newlength{\cftafterloftitleskip}

Their values depend on whether the document has chapters or not. In chaptered documents the default LoF title is typeset as a \chapter*, otherwise as a

 \section*.
531 \if@cfthaschapter
532 \setlength{\cftbeforeloftitleskip}{50pt}
533 \setlength{\cftafterloftitleskip}{40pt}
534 \else
535 \setlength{\cftbeforeloftitleskip}{3.5ex \@plus 1ex \@minus .2ex}
536 \setlength{\cftafterloftitleskip}{2.3ex \@plus.2ex}
537 \fi
\cftloftitlefont \cftafterloftitle The LoF title is typeset in the style given by \cftloftitlefont. The macro

\cftafterloftitle is called after typesetting the title. This is initialised to do nothing. Both these macros can be redefined to do other things (e.g., adding an \hfill to \cftloftitlefont will make the title flushright).

538 \if@cfthaschapter
539 \newcommand{\cftloftitlefont}{\normalfont\Huge\bfseries}
540 \if@cftkoma\renewcommand{\cftloftitlefont}{\size@chapter\sectfont}\fi
541 \else
542 \newcommand{\cftloftitlefont}{\normalfont\Large\bfseries}
543 \if@cftkoma\renewcommand{\cftloftitlefont}{\size@section\sectfont}\fi
544 \fi
545 \newcommand{\cftafterloftitle}{}

546

\l@figure \l@figure{⟨title⟩}{⟨page⟩} typesets the LoF entry for a figure caption heading. It is a parameterised copy of the default \l@figure (see classes.dtx for the original definition).

547 \renewcommand*{\l@figure}[2]{%
548 \ifnum \c@lofdepth >\z@
549  \vskip \cftbeforefigskip
550  {\leftskip \cftfigindent\relax
551  \rightskip \@tocrmarg
552  \parfillskip -\rightskip
553  \parindent \cftfigindent\relax\@afterindenttrue
554  \interlinepenalty\@M
555  \leavevmode
556  \@tempdima \cftfignumwidth\relax
557  \let\@cftbsnum \cftfigpresnum
558  \let\@cftasnum \cftfigaftersnum
559  \let\@cftasnumb \cftfigaftersnumb
560  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
561  {\cftfigfont #1}\nobreak
562  \cftfigfillnum{#2}}
563 \fi

564 }

\cftbeforefigskip \cftfigindent \cftfignumwidth \cftfigfont \cftfigpresnum \cftfigaftersnum \cftfigaftersnumb \cftfigleader \cftfigdotsep \cftfigpagefont \cftfigafterpnum \cftfigfillnum These are the user commands to control the typesetting of Figure caption entries.

They are initialised to give the standard appearance.

565 \newlength{\cftbeforefigskip}
566 \setlength{\cftbeforefigskip}{\z@ \@plus.2\p@}
567 \newlength{\cftfigindent}
568 \setlength{\cftfigindent}{1.5em}
569 \newlength{\cftfignumwidth}
570 \setlength{\cftfignumwidth}{2.3em}
571 \newcommand{\cftfigfont}{\normalfont}
572 \newcommand{\cftfigpresnum}{}
573 \newcommand{\cftfigaftersnum}{}
574 \newcommand{\cftfigaftersnumb}{}
575 \newcommand{\cftfigleader}{\normalfont\cftdotfill{\cftfigdotsep}}
576 \newcommand{\cftfigdotsep}{\cftdotsep}
577 \newcommand{\cftfigpagefont}{\normalfont}
578 \newcommand{\cftfigafterpnum}{}
579 \newcommand{\cftfigfillnum}[1]{%
580 {\cftfigleader}\nobreak
581 \hb@xt@\@pnumwidth{\hfil\cftfigpagefont #1}\cftfigafterpnum\par}

582

lofdepth lotdepth The counters lofdepth and lotdepth are defined by the subfigure package. Define them here if that package is not used.

583 \if@cftsubfigopt\else
584 \newcounter{lofdepth}\setcounter{lofdepth}{1}
585 \newcounter{lotdepth}\setcounter{lotdepth}{1}
586 \fi

587

\@cftdobiblot If the tocbibind package has been used and it has redefined \listoftables we need to cater for that. The contents of the definition are defined in tocbibind.

588 \newcommand{\@cftdobiblot}{%
589 \if@dotoclot
590  \if@bibchapter
591  \phantomsection

592  \addcontentsline{toc}{chapter}{\listtablename}
593  \else
594  \phantomsection
595  \addcontentsline{toc}{\@tocextra}{\listtablename}
596  \fi
597 \fi}

598

\listoftables This is a parameterised version of the default \listoftables command. The changes are postponed until after all packages have been loaded. Each class has its own definition, but we have to cater for all classes in one definition, hence some of the checks. First, perform the default checks for multicolumns. (Do nothing if the titles option has been used).

599 \AtBeginDocument{
600 \if@cftnctoc\else
601 \renewcommand{\listoftables}{%
602 \@cfttocstart

Ensure that any previous paragraph has been finished. Within a group set the local paragraphing style. Typeset the title and then do the contents of the .lot file.

603 \par
604 \begingroup
605  \parindent\z@ \parskip\cftparskip
606  \@cftmakelottitle
607  \if@cfttocbibind
608  \@cftdobiblot
609  \fi
610  \@starttoc{lot}%
611 \endgroup

Finally, restore any multicolumn typesetting.

612 \@cfttocfinish}
613 \fi

614 }

615

\@cftmakelottitle This command typesets the title for the LoT.

616 \newcommand{\@cftmakelottitle}{%
617 \addpenalty\@secpenalty
618 \if@cfthaschapter
619  \vspace*{\cftbeforelottitleskip}
620 \else
621  \vspace{\cftbeforelottitleskip}
622 \fi
623 \@cftpagestyle
624 {\interlinepenalty\@M
625 {\cftlottitlefont\listtablename}{\cftafterlottitle}
626 \cftmarklot
627 \par\nobreak
628 \vskip \cftafterlottitleskip
629 \@afterheading}}

630

\cftbeforelottitleskip \cftafterlottitleskip These two lengths control the vertical spacing before and after the LoT title.

631 \newlength{\cftbeforelottitleskip}
632 \newlength{\cftafterlottitleskip}

Their values depend on whether the document has chapters or not. In chaptered documents the default LoT title is typeset as a \chapter*, otherwise as a

 \section*.
633 \if@cfthaschapter
634 \setlength{\cftbeforelottitleskip}{50pt}
635 \setlength{\cftafterlottitleskip}{40pt}
636 \else
637 \setlength{\cftbeforelottitleskip}{3.5ex \@plus 1ex \@minus .2ex}
638 \setlength{\cftafterlottitleskip}{2.3ex \@plus.2ex}
639 \fi
\cftlottitlefont \cftafterlottitle The LoT title is typeset in the style given by \cftlottitlefont. The macro

\cftafterlottitle is called after typesetting the title. This is initialised to do nothing. Both these macros can be redefined to do other things (e.g., adding an \hfill to \cftlottitlefont will make the title flushright).

640 \if@cfthaschapter
641 \newcommand{\cftlottitlefont}{\normalfont\Huge\bfseries}
642 \if@cftkoma\renewcommand{\cftlottitlefont}{\size@chapter\sectfont}\fi
643 \else
644 \newcommand{\cftlottitlefont}{\normalfont\Large\bfseries}
645 \if@cftkoma\renewcommand{\cftlottitlefont}{\size@section\sectfont}\fi
646 \fi
647 \newcommand{\cftafterlottitle}{}

648

\l@table \l@table{⟨title⟩}{⟨page⟩} typesets the LoT entry for a table caption heading. It is a parameterised copy of the default \l@table (see classes.dtx for the original definition).

649 \renewcommand*{\l@table}[2]{%
650 \ifnum\c@lotdepth >\z@
651  \vskip \cftbeforetabskip
652  {\leftskip \cfttabindent\relax
653  \rightskip \@tocrmarg
654  \parfillskip -\rightskip
655  \parindent \cfttabindent\relax\@afterindenttrue
656  \interlinepenalty\@M
657  \leavevmode
658  \@tempdima \cfttabnumwidth\relax
659  \let\@cftbsnum \cfttabpresnum
660  \let\@cftasnum \cfttabaftersnum
661  \let\@cftasnumb \cfttabaftersnumb
662  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
663  {\cfttabfont #1}\nobreak
664  \cfttabfillnum{#2}}
665 \fi

666 }

\cftbeforetabskip \cfttabindent \cfttabnumwidth \cfttabfont \cfttabpresnum \cfttabaftersnum \cfttabaftersnumb \cfttableader \cfttabdotsep \cfttabpagefont \cfttabafterpnum \cfttabfillnum These are the user commands to control the typesetting of Table caption entries.

They are initialised to give the standard appearance.

667 \newlength{\cftbeforetabskip}
668 \setlength{\cftbeforetabskip}{\z@ \@plus.2\p@}
669 \newlength{\cfttabindent}
670 \setlength{\cfttabindent}{1.5em}
671 \newlength{\cfttabnumwidth}
672 \setlength{\cfttabnumwidth}{2.3em}
673 \newcommand{\cfttabfont}{\normalfont}
674 \newcommand{\cfttabpresnum}{}
675 \newcommand{\cfttabaftersnum}{}
676 \newcommand{\cfttabaftersnumb}{}
677 \newcommand{\cfttableader}{\normalfont\cftdotfill{\cfttabdotsep}}
678 \newcommand{\cfttabdotsep}{\cftdotsep}
679 \newcommand{\cfttabpagefont}{\normalfont}
680 \newcommand{\cfttabafterpnum}{}
681 \newcommand{\cfttabfillnum}[1]{%
682 {\cfttableader}\nobreak
683 \hb@xt@\@pnumwidth{\hfil\cfttabpagefont #1}\cfttabafterpnum\par}

684

3.1 Support for the subfigure package

The code for supporting the subfigure package is, in all essentials, the same as that for the figure and table captions; only the names are changed. However, the code need only be executed if the subfigure package is actually loaded.

\@cftl@subfig This command redefines the \l@subfigure command.

685 \newcommand{\@cftl@subfig}{

\l@subfigure \l@subfigure{⟨title⟩}{⟨page⟩} typesets the LoF entry for a subfigure caption heading. It is essentially the same as the parameterised code for \l@figure except that account has to be taken of lofdepth.

686 \renewcommand*{\l@subfigure}[2]{%
687 \ifnum \c@lofdepth > \toclevel@subfigure
688  \vskip \cftbeforesubfigskip
689  {\leftskip \cftsubfigindent\relax
690  \rightskip \@tocrmarg
691  \parfillskip -\rightskip
692  \parindent \cftsubfigindent\relax\@afterindenttrue
693  \interlinepenalty\@M
694  \leavevmode
695  \@tempdima \cftsubfignumwidth\relax
696  \let\@cftbsnum \cftsubfigpresnum
697  \let\@cftasnum \cftsubfigaftersnum
698  \let\@cftasnumb \cftsubfigaftersnumb
699  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
700  {\cftsubfigfont ##1}\nobreak
701  \cftsubfigfillnum{##2}}
702 \fi

703 } 704 }

705

\@cftsetsubfig This command initialises the setup for subfigure captions in the LoF.

706 \newcommand{\@cftsetsubfig}{%

\cftbeforesubfigskip
\cftsubfigindent
\cftsubfignumwidth
\cftsubfigfont
\cftsubfigpresnum
\cftsubfigaftersnum
\cftsubfigaftersnumb
\cftsubfigleader
\cftsubfigdotsep
\cftsubfigpagefont
\cftsubfigafterpnum
\toclevel@subfig
\cftsubfigfillnum

707 \newlength{\cftbeforesubfigskip}
708 \setlength{\cftbeforesubfigskip}{\z@ \@plus.2\p@}
709 \newlength{\cftsubfigindent}
710 \setlength{\cftsubfigindent}{3.8em}
711 \newlength{\cftsubfignumwidth}
712 \setlength{\cftsubfignumwidth}{2.5em}
713 \newcommand{\cftsubfigfont}{\normalfont}
714 \newcommand{\cftsubfigpresnum}{}
715 \newcommand{\cftsubfigaftersnum}{}
716 \newcommand{\cftsubfigaftersnumb}{}
717 \newcommand{\cftsubfigleader}{\normalfont\cftdotfill{\cftsubtabdotsep}}
718 \newcommand{\cftsubfigdotsep}{\cftdotsep}
719 \newcommand{\cftsubfigpagefont}{\normalfont}
720 \newcommand{\cftsubfigafterpnum}{}
721 \providecommand{\toclevel@subfigure}{1}
722 \newcommand{\cftsubfigfillnum}[1]{%
723 {\cftsubfigleader}\nobreak
724 \hb@xt@\@pnumwidth{\hfil\cftsubfigpagefont ##1}\cftsubfigafterpnum\par}

This is the end of \@cftsetsubfig.

725 }

726

\@cftl@subtab This code redefines the code for \l@subtable.

727 \newcommand{\@cftl@subtab}{

\l@subtable \l@subtable{⟨title⟩}{⟨page⟩} typesets the LoT entry for a subtable caption heading. It is essentially the same as the parameterised code for \l@table except account has to be taken of lotdepth.

728 \renewcommand*{\l@subtable}[2]{%
729 \ifnum \c@lotdepth > \toclevel@subtable
730  \vskip \cftbeforesubtabskip
731  {\leftskip \cftsubtabindent\relax
732  \rightskip \@tocrmarg
733  \parfillskip -\rightskip
734  \parindent \cftsubtabindent\relax\@afterindenttrue
735  \interlinepenalty\@M
736  \leavevmode
737  \@tempdima \cftsubtabnumwidth\relax
738  \let\@cftbsnum \cftsubtabpresnum
739  \let\@cftasnum \cftsubtabaftersnum
740  \let\@cftasnumb \cftsubtabaftersnumb
741  \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
742  {\cftsubtabfont ##1}\nobreak
743  \cftsubtabfillnum{##2}}
744 \fi

745 } 746 }

\@cftsetsubtab This command sets up the defaults for subtable entries in the LoT.

747 \newcommand{\@cftsetsubtab}{

\cftbeforesubtabskip \cftsubtabindent \cftsubtabnumwidth \cftsubtabfont \cftsubtabpresnum \cftsubtabaftersnum \cftsubtabaftersnumb \cftsubtableader \cftsubtabdotsep \cftsubtabpagefont \cftsubtabafterpnum \toclevel@subtable \cftsubtabfillnum These are the user commands to control the typesetting of Subtable caption en-

tries. They are initialised to give the standard appearance.

748 \newlength{\cftbeforesubtabskip}
749 \setlength{\cftbeforesubtabskip}{\z@ \@plus.2\p@}
750 \newlength{\cftsubtabindent}
751 \setlength{\cftsubtabindent}{3.8em}
752 \newlength{\cftsubtabnumwidth}
753 \setlength{\cftsubtabnumwidth}{2.5em}
754 \newcommand{\cftsubtabfont}{\normalfont}
755 \newcommand{\cftsubtabpresnum}{}
756 \newcommand{\cftsubtabaftersnum}{}
757 \newcommand{\cftsubtabaftersnumb}{}
758 \newcommand{\cftsubtableader}{\normalfont\cftdotfill{\cftsubtabdotsep}}
759 \newcommand{\cftsubtabdotsep}{\cftdotsep}
760 \newcommand{\cftsubtabpagefont}{\normalfont}
761 \newcommand{\cftsubtabafterpnum}{}
762 \providecommand{\toclevel@subtable}{1}
763 \newcommand{\cftsubtabfillnum}[1]{%
764 {\cftsubtableader}\nobreak
765 \hb@xt@\@pnumwidth{\hfil\cftsubtabpagefont ##1}\cftsubtabafterpnum\par}

This is the end of \@cftsetsubtab.

766 }

767

Call the subfigure package setup code only if the subfigure option is specified. The \l@... redefinitions have to come after the subfigure package is loaded.

768

769 \if@cftsubfigopt
770 \@cftsetsubfig\@cftsetsubtab
771 \AtBeginDocument{\@cftl@subfig\@cftl@subtab}
772 \fi
773 %%  \AtBeginDocument{\if@cftsubfigopt
774 %%    \@cftsetsubfig\@cftsetsubtab
775 %%    \@cftl@subfig\@cftl@subtab
776 %%  \fi}

777

3.2 New list of…

\newlistentry \newlistentry[⟨within⟩]{⟨counter⟩}{⟨ext⟩}{⟨level-1 ⟩} creates a set of commands for a new kind of entry into a List of.

778 \newcommand{\newlistentry}[4][\@empty]{%

{\c@X \atop \theX} Check if ⟨within⟩ and ⟨counter⟩ have been defined. It is an error if ⟨within⟩ has not been defined, and an error if ⟨counter⟩ has been defined. Set the default counter values.

779 \@ifundefined{c@#2}{%    check & set the counter
780  \ifx \@empty#1\relax
781  \newcounter{#2}
782  \else
783  \@ifundefined{c@#1}{\PackageWarning{tocloft}%
784  {#1 has no counter for use as a `within'}

785  \newcounter{#2}}%
786  {\newcounter{#2}[#1]%
787  \expandafter\edef\csname the#2\endcsname{%
788  \expandafter\noexpand\csname the#1\endcsname.\noexpand\arabic{#2}}}
789  \fi
790  \setcounter{#2}{0}

791 }

792 {\PackageError{tocloft}{#2 has been previously defined}{\@eha}}

793

That finishes off the error checking. No matter what the result, the rest of the new commands are defined.

\l@X \l@X{⟨title⟩}{⟨page⟩} typesets the entry.

794 \@namedef{l@#2}##1##2{%

Only typeset if the \Zdepth is greater than ⟨level-1 ⟩.

795  \ifnum \@nameuse{c@#3depth} > #4\relax
796  \vskip \@nameuse{cftbefore#2skip}
797  {\leftskip \@nameuse{cft#2indent}\relax
798  \rightskip \@tocrmarg
799  \parfillskip -\rightskip
800  \parindent \@nameuse{cft#2indent}\relax\@afterindenttrue
801  \interlinepenalty\@M
802  \leavevmode
803  \@tempdima \@nameuse{cft#2numwidth}\relax
804  \expandafter\let\expandafter\@cftbsnum\csname cft#2presnum\endcsname
805  \expandafter\let\expandafter\@cftasnum\csname cft#2aftersnum\endcsname
806  \expandafter\let\expandafter\@cftasnumb\csname cft#2aftersnumb\endcsname
807  \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip
808  {\@nameuse{cft#2font}##1}\nobreak
809  \@nameuse{cft#2fillnum}{##2}}
810  \fi
811 }  % end of \l@#2

812

Now define all the layout commands used by \l@X. The default values of these correspond to those for section entries in non-chaptered documents.

\cftbeforeXskip
813 \expandafter\newlength\csname cftbefore#2skip\endcsname
814  \setlength{\@nameuse{cftbefore#2skip}}{\z@ \@plus .2\p@}
\cftXindent
\cftXnumwidth
815 \expandafter\newlength\csname cft#2indent\endcsname
816 \expandafter\newlength\csname cft#2numwidth\endcsname

Set the default values for the indent and numwidth depending on the entry’s level. A level of 1 corresponds to a figure entry.

817 \ifcase #4\relax  % 0
818  \setlength{\@nameuse{cft#2indent}}{0em}
819  \setlength{\@nameuse{cft#2numwidth}}{1.5em}
820 \or               % 1
821  \setlength{\@nameuse{cft#2indent}}{1.5em}
822  \setlength{\@nameuse{cft#2numwidth}}{2.3em}

823 \or               % 2
824  \setlength{\@nameuse{cft#2indent}}{3.8em}
825  \setlength{\@nameuse{cft#2numwidth}}{3.2em}
826 \or               % 3
827  \setlength{\@nameuse{cft#2indent}}{7.0em}
828  \setlength{\@nameuse{cft#2numwidth}}{4.1em}
829 \else             % anything else
830  \setlength{\@nameuse{cft#2indent}}{10.0em}
831  \setlength{\@nameuse{cft#2numwidth}}{5.0em}
832 \fi
\cftXfont \cftXpresnum \cftXaftersnum \cftXaftersnumb \cftXdotsep \cftXleader \cftXpagefont \cftXafterpnum And the remaining commands.
833 \@namedef{cft#2font}{\normalfont}
834 \@namedef{cft#2presnum}{}
835 \@namedef{cft#2aftersnum}{}
836 \@namedef{cft#2aftersnumb}{}
837 \@namedef{cft#2dotsep}{\cftdotsep}
838 \@namedef{cft#2leader}{\normalfont\cftdotfill{\@nameuse{cft#2dotsep}}}
839 \@namedef{cft#2pagefont}{\normalfont}
840 \@namedef{cft#2afterpnum}{}

\toclevel@X The hyperref package needs a command \toclevel@X, holding the ⟨level-1 ⟩ value.

841 \@namedef{toclevel@#2}{#4}

\cftXfillnum Typeset the leader and page number.

842 \@namedef{cft#2fillnum}##1{%
843  {\@nameuse{cft#2leader}}\nobreak
844  \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#2pagefont}##1}\@nameuse{cft#2afterpnum}\par}

This ends the definition of \newlistentry.

845 } % end \newlistentry

846

\newlistof \newlistof[⟨within⟩]{⟨counter⟩}{⟨ext⟩}{⟨listofname⟩} creates the commands for a new List of.

847 \newcommand{\newlistof}[4][\@empty]{%

Call \newlistentry to set up the first level entry.

848 \ifx \@empty#1\relax
849  \newlistentry{#2}{#3}{0}
850 \else
851  \newlistentry[#1]{#2}{#3}{0}
852 \fi

853

\ext@Z \Zdepth The file extension and listing depth.

854 \@namedef{ext@#3}{#3}
855 \newcounter{#3depth}
856 \setcounter{#3depth}{1}

857

\cftmarkZ The heading marks for the listing.

858 \if@cftkoma

859  \@namedef{cftmark#3}{%
860  \@mkboth{#4}{#4}}
861 \else
862  \@namedef{cftmark#3}{%
863  \@mkboth{\MakeUppercase{#4}}{\MakeUppercase{#4}}}
864 \fi

\listofX Typeset the listing title and entries.

865 \if@cftnctoc

For the titles option, basically copy the code from the standard \tableofcontents command.

866 \@namedef{listof#2}{%
867  \@cfttocstart
868  \if@cfthaschapter
869  \chapter*{#4}
870  \else
871  \section*{#4}
872  \fi
873  \@nameuse{cftmark#3}
874  \@starttoc{#3}%
875  \@cfttocfinish}
876 \else

Otherwise use the fully parameterised definition.

877 \@namedef{listof#2}{%
878  \@cfttocstart
879  \par
880  \begingroup
881  \parindent\z@ \parskip\cftparskip
882  \@nameuse{@cftmake#3title}
883  \@starttoc{#3}%
884  \endgroup
885  \@cfttocfinish}
886 \fi

887

\@cftmakeZtitle Typeset the title.

888 \@namedef{@cftmake#3title}{%
889  \addpenalty\@secpenalty
890  \if@cfthaschapter
891  \vspace*{\@nameuse{cftbefore#3titleskip}}
892  \else
893  \vspace{\@nameuse{cftbefore#3titleskip}}
894  \fi
895  \@cftpagestyle
896  {\interlinepenalty\@M
897  {\@nameuse{cft#3titlefont}#4}{\@nameuse{cftafter#3title}}
898  \@nameuse{cftmark#3}
899  \par\nobreak
900  \vskip \@nameuse{cftafter#3titleskip}
901  \@afterheading}}

902

\cftbeforeZtitleskip \cftafterZtitleskip \cftZtitlefont The skips before and after the title heading, and the title font. The default values depend on whether or not the document class has chapters.

903 \expandafter\newlength\csname cftbefore#3titleskip\endcsname
904 \expandafter\newlength\csname cftafter#3titleskip\endcsname
905 \if@cfthaschapter
906  \setlength{\@nameuse{cftbefore#3titleskip}}{50pt}
907  \setlength{\@nameuse{cftafter#3titleskip}}{40pt}
908  \if@cftkoma
909  \@namedef{cft#3titlefont}{\size@chapter\sectfont}
910  \else
911  \@namedef{cft#3titlefont}{\normalfont\Huge\bfseries}
912  \fi
913  \else
914  \setlength{\@nameuse{cftbefore#3titleskip}}{3.5ex \@plus 1ex \@minus .2ex}
915  \setlength{\@nameuse{cftafter#3titleskip}}{2.3ex \@plus .2ex}
916  \if@cftkoma
917  \@namedef{cft#3titlefont}{\size@section\sectfont}
918  \else
919  \@namedef{cft#3titlefont}{\normalfont\Huge\bfseries}
920  \fi
921  \fi

\cftafterZtitle Something to go after the title.

922  \@namedef{cftafter#3title}{}

This is the end of the definition of \newlistof.

923 } % end \newlistof

924

\cftsetindents \cftsetindents{⟨entry⟩}{⟨indent⟩}{⟨numwidth⟩} sets the indent and numwidth for entry ⟨entry⟩. The macro has to map between the external entry name and the internal shorthand.

925 \newcommand{\cftsetindents}[3]{%
926 \def\@cftemp{#1}
927 \ifx\@cftemp\cftchapname
928  \@cftsetindents{chap}{#2}{#3}
929 \else
930  \ifx\@cftemp\cftsecname \@cftsetindents{sec}{#2}{#3}
931  \else
932  \ifx\@cftemp\cftsubsecname \@cftsetindents{subsec}{#2}{#3}
933  \else
934  \ifx\@cftemp\cftsubsubsecname \@cftsetindents{subsubsec}{#2}{#3}
935  \else
936  \ifx\@cftemp\cftparaname \@cftsetindents{para}{#2}{#3}
937  \else
938  \ifx\@cftemp\cftsubparaname \@cftsetindents{subpara}{#2}{#3}
939  \else
940  \ifx\@cftemp\cftfigname \@cftsetindents{fig}{#2}{#3}
941  \else
942  \ifx\@cftemp\cftsubfigname \@cftsetindents{subfig}{#2}{#3}
943  \else
944  \ifx\@cftemp\cfttabname \@cftsetindents{tab}{#2}{#3}
945  \else

946  \ifx\@cftemp\cftsubtabname \@cftsetindents{subtab}{#2}{#3}
947  \else
948  \@cftsetindents{#1}{#2}{#3}
949  \fi
950  \fi
951  \fi
952  \fi
953  \fi
954  \fi
955  \fi
956  \fi
957  \fi
958 \fi

959 }

960

\@cftsetindents  \@cftsetindents{⟨X ⟩}{⟨indent⟩}{⟨numwidth⟩} is the internal version of \cftsetindents,

where in this case ⟨X ⟩ is the internal (shorthand) name of the entry.

961 \newcommand{\@cftsetindents}[3]{%
962 \setlength{\@nameuse{cft#1indent}}{#2}
963 \setlength{\@nameuse{cft#1numwidth}}{#3}

964 }

965

3.3 Switching page numbering

\@cftpnumoff \@cftpnumoff{⟨shorthand⟩} is the workhorse for switching page numbering off. The ⟨shorthand⟩ argument is the shorthand name of the entry (e.g. subsec for subsection). The macro redefines the \cftXnumfill command so that there is no leader and the page number is ignored.

966 \newcommand{\@cftpnumoff}[1]{%
967 \@namedef{cft#1fillnum}##1{%
968  \cftparfillskip\@nameuse{cft#1afterpnum}\par}}

969

\cftchapname \cftsecname \cftsubsecname \cftsubsubsecname \cftparaname \cftsubparaname \cftfigname \cftsubfigname \cfttabname \cftsubtabname Unfortunately an early design decision was the use shorthands like sec for

section. For the page switching I need to be able to correlate the shorthands and longhands.

970 \newcommand*{\cftchapname}{chapter}
971 \newcommand*{\cftsecname}{section}
972 \newcommand*{\cftsubsecname}{subsection}
973 \newcommand*{\cftsubsubsecname}{subsubsection}
974 \newcommand*{\cftparaname}{paragraph}
975 \newcommand*{\cftsubparaname}{subparagraph}
976 \newcommand*{\cftfigname}{figure}
977 \newcommand*{\cftsubfigname}{subfigure}
978 \newcommand*{\cfttabname}{table}
979 \newcommand*{\cftsubtabname}{subtable}

980

\cftpagenumbersoff The user level command for switching off page numbers is \cftpagenumbersoff{⟨entry⟩} where ⟨entry⟩ is the longhand name of the entry. The principal task opf this macro is to determine the corresponding shorthand name of the ⟨entry⟩ and then call \@cftpnumoff to do the work. For part and user-defined entries the long- and short-hand entry names are identical.

 981 \DeclareRobustCommand{\cftpagenumbersoff}[1]{%
 982 \def\@cftemp{#1}
 983 \ifx\@cftemp\cftchapname
 984  \@cftpnumoff{chap}
 985 \else
 986  \ifx\@cftemp\cftsecname \@cftpnumoff{sec}
 987  \else
 988  \ifx\@cftemp\cftsubsecname \@cftpnumoff{subsec}
 989  \else
 990  \ifx\@cftemp\cftsubsubsecname \@cftpnumoff{subsubsec}
 991  \else
 992  \ifx\@cftemp\cftparaname \@cftpnumoff{para}
 993  \else
 994  \ifx\@cftemp\cftsubparaname \@cftpnumoff{subpara}
 995  \else
 996  \ifx\@cftemp\cftfigname \@cftpnumoff{fig}
 997  \else
 998  \ifx\@cftemp\cftsubfigname \@cftpnumoff{subfig}
 999  \else
1000  \ifx\@cftemp\cfttabname \@cftpnumoff{tab}
1001  \else
1002  \ifx\@cftemp\cftsubtabname \@cftpnumoff{subtab}
1003  \else
1004  \@cftpnumoff{#1}

1005 \fi 1006 \fi 1007 \fi 1008 \fi 1009 \fi 1010 \fi 1011 \fi 1012 \fi 1013 \fi 1014 \fi 1015 }

1016

\cftpagenumberson \cftpagenumberson{⟨entry⟩} is the user level command for reversing the corre-

  sponding \cftpagenumbersoff.
1017 \DeclareRobustCommand{\cftpagenumberson}[1]{%
1018 \def\@cftemp{#1}
1019 \ifx\@cftemp\cftchapname
1020  \@cftpnumon{chap}
1021 \else
1022  \ifx\@cftemp\cftsecname \@cftpnumon{sec}
1023  \else
1024  \ifx\@cftemp\cftsubsecname \@cftpnumon{subsec}
1025  \else
1026  \ifx\@cftemp\cftsubsubsecname \@cftpnumon{subsubsec}
1027  \else
1028  \ifx\@cftemp\cftparaname \@cftpnumon{para}
1029  \else

1030  \ifx\@cftemp\cftsubparaname \@cftpnumon{subpara}
1031  \else
1032  \ifx\@cftemp\cftfigname \@cftpnumon{fig}
1033  \else
1034  \ifx\@cftemp\cftsubfigname \@cftpnumon{subfig}
1035  \else
1036  \ifx\@cftemp\cfttabname \@cftpnumon{tab}
1037  \else
1038  \ifx\@cftemp\cftsubtabname \@cftpnumon{subtab}
1039  \else
1040  \@cftpnumon{#1}

1041 \fi 1042 \fi 1043 \fi 1044 \fi 1045 \fi 1046 \fi 1047 \fi 1048 \fi 1049 \fi 1050 \fi 1051 }

1052

\@cftpnumon \@cftpnumon{⟨shorthand⟩} is the workhorse for switching page numbering off. The ⟨shorthand⟩ argument is the shorthand name of the entry (e.g. subsec for subsection). The macro defines the \cftXnumfill command to correspond to the default definition.

1053 \newcommand{\@cftpnumon}[1]{%
1054 \@namedef{cft#1fillnum}##1{%
1055  {\@nameuse{cft#1leader}}\nobreak
1056  \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#1pagefont}##1}\@nameuse{cft#1afterpnum}\par}}

1057

3.4 Experimental utilities

The code in this section is experimental but in the sense that the capabilities might be modified in the future rather than that the code does not work.

\cftchapterprecis This is experimental. \cftchapterprecis{⟨text⟩} typesets ⟨text⟩ at the point where it is called, and also adds ⟨text⟩ to the .toc file. It is expects to be called immediately after a \chapter command.

1058 \newcommand{\cftchapterprecis}[1]{%
1059 \cftchapterprecishere{#1}
1060 \cftchapterprecistoc{#1}}

\cftchapterprecishere \cftchapterprecishere{⟨text⟩} typesets ⟨text⟩. It expects to be called immediately after a \chapter command. First add some negative vertical space to move it closer to the chapter heading.

1061 \newcommand{\cftchapterprecishere}[1]{%
1062 \vspace*{-2\baselineskip}

Typeset its argument using italic font in a quote environment.

1063 \begin{quote}\textit{#1}\end{quote}}

\cftchapterprecistoc  \cftchapterprecistoc{⟨text⟩} adds ⟨text⟩ to the .toc file. The ⟨text⟩ will be

typeset within the same margins as the the title text of a \chapter heading, using an italic font.

1064 \newcommand{\cftchapterprecistoc}[1]{\addtocontents{toc}{%

Start a group to localize changes to the paragraphing. Set the left margin to the chapter indent plus the chapter number width.

1065 {\leftskip \cftchapindent\relax
1066 \advance\leftskip \cftchapnumwidth\relax

Set the right hand margin to \@tocrmarg.

1067 \rightskip \@tocrmarg\relax

Typeset ⟨text⟩ using an italic font, then ensure that the paragraph is finished (to use the local skips). Finally close the group and we are done.

1068 \textit{#1}\protect\par}}}

\cftlocalchange \cftmakelocalchange{⟨file⟩}{⟨pnumwidth⟩}{⟨tocrmarg⟩} makes an entry into ⟨file⟩ to change the \@pnumwidth and the \@tocrmarg values.

1069 \newcommand{\cftlocalchange}[3]{%
1070 \addtocontents{#1}{\protect\cftsetpnumwidth{#2} \protect\cftsetrmarg{#3}}}
\cftaddtitleline  \cftaddtitleline{⟨file⟩}{⟨kind⟩}{⟨title⟩}{⟨page⟩} adds a \contentsline entry

to ⟨file⟩ with the given information.

1071 \newcommand{\cftaddtitleline}[4]{%
1072 \addtocontents{#1}{\protect\contentsline{#2}{#3}{#4}}}
\cftaddnumtitleline  \cftaddtitleline{⟨file⟩}{⟨kind⟩}{⟨num⟩}{⟨title⟩}{⟨page⟩} adds a \contentsline

entry to ⟨file⟩ with the given information.

1073 \newcommand{\cftaddnumtitleline}[5]{%
1074 \addtocontents{#1}%
1075  {\protect\contentsline{#2}{\protect\numberline{#3}{\protect\ignorespaces #4}}{#5}}}

The end of this package.

1076 ⟨/usc⟩

References

[Coc95] Steven Douglas Cochran. The subfigure package. March 1995. (Available from CTAN as file subfigure.dtx)

[Dru99] Jean-Pierre Drucbert. The minitoc package. August 1999. (Available from CTAN in subdirectory /minitoc)

[GMS94] Michel Goossens, Frank Mittelbach, and Alexander Samarin. The LaTeX Companion. Addison-Wesley Publishing Company, 1994.

[Lin97] Ulf A. Lindgren. FncyChap V1.11. April 1997. (Available from CTAN in subdirectory /fncychap)

[Lin95] Anselm Lingnau. An Improved Environment for Floats. March 1995. (Available from CTAN in subdirectory /float)

[Wil96a] Peter Williams. Algorithms. April 1996. (Available from CTAN in subdirectory /algorithm)

[Wil96b] Peter R. Wilson. LaTeX for standards: The LaTeX package files user manual. NIST Report NISTIR, June 1996.

[Wil00] Peter R. Wilson. The tocbibind package. March 2000. (Available from

   CTAN as file tocbibind.dtx)

[Wil01] Peter R. Wilson. The ccaption package. March 2001. (Available from

   CTAN as file ccaption.dtx)

Index

Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

\@afterheading . . . .

. 127, 527, 629, 901

\@afterindenttrue .

…. 185, 241, 287, 332, 372, 412, 452, 553, 655, 692, 734, 800

\@cftasnum . 15, 154,

\underline{155}, 190, 246, 292, 337, 377, 417, 457, 558, 660, 697, 739, 805

\@cftasnumb . 15, 154,

\underline{155}, 191, 247, 293, 338, 378, 418, 458, 559, 661, 698, 740, 806

\@cftbsnum . 15, 154,

\underline{155}, 189, 245, 291, 336, 376, 416, 456, 557, 659, 696, 738, 804

\@cftdobiblof . \underline{486}, 506
\@cftdobiblot . \underline{588}, 608
\@cftdobibtoc . . \underline{84}, 107
\@cftdopartfalse . . 163
\@cftdoparttrue 166, 170

\@cftemp . . . . . 926, 927, 930, 932, 934, 936, 938, 940, 942, 944, 946, 982, 983, 986, 988, 990, 992, 994, 996, 998, 1000, 1002, 1018, 1019, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038

                   \@cfthaschapterfalse 23
                   \@cfthaschaptertrue 29
                   \@cfthaspartfalse . 160
                   \@cfthasparttrue . . 160
                   \@cftkomafalse . . . . 17
                   \@cftkomatrue . . . 18–20
                   \@cftl@subfig . . . . .

…. \underline{685}, 771, 775

                   \@cftl@subtab . . . . .

…. \underline{727}, 771, 775

                   \@cftmakeZtitle . . . \underline{888}
                   \@cftmakeloftitle .

. . . . . . . . 504, \underline{514}

                   \@cftmakelottitle .

. . . . . . . . 606, \underline{616}

                   \@cftmaketoctitle .

. . . . . . . . 105, \underline{114}

                   \@cftnctocfalse . . . 44
                   \@cftnctoctrue . . . . 45
                   \@cftpagestyle . \underline{52},

121, 521, 623, 895

                   \@cftpnumoff . . . . . .

. \underline{966}, 984, 986, 988, 990, 992, 994, 996, 998, 1000, 1002, 1004

                   \@cftpnumon . . . 1020,

1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038, 1040, \underline{1053}

\@cftquit … \underline{14}, 27, 31

                                             \@cftsetindents . . .

…. 928, 930, 932, 934, 936, 938, 940, 942, 944, 946, 948, \underline{961}

                                             \@cftsetsubfig . . . .

…. \underline{706}, 770, 774

                                             \@cftsetsubtab . . . .

…. \underline{747}, 770, 774

                                             \@cftsubfigoptfalse 47
                                             \@cftsubfigopttrue . 48
                                             \@cfttocbibindfalse 34
                                             \@cfttocbibindtrue . 34
                                             \@cfttocfinish . . . .

. . . . . \underline{70}, 111, 510, 612, 875, 885

                                             \@cfttocstart \underline{70}, 101,

500, 602, 867, 878 \@dotsep . . . . . . . . . . 2

                                             \@dottedtocline . . . . 3

\@eha . . . . . . . . . . . . 792

                                             \@highpenalty . 176, 236
                                             \@ifclassloaded . 18–20
                                             \@ifpackagelater . . 36
                                             \@ifpackageloaded . 34
                                             \@ifundefined . . . . .

22, 24, 160, 779, 783

                                             \@namedef . . . . . . . .

. 794, 833–842, 854, 859, 862, 866, 877, 888, 909, 911, 917, 919, 922, 967, 1054

\@nameuse . 795–797,

800, 803, 808, 809, 814, 818, 819, 821, 822, 824, 825, 827, 828, 830, 831, 838, 843, 844, 873, 882, 891, 893, 897, 898, 900, 906, 907, 914, 915, 962, 963, 968, 1055, 1056

\@nobreakfalse 198, 202
\@nobreaktrue . 197, 201
\@pnumwidth . . 2, 145,

225, 270, 324, 364, 404, 444, 484, 581, 683, 724, 765, 844, 1056

\@restonecolfalse . 75
\@restonecoltrue . . 73
\@secpenalty 115, 178,

281, 515, 617, 889 \@spaces . . . . . . . . . . 6

\@starttoc . . . 109,

508, 610, 874, 883

\@tocextra 91, 493, 595
\@tocrmarg . . 2, 146,

183, 239, 285, 330, 370, 410, 450, 551, 653, 690, 732, 798, 1067

A

\addcontentsline . .

…. 2, 88, 91, 490, 493, 592, 595

\addtocontents . . . .

. . . . . 3, 1064, 1070, 1072, 1074

\AtBeginDocument . .

. . . . . . 33, 98, 497, 599, 771, 773

B

\baselineskip . . . . 1062

C

\c@lofdepth . . . 548, 687
\c@lotdepth . . . 650, 729
\c@tocdepth . . . 164,

168, 235, 277, 327, 367, 407, 447 \c@X . . . . . . . . . . . . . \underline{779}

\cftaddnumtitleline

. . . . . . . . 14, \underline{1073}

\cftaddtitleline . .

. . . . . . . . 14, \underline{1071}

\cftafterloftitle .

. . . . . . . . 523, \underline{538}

\cftafterloftitleskip

. . . . . . . . 526, \underline{529}

\cftafterlottitle .

. . . . . . . . 625, \underline{640}

\cftafterlottitleskip

. . . . . . . . 628, \underline{631}

\cftaftertoctitle .

. . . . . . . . 123, \underline{137}

\cftaftertoctitleskip

. . . . . . . . 126, \underline{128}

\cftafterZtitle . 6, \underline{922}
\cftafterZtitleskip

. . . . . . . . . 6, \underline{903}

\cftbeforechapskip .

. . . . . . . . 237, \underline{253}

\cftbeforefigskip .

. . . . . . . . 549, \underline{565}

\cftbeforeloftitleskip

…. 517, 519, \underline{529}

\cftbeforelottitleskip

…. 619, 621, \underline{631}

\cftbeforeparaskip .

. . . . . . . . 408, \underline{423}

\cftbeforepartskip .

. . . . . . . . 180, \underline{208}

\cftbeforesecskip .

…. 279, 282, \underline{298}

\cftbeforesubfigskip

. . . . . . . . 688, \underline{707}

\cftbeforesubparaskip

. . . . . . . . 448, \underline{463}

\cftbeforesubsecskip

. . . . . . . . 328, \underline{343}

\cftbeforesubsubsecskip

. . . . . . . . 368, \underline{383}

\cftbeforesubtabskip

. . . . . . . . 730, \underline{748}

\cftbeforetabskip .

. . . . . . . . 651, \underline{667}

\cftbeforetoctitleskip

…. 117, 119, \underline{128}

\cftbeforeXskip . 8, \underline{813}
\cftbeforeZtitleskip

. . . . . . . . . 6, \underline{903}

\cftchapafterpnum . \underline{253}
\cftchapaftersnum .

. . . . . . . . 246, \underline{253}

\cftchapaftersnumb .

. . . . . . . . 247, \underline{253}

\cftchapdotsep . . . . \underline{253}
\cftchapfillnum 250, \underline{253}
\cftchapfont . . 249, \underline{253}
\cftchapindent . . . .

238, 241, \underline{253}, 1065

\cftchapleader . . . . \underline{253}
\cftchapname . . . . . .

927, \underline{970}, 983, 1019

\cftchapnumwidth . .

… 244, \underline{253}, 1066

\cftchappagefont . . \underline{253}
\cftchappresnum 245, \underline{253}
\cftchapterprecis .

. . . . . . . . 14, \underline{1058}

\cftchapterprecishere

… 14, 1059, \underline{1061}

\cftchapterprecistoc

… 14, 1060, \underline{1064} \cftdot . . . . . . . . 7, \underline{147}

\cftdotfill . . . \underline{147},

217, 264, 309, 317, 358, 398, 438, 478, 575, 677, 717, 758, 838

\cftdotsep . . 7, \underline{150},

310, 359, 399, 439, 479, 576, 678, 718, 759, 837

\cftfigafterpnum . . \underline{565}
\cftfigaftersnum . .

. . . . . . . . 558, \underline{565}

\cftfigaftersnumb .

. . . . . . . . 559, \underline{565}

\cftfigdotsep . . . . . \underline{565}
\cftfigfillnum 562, \underline{565}
\cftfigfont . . . 561, \underline{565}
\cftfigindent . . . . .

…. 550, 553, \underline{565}

\cftfigleader . . . . . \underline{565}
\cftfigname . . . . . . .

940, \underline{970}, 996, 1032

\cftfignumwidth 556, \underline{565}
\cftfigpagefont . . . \underline{565}
\cftfigpresnum 557, \underline{565}
\cftlocalchange 14, \underline{1069}
\cftloftitlefont . .

. . . . . . . . 523, \underline{538}

\cftlottitlefont . .

. . . . . . . . 625, \underline{640}

\cftmarklof . . . . \underline{56}, 524
\cftmarklot . . . . \underline{56}, 626
\cftmarktoc . . . . \underline{56}, 124

\cftmarkZ . . . . . . 6, \underline{858}

\cftnodots . . . . . 7,

\underline{150}, 218, 265, 318

\cftpagenumbersoff .

. . . . . . . . 10, \underline{981}

\cftpagenumberson .

. . . . . . . . 10, \underline{1017}

\cftparaafterpnum . \underline{423}
\cftparaaftersnum .

. . . . . . . . 417, \underline{423}

\cftparaaftersnumb .

. . . . . . . . 418, \underline{423}

\cftparadotsep . . . . \underline{423}
\cftparafillnum 421, \underline{423}
\cftparafont . . 420, \underline{423}
\cftparaindent . . . .

…. 409, 412, \underline{423}

\cftparaleader . . . . \underline{423}
\cftparaname . . . . . .

936, \underline{970}, 992, 1028

\cftparanumwidth . .

. . . . . . . . 415, \underline{423}

\cftparapagefont . . \underline{423}
\cftparapresnum 416, \underline{423}
\cftparfillskip  \underline{152}, 968
\cftparskip . . 7, \underline{95},

104, 503, 605, 881

\cftpartafterpnum . \underline{208}
\cftpartaftersnum .

. . . . . . . . 190, \underline{208}

\cftpartaftersnumb .

. . . . . . . . 191, \underline{208}

\cftpartdotsep . . . . \underline{208}
\cftpartfillnum 194, \underline{208}
\cftpartfont . . 193, \underline{208}
\cftpartindent . . . .

…. 182, 185, \underline{208}

\cftpartleader . . . . \underline{208}
\cftpartnumwidth . .

. . . . . . . . 188, \underline{208}

\cftpartpagefont . . \underline{208}
\cftpartpresnum . . .

…. 189, 193, \underline{208}

\cftsecafterpnum . . \underline{298}
\cftsecaftersnum . .

. . . . . . . . 292, \underline{298}

\cftsecaftersnumb .

. . . . . . . . 293, \underline{298}

\cftsecdotsep . . . . . \underline{298}
\cftsecfillnum 296, \underline{298}
\cftsecfont . . . 295, \underline{298}
\cftsecindent . . . . .

…. 284, 287, \underline{298}

\cftsecleader . . . . . \underline{298}

                          \cftsecname . . . . . . .

930, \underline{970}, 986, 1022

                          \cftsecnumwidth 290, \underline{298}
                          \cftsecpagefont . . . \underline{298}
                          \cftsecpresnum 291, \underline{298}
                          \cftsetindents . . 8, \underline{925}
                          \cftsetpnumwidth . .

. . . . . 7, \underline{145}, 1070

                          \cftsetrmarg 7, \underline{145}, 1070
                          \cftsubfigafterpnum  \underline{707}
                          \cftsubfigaftersnum

. . . . . . . . 697, \underline{707}

                          \cftsubfigaftersnumb

. . . . . . . . 698, \underline{707}

                          \cftsubfigdotsep . . \underline{707}
                          \cftsubfigfillnum .

. . . . . . . . 701, \underline{707}

                          \cftsubfigfont 700, \underline{707}
                          \cftsubfigindent . .

…. 689, 692, \underline{707}

                          \cftsubfigleader . . \underline{707}
                          \cftsubfigname . . . .

942, \underline{970}, 998, 1034

                          \cftsubfignumwidth .

. . . . . . . . 695, \underline{707}

                          \cftsubfigpagefont . \underline{707}
                          \cftsubfigpresnum .

. . . . . . . . 696, \underline{707}

                          \cftsubparaafterpnum

. . . . . . . . . . . \underline{463}

                          \cftsubparaaftersnum

. . . . . . . . 457, \underline{463}

                          \cftsubparaaftersnumb

. . . . . . . . 458, \underline{463}

                          \cftsubparadotsep . \underline{463}
                          \cftsubparafillnum .

. . . . . . . . 461, \underline{463}

                          \cftsubparafont 460, \underline{463}
                          \cftsubparaindent .

…. 449, 452, \underline{463}

                          \cftsubparaleader . \underline{463}
                          \cftsubparaname . . .

938, \underline{970}, 994, 1030

                          \cftsubparanumwidth

. . . . . . . . 455, \underline{463}

                          \cftsubparapagefont  \underline{463}
                          \cftsubparapresnum .

. . . . . . . . 456, \underline{463}

                          \cftsubsecafterpnum

. . . . . . . . \underline{343}, 364

                          \cftsubsecaftersnum

. . . . . . . . 337, \underline{343}

                          \cftsubsecaftersnumb

. . . . . . . . 338, \underline{343}

                                                   \cftsubsecdotsep . . \underline{343}
                                                   \cftsubsecfillnum .

. . . . . . . . 341, \underline{362}

                                                   \cftsubsecfont 340, \underline{343}
                                                   \cftsubsecindent . .

…. 329, 332, \underline{343}

                                                   \cftsubsecleader . .

. . . . . . . . \underline{343}, 363

                                                   \cftsubsecname . . . .

932, \underline{970}, 988, 1024

                                                   \cftsubsecnumwidth .

. . . . . . . . 335, \underline{343}

                                                   \cftsubsecpagefont .

. . . . . . . . \underline{343}, 364

                                                   \cftsubsecpresnum .

. . . . . . . . 336, \underline{343}

                                                   \cftsubsubsecafterpnum

. . . . . . . . . . . \underline{383}

                                                   \cftsubsubsecaftersnum

. . . . . . . . 377, \underline{383}

                                                   \cftsubsubsecaftersnumb

. . . . . . . . 378, \underline{383}

                                                   \cftsubsubsecdotsep  \underline{383}
                                                   \cftsubsubsecfillnum

. . . . . . . . 381, \underline{383}

                                                   \cftsubsubsecfont .

. . . . . . . . 380, \underline{383}

                                                   \cftsubsubsecindent

…. 369, 372, \underline{383}

                                                   \cftsubsubsecleader  \underline{383}
                                                   \cftsubsubsecname .

934, \underline{970}, 990, 1026

                                                   \cftsubsubsecnumwidth

. . . . . . . . 375, \underline{383}

                                                   \cftsubsubsecpagefont

. . . . . . . . . . . \underline{383}

                                                   \cftsubsubsecpresnum

. . . . . . . . 376, \underline{383}

                                                   \cftsubtabafterpnum  \underline{748}
                                                   \cftsubtabaftersnum

. . . . . . . . 739, \underline{748}

                                                   \cftsubtabaftersnumb

. . . . . . . . 740, \underline{748}

                                                   \cftsubtabdotsep . .

. . . . . . . . 717, \underline{748}

                                                   \cftsubtabfillnum .

. . . . . . . . 743, \underline{748}

                                                   \cftsubtabfont 742, \underline{748}
                                                   \cftsubtabindent . .

…. 731, 734, \underline{748}

                                                   \cftsubtableader . . \underline{748}
                                                   \cftsubtabname . . . .

946, \underline{970}, 1002, 1038

\cftsubtabnumwidth .

. . . . . . . . 737, \underline{748}

\cftsubtabpagefont . \underline{748}
\cftsubtabpresnum .

. . . . . . . . 738, \underline{748}

\cfttabafterpnum . . \underline{667}
\cfttabaftersnum . .

. . . . . . . . 660, \underline{667}

\cfttabaftersnumb .

. . . . . . . . 661, \underline{667}

\cfttabdotsep . . . . . \underline{667}
\cfttabfillnum 664, \underline{667}
\cfttabfont . . . 663, \underline{667}
\cfttabindent . . . . .

…. 652, 655, \underline{667}

\cfttableader . . . . . \underline{667}
\cfttabname . . . . . . .

944, \underline{970}, 1000, 1036

\cfttabnumwidth 658, \underline{667}
\cfttabpagefont . . . \underline{667}
\cfttabpresnum 659, \underline{667}
\cfttoctitlefont . .

. . . . . . . . 123, \underline{137}

\cftXafterpnum . . 8, \underline{833}
\cftXaftersnum . . 8, \underline{833}
\cftXaftersnumb . 8, \underline{833}
\cftXdotsep . . . . . 8, \underline{833}
\cftXfillnum . . . . . . \underline{842}

\cftXfont . . . . . . 8, \underline{833}

\cftXindent . . . . . 8, \underline{815}
\cftXleader . . . . . 8, \underline{833}
\cftXnumwidth . . . 8, \underline{815}
\cftXpagefont . . . 8, \underline{833}
\cftXpresnum . . . . 8, \underline{833}
\cftZtitlefont . . 6, \underline{903}

\chapter . . . . . . . . . 869

\contentsline . . . . .

…. 2, 1072, 1075

\contentsname . . . . .

57, 64, 88, 91, 123

\csname … 787, 788, 804–806, 813, 815, 816, 903, 904

D

\DeclareRobustCommand

. . . . . . . 981, 1017

E

\edef . . . . . . . . . . . . 787

\endcsname 787, 788,

804–806, 813, 815, 816, 903, 904

\endinput . . . . . . . . 27 \ext@Z . . . . . . . . . . . \underline{854}

G

                          \GenericWarning . . . . 5

H \hb@xt@ . . . . . . 154,

225, 270, 324, 364, 404, 444, 484, 581, 683, 724, 765, 844, 1056

\Huge . . . . . . . . 138, 539, 641, 911, 919

I

                          \if@bibchapter . . . .

. . . . . 86, 488, 590

                          \if@cftdopart . . . . . \underline{158}

                          \if@cfthaschapter \underline{14},

71, 79, 116, 130, 137, 165, 169, 175, 196, 233, 253, 278, 304, 347, 387, 427, 467, 516, 531, 538, 618, 633, 640, 868, 890, 905

                          \if@cfthaspart . . . .

…. 159, 161, 208

                          \if@cftkoma . . . . . . .

… \underline{16}, 62, 139, 142, 226, 271, 540, 543, 642, 645, 858, 908, 916

                          \if@cftnctoc . . . . . .

\underline{44}, 99, 498, 600, 865

                          \if@cftsubfigopt . .

. \underline{47}, 583, 769, 773

                          \if@cfttocbibind . .

. \underline{32}, 106, 505, 607

                          \if@compatibility . 200
                          \if@dotoclof . . . . . . 487
                          \if@dotoclot . . . . . . 589
                          \if@dotoctoc . . . . . . 85
                          \if@restonecol . . . . 80
                          \if@twocolumn . . . . . 72
                          \ignorespaces . . . . 1075
                          \interlinepenalty .

. 122, 186, 242, 288, 333, 373, 413, 453, 522, 554, 624, 656, 693, 735, 801, 896

L \l@ . . . . . . . . . . . . . 811

                                                   \l@chapter . . . . . . . \underline{233}

\l@figure . . . . . . . . \underline{547}

                                                   \l@paragraph . . . . . . \underline{406}

\l@part . . . . . . . . . . \underline{158}

                                                   \l@section . . . . . . . \underline{276}
                                                   \l@subfigure . . . . . . \underline{686}
                                                   \l@subparagraph . . . \underline{446}
                                                   \l@subsection . . . . . \underline{326}
                                                   \l@subsubsection . . \underline{366}
                                                   \l@subtable . . . . . . . \underline{728}

\l@table . . . . . . . . . \underline{649} \l@X . . . . . . . . . . 12, \underline{794} \Large …. 141, 542, 644 \large . . . . . . . 213,

217, 219, 228, 229 \leaders . . . . . . . . . 149

                                                   \leftskip . . . . 182,

192, 238, 248, 284, 294, 329, 339, 369, 379, 409, 419, 449, 459, 550, 560, 652, 662, 689, 699, 731, 741, 797, 807, 1065, 1066

                                                   \listfigurename . . .

59, 66, 490, 493, 523

                                                   \listoffigures . . 5, \underline{497}
                                                   \listoftables . . . 5, \underline{599}

\listofX . . . . . . 12, \underline{865}

                                                   \listtablename . . . .

61, 68, 592, 595, 625 \lofdepth . . . . . . . . \underline{583} \lotdepth . . . . . . . . \underline{583}

M

                                                   \MakeUppercase . . . .

… 57, 59, 61, 863

                                                   \MessageBreak . . . 38–40

\mkern . . . . . . . . . . . 149

N \newif . . . . . . 15, 16,

32, 44, 47, 158, 159

                                                   \newlistentry . . . . .

. 12, \underline{778}, 849, 851

                                                   \newlistof . . . . 11, \underline{847}

\noexpand . . . . . . . . 788

                                                   \normalfont . . . 138,

141, 308, 309, 311, 354, 358, 360, 394, 398, 400, 434, 438, 440, 474, 478, 480, 539, 542, 571, 575, 577, 641, 644, 673, 677, 679, 713, 717, 719, 754, 758, 760, 833, 838, 839, 911, 919

\numberline . . . . . 3, \underline{153}

O

\onecolumn . . . . . . . 73

P

\PackageError . . . . . 792
\PackageWarning . . .

. . . . . . 25, 37, 783

\parindent . . . . . . .

. 104, 185, 241, 287, 332, 372, 412, 452, 503, 553, 605, 655, 692, 734, 800, 881

\parskip . . . . . . . . .

. 104, 503, 605, 881

\phantomsection . . .

… \underline{82}, 87, 90, 489, 492, 591, 594

\providecommand 4, 11,

70, 78, 82, 147, 148, 150, 721, 762

\ProvidesPackage . . . 3
\PRWPackageNote . . . . \underline{4}
\PRWPackageNoteNoLine

. . . . . . . \underline{4}, 28, 30

S

\sectfont . . . . 139,

142, 228, 229, 272, 540, 543, 642, 645, 909, 917

\section . . . . . . . . . 871

\size@chapter . . . . .

. 139, 540, 642, 909

\size@section . . . . .

. 142, 543, 645, 917

T

\tableofcontents . 5, \underline{98}

\textit …. 1063, 1068 \theX . . . . . . . . . 12, \underline{779}

\thispagestyle . . . . 53
\toclevel@subfig . . \underline{707}
\toclevel@subfigure

. . . . . . . . 687, 721

\toclevel@subtable .

. . . . . . . . 729, \underline{748}

\toclevel@X . . . . . . . \underline{841}
\tocloftpagestyle 5, \underline{52}
\twocolumn . . . . . . . 80

Z

\Zdepth . . . . . . . 12, \underline{854}