<< . .

. 6
( : 23)

. . >>

headings as given in the standard form of the sectioning commands, together with the
page numbers on which they begin. Similar lists exist containing reference information
about the ¬‚oating elements in a document, namely, the list of tables and list of ¬gures.
The structure of these lists is simpler, since their contents, the captions of the ¬‚oating
elements, all are on the same level.
Standard LTEX can automatically create these three contents lists. By default, LTEX

enters text generated by one of the arguments of the sectioning commands into the .toc
¬le. Similarly, LTEX maintains two more ¬les, one for the list of ¬gures (.lof) and one for

the list of tables (.lot), which contain the text speci¬ed as the argument of the \caption
command for ¬gures and tables.
\tableofcontents produces a table of contents. \listoffigures and \listoftables
produce a list of ¬gures and list of tables respectively. These lists are printed at the
point where these commands are issued. Occasionally, you may ¬nd that you do not
like the way LTEX prints a table of contents or a list of ¬gures or tables. You can ¬ne-

tune an individual entry by using the optional arguments to the sectioning command or
\caption command that generates it. Formatting commands can also be introduced with
the \addtocontents. If all else fails, you can edit the .toc, lof, lot ¬les yourself. Edit
these ¬les only when preparing the ¬nal version of your document, and use a \nofiles
command to suppress the writing of new versions of the ¬les.

Additional entries

The *-form sectioning commands are not entered automatically in the table of contents.
LTEX offers two commands to insert such information directly into a contents ¬le:

\addtocontents{¬le}{text} \addcontentsline{¬le}{type}{text}

The extension of the contents ¬le, usually toc, lof or lot.
The type of the entry. For the toc ¬le the type is normally the same as
the heading according to the format of which an entry must be typeset.
For the lof or lot ¬les, figure or table is speci¬ed.
The actual information to be written to the ¬le mentioned. LTEX com-
mands should be protected by \protect to delay expansion
The \addtocontents command does not contain a type parameter and is intended to
enter user-speci¬c formatting information. For example, if you want to generate addi-
tional spacing in the middle of a table of contents, the following command can be issued:



The \addcontentsline instruction is usually invoked automatically by the document
sectioning commands, or by the \caption commands. If the entry contains numbered
text, then \numberline must be used to separate the section number (number) from the
rest of the text for the entry (heading) in the text parameter:

For example, a \caption command inside a figure environment saves the text an-
notating the ¬gure as follows:
\addcontentsline{lof}{¬gure}{\protect\numberline{\thefigure}captioned text}

Sometimes \addcontentsline is used in the source to complement the actions of
standard LTEX. For instance, in the case of the starred form of the section commands, no

information is written to the .toc ¬le. So if you do not want a heading number (starred
form) but an entry in the .toc ¬le you can write something like:


This produces an indented “chapter” entry in the table of contents, leaving the space
where the chapter number would go free. Omitting the \numberline command would
typeset the word “Forward” ¬‚ush left instead.

Typesetting a contents list

As discussed above, contents lists consist of entries of different types, corresponding to
the structural units that they represent. Apart from these standard entries, these lists may
contain any commands. A standard entry is speci¬ed by the command:

Type of the entry, e.g. section, or figure.
Actual text as speci¬ed in the argument of the sectioning or \caption
Note that section numbers are entered as a parameter of the \numberline command
to allow formatting with the proper indentation. It is also possible for the user to create
a table of contents by hand with the help of the command \contentsline. For example:

\contentsline {section}
{\numberline {2.4}Structure of the Table of Contents}{31}

To format an entry in the table of contents ¬les, standard LTEX makes use of the

following command:

The last two parameters coincide with those of \contentsline, since the latter usu-
ally invokes \@dottedtocline command. The other parameters are the following:
The nesting level of an entry. This parameter allows the user to control
how many nesting levels will be displayed. Levels greater than the value
of counter tocdepth will not appear in the table of contents.
This is total indentation from the left margin.
numwidth The width of the box that contains the number if text has a \numberline
command. This is also the amount of extra indentation added to the
second and later lines of a multiple line entry.

