### Multiple indexes

LaTeX's standard indexing capabilities (those provided by the makeidx package) only provide for one index in your document; even quite modest documents can be improved by indexes for separate topics.

The multind package provides simple and straightforward multiple indexing. You tag each `\makeindex`, `\index` and `\printindex` command with a file name, and indexing commands are written to (or read from) the name with the appropriate (`.idx` or `.ind`) extension appended. The `\printindex` command is modified from the LaTeX standard so that it doesn't create its own chapter or section heading; you therefore decide what names (or sectioning level, even) to use for the indexes, and `\indexname` is completely ignored.

To create a "general" and an "authors" index, one might write:

>     \usepackage{multind}
>     \makeindex{general}
>     \makeindex{authors}
>     ...
>     \index{authors}{Robin Fairbairns}
>     ...
>     \index{general}{FAQs}
>     ...
>     \section{General index}
>     \printindex{general}
>     \section{Author index}
>     \printindex{authors}

To complete the job, run LaTeX on your file enough times that labels, etc., are stable, and then execute the commands

>     makeindex general
>     makeindex authors

before running LaTeX again. Note that the names of the index files to process are not necessarily related to the name of the LaTeX file you're processing, at all. (There's no documentation that comes with the package: what you see above is as good as you will get...)

The index package provides a comprehensive set of indexing facilities, including a `\newindex` command that allows the definition of new styles of index. `\newindex` takes a 'tag' (for use in indexing commands), replacements for the `.idx` and `.ind` file extensions, and a title for the index when it's finally printed; it can also change the item that's being indexed against (for example, one might have an index of artists referenced by the figure number where their work is shown).

Using index, to create an author index together with a "normal" index, one would start with preamble commands:

>     \usepackage{index}
>     \makeindex
>     \newindex{aut}{adx}{and}{Name Index}

which load the package, define a "main" (original-style) index, and then define an author index. Then, in the body of the document, we might find commands like:

>     \index[aut]{Robin Fairbairns}
>     ...
>     \index{FAQs}

Which place an entry in the author index, and then one in the main index. At the end of the document, we have two commands:

>     \printindex
>     \printindex[aut]

Which will print the main index and then the author index. Supposing this lot to be in myfile.tex, after enough runs through LaTeX that labels are stable, execute the following commands (Unix-style shell commands shown here, but the principle is the same whatever system you're using):

>     makeindex myfile
>     makeindex myfile.adx -o myfile.and

and rerun LaTeX. The makeindex commands process myfile.idx to myfile.ind (the default action), and then myfile.adx to myfile.and, the two files needed as input by the two `\printindex` commands in myfile.tex.

The splitidx package (which comes with a small executable splitindex available for a variety of platforms) is another alternative. It supports the sorts of things that the index package does, but since it uses a separate program to separate the index entries, it is not limited by the number of output streams (La)TeX can have open at any one time. An example of use appears in the documentation.

`index.sty`
  Distributed as part of macros/latex/contrib/camel (zip, browse)
`makeidx.sty`
  Part of the LaTeX distribution
`multind.sty`
  macros/latex209/contrib/misc/multind.sty
`splitidx.sty and splitindex`
  macros/latex/contrib/splitindex (zip, browse)

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multind