Previous: Glossaries, Up: Front/back matter


23.3 Indexes

The command \makeindex enables creating indexes. Put this in the preamble.

The command \index{text} writes an index entry for text to an auxiliary file with the .idx extension.

Specifically, what gets written is the command \indexentry{text}{pageno}, where pageno is the current \thepage value.

To generate a index entry for `bar' that says `See foo', use a vertical bar: \index{bar|see{foo}}. Use seealso instead of see to make a `See also' entry.

The text `See' is defined by the macro \seename, and `See also' by the macro \alsoname. These can be redefined for other languages.

The generated .idx file is then sorted with an external command, usually either makeindex (http://mirror.ctan.org/indexing/makeindex) or (the multi-lingual) xindy (http://xindy.sourceforge.net). This results in a .ind file, which can then be read to typeset the index.

The index is usually generated with the \printindex command. This is defined in the makeidx package, so \usepackage{makeidx} needs to be in the preamble.

The rubber length \indexspace is inserted before each new letter in the printed index; its default value is ‘10pt plus5pt minus3pt’.

The showidx package causes each index entries to be shown in the margin on the page where the entry appears. This can help in preparing the index.

The multind package supports multiple indexes. See also the TeX FAQ entry on this topic, http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multind.