Additionally, the command \@dottedtocline uses the following formatting parame-
ters, which specify the visual appearance of all entries:
\@pnumwidth The width of the box in which the page number is set.
The indentation of the right margin for all but the last line of multiple
line entries. Dimension, but changed with \renewcommand.
The separation between dots, in mu (math units). It is a pure number
(like 1.7 or 2). By making this number large enough you can get rid of
the dots altogether. Changed with \renewcommand as well.

Multiple tables of contents

The minitoc package, initially written by Nigel Ward and Dan Jurafsky and completely
redesigned by Jean-Pierre Drucbert, creates a mini-table of contents (a “minitoc”) at the
beginning of each chapter when you use the book or report classes.
The mini-table of contents will appear at the beginning of a chapter, after the \chapter
command. The parameters that govern the use of this package are discussed below:

Table V.1: Summary of the minitoc parameters

Must be put just in front of \tableofcontents, to initialize
the minitoc system (Mandatory).
This command replaces \tableofcontents when you want
minitocs but not table of contents.
This command must be put right after each \chapter com-
mand where a minitoc is desired.
A LTEX counter that indicates how many levels of head-
ings will be displayed in the minitoc (default value is 2).
The length of the left/right indentation of the minitoc (de-
fault value is 24pt).
Command de¬ning the font that is used for the minitoc
entries (The default de¬nition is a small roman font).

For each mini-table, an auxiliary ¬le with extension .mtc<N> where <N> is the chap-
ter number, will be created.
By default, these mini-tables contain only references to sections and subsections. The
minitocdepth counter, similar to tocdepth, allows the user to modify this behaviour.
As the minitoc takes up room on the ¬rst page(s) of a chapter, it will alter the page
numbering. Therefore, three runs normally are needed to get correct information in the
mini-table of contents.
To turn off the \minitoc commands, merely replace the package minitoc with mini-
tocoff on your \usepackage command. This assures that all \minitoc commands will be


To ¬nd a topic of interest in a large document, book, or reference work, you usually
turn to the table of contents or, more often, to the index. Therefore, an index is a very
important part of a document, and most users™ entry point to a source of information
is precisely through a pointer in the index. The most generally used index preparation
program is MakeIndex.

Page vi: \index{animal}
Page 5: \index{animal}
Page 6: \index{animal} \indexentry{animal}{6}
Page 7: \index{animal} \indexentry{animal}{7}
Page 11: \index{animalism|see{animal}}
Page 17: \index{animal@\emph{animal}}
Page 26: \index{animal!mammal!cat}
Page 32: \index{animal!insect}
(a) The input ¬le (b) The .idx ¬le

animal, vi 5“7
\item animal, vi, 5“7 insect, 32
\subitem insect, 32 mammal
\subitem mammal cat, 26
\subsubitem cat, 26 animal, 17
animalism, see animal
\item \emph{animal}, 17
\item animalism, \see{animal}{11}
mammal, 17
\item mammal, \textbf{17}

(c) The .ind ¬le (d) The typeset output

Figure V.1: Stepwise development of index processing

Each \index command causes LTEX to write an entry in the .idx ¬le. This command

writes the text given as an argument, in the .idx ¬le. This .idx will be generated only if
we give \makeindex command in the preamble otherwise it will produce nothing.
\index{index entry}

To generate index follow the procedure given below:
1. Tag the words inside the document, which needs to come as index, as an argument of
\index command.
2. Include the makeidx package with an \usepackage command and put \makeindex com-
mand at the preamble.
3. Put a \printindex command where the index is to appear, normally before \end{document}
4. LTEX ¬le. Then a raw index (file.idx) will be generated.

5. Then run makeindex. (makeindex ¬le.idx or makeindex ¬le). Then two more ¬les will
be generated, ¬le.ind which contains the index entries and ¬le.ilg, a transcript ¬le.
6. Then run LTEX again. Now you can see in the dvi that the index has been generated

in a new page.

Simple index entries

Each \index command causes LTEX to write an entry in the .idx ¬le. For example

\index{index entry}

fonts Page ii: \index{table|(}
Computer Modern, 13“25 Page xi: \index{table|)}
math, see math, fonts Page 5: \index{fonts!PostScript|(}
PostScript, 5 \index{fonts!PostScript|)}
table, ii“xi, 14 Page 13 \index{fonts!Computer Modern |(}
Page 14: \index{table}
Page 17: \index{fonts!math|see{math, fonts}}
Page 21: \index{fonts!Computer Modern}
Page 25: \index{fonts!Computer Modern|)}

