<< . . . 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
A A

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
A

the list of tables (.lot), which contain the text speci¬ed as the argument of the \caption
command for ¬gures and tables.
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-
A

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.

V.1.1.

LTEX offers two commands to insert such information directly into a contents ¬le:
A

The extension of the contents ¬le, usually toc, lof or lot.
¬le
The type of the entry. For the toc ¬le the type is normally the same as
type
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-
A
text
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-

39
40 TABLE INDEX GLOSSARY
V. OF CONTENTS, AND

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:

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
A

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:

\chapter*{Forward}

where the chapter number would go free. Omitting the \numberline command would
typeset the word “Forward” ¬‚ush left instead.

Typesetting a contents list
V.1.2.

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:
\contentsline{type}{text}{page}

Type of the entry, e.g. section, or figure.
type
Actual text as speci¬ed in the argument of the sectioning or \caption
text
commands.
Pagenumber.
page
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

\contentsline {section}

A

following command:
\@dottedtocline{level}{indent}{numwidth}{text}{page}

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
level
how many nesting levels will be displayed. Levels greater than the value
This is total indentation from the left margin.
indent
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.
41
INDEX
V.2.

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
\@tocmarg
line entries. Dimension, but changed with \renewcommand.
The separation between dots, in mu (math units). It is a pure number
\@dotsep
(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
V.1.3.

The minitoc package, initially written by Nigel Ward and Dan Jurafsky and completely
beginning of each chapter when you use the book or report classes.
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
\dominitoc
the minitoc system (Mandatory).
This command replaces \tableofcontents when you want
\faketableofcontents
This command must be put right after each \chapter com-
\minitoc
mand where a minitoc is desired.
A LTEX counter that indicates how many levels of head-
A
\minitocdepth
ings will be displayed in the minitoc (default value is 2).
The length of the left/right indentation of the minitoc (de-
\mtcindent
fault value is 24pt).
Command de¬ning the font that is used for the minitoc
\mtcfont
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
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
ignored.

INDEX
V.2.

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.
42 TABLE INDEX GLOSSARY
V. OF CONTENTS, AND

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

animal, vi 5“7
\begin{theindex}
\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
\indexspace
\item mammal, \textbf{17}
\end{theindex}

(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
A

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}
command.
4. LTEX ¬le. Then a raw index (file.idx) will be generated.
A

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
A

in a new page.

Simple index entries
V.2.1.

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

\index{index entry}
43
INDEX
V.2.

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
V.2.2.

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
A

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

Page ranges and cross-references
V.2.3.

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
V.2.4.

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.
44 TABLE INDEX GLOSSARY
V. OF CONTENTS, AND

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}
environment}
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}
¨
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
\xxx{n-m}
\newcommand{\nn}[1]{#1n}

Printing those special characters
V.2.5.

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.

GLOSSARY
V.3.

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
A

in the preamble and
\makeglossary
in the text part
\glossary{glossary-entry}
45
GLOSSARY
V.3.

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
\glossaryentry\textit{glossary-entry}{pagenumber}

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) . . >>