Figure V.2: Page range and cross-referencing

Sub entries

Up to three levels of index entries (main, sub, and subsub entries) are available with
LTEX-MakeIndex. To produce such entries, the argument of the \index command should

contain both the main and subentries, separated by ! character.
Page 5: \index{dimensions!rule!width}
This will come out as
width, 5

Page ranges and cross-references

You can specify a page range by putting the command \index{...|(} at the beginning of
the range and \index{...|)} at the end of the range. Page ranges should span a homoge-
neous numbering scheme (e.g., Roman and Arabic page numbers cannot fall within the
same range).
You can also generate cross-reference index entries without page numbers by using
the see encapsulator. Since “see” entry does not print any page number, the commands
\index{...|see{...}} can be placed anywhere in the input ¬le after the \begin{document}
command. For practical reasons, it is convenient to group all such cross-referencing
commands in one place.

Controlling the presentation form

Sometimes you may want to sort an entry according to a key, while using a different
visual representation for the typesetting, such as Greek letters, mathematical symbols, or
speci¬c typographic forms. This function is available with the syntax: key@visual, where
key determines the alphabetical position and the string value produces the typeset text of
the entry.
For some indexes certain page numbers should be formatted specially, with an italic
page number (for example) indicating a primary reference, and an n after a page number
denoting that the item appears in a footnote on that page. MakeIndex allows you to
format an individual page number in any way you want by using the encapsulator syntax
speci¬ed | character. What follows the | sign will “encapsulate” or enclose the page num-
ber associated with the index entry. For instance, the command \index{keyword|xxx}
will produce a page number of the form \xxx{n}, where n is the page number in question.

delta, 14 Page ii: \index{tabular|textbf}
δ, 23 Page 5: \index{ninety-¬ve}
delta wing, 16 Page 7: \index{tabbing}
Page 14:
¬‚ower, 19 \index{delta}
ninety, 26 Page 16: \index{delta wing}
xc, 28 Page 19: \index{¬‚ower@\textbf{¬‚ower}}
ninety-¬ve, 5 Page 21: \index{tabular|textit}
tabbing, 7, 34“37 Page 22: \index{tabular|nn}
tabular, ii, 21, 22n Page 23: \index{delta@δ}
tabular environment, 23 \index{tabular@\texttt{tabular}
Page 26: \index{ninety}
Page 28: \index{ninety@xc}
Page 34: \index{tabbing|(textit}
Page 36: \index{tabbing|)}

Figure V.3: Controlling the presentation form

@ sign, 2 \index{bar@\texttt{"|}|see{vertical bar}}
|, see vertical bar Page 1: \index{quote (\verb+""+)}
exclamation (!), 4 \index{quote@\texttt{""} sign}
Ah!, 5 Page 2: \index{atsign@\texttt{"@} sign}
Madchen, 3 Page 3: \index{maedchen@M\"{a}dchen}
quote ("), 1 Page 4: \index{exclamation ("!)}
" sign, 1 Page 5: \index{exclamation ("!)!Ah"!}

Figure V.4: Printing those special characters

Similarly, the command \index{keyword|(xxx)} will generate a page range of the form

Printing those special characters

To typeset one of the characters having a special meaning to MakeIndex (!, ", @, or |)
in the index, precede it with a " character. More precisely, any character is said to be
quoted if it follows an unquoted " that is not part of a \" command. The latter case is for
allowing umlaut characters. Quoted !, @, ", or | characters are treated like ordinary
characters, losing their special meaning. The " preceding a quoted character is deleted
before the entries are alphabetised.


A ˜glossary™ is a special index of terms and phrases alphabetically ordered together with
their explanations. To help set up a glossary, LTEX offers the commands

in the preamble and
in the text part

which function just like the commands for making up an index register. The entries are
written to a ¬le with extension .glo after the command \makeglossary has been given in
the preamble. The form of these ¬le entries from each \glossary command is

The information in the .glo ¬le can be used to establish a glossary. However, there is no
equivalent to the theindex environment for a glossary, but a recommended structure is

<< . .

. 6
( : 23)

. . >>