Next: , Previous: Citations, Up: Top

5 Index Support

LaTeX has builtin support for creating an Index. The LaTeX core supports two different indices, the standard index and a glossary. With the help of special LaTeX packages (multind.sty or index.sty), any number of indices can be supported.

Index entries are created with the \index{entry} macro. All entries defined in a document are written out to the .aux file. A separate tool must be used to convert this information into a nicely formatted index. Tools used with LaTeX include MakeIndex and xindy.

Indexing is a very difficult task. It must follow strict conventions to make the index consistent and complete. There are basically two approaches one can follow, and both have their merits.

  1. Part of the indexing should already be done with the markup. The document structure should be reflected in the index, so when starting new sections, the basic topics of the section should be indexed. If the document contains definitions, theorems or the like, these should all correspond to appropriate index entries. This part of the index can very well be developed along with the document. Often it is worthwhile to define special purpose macros which define an item and at the same time make an index entry, possibly with special formatting to make the reference page in the index bold or underlined. To make RefTeX support for indexing possible, these special macros must be added to RefTeX's configuration (see Defining Index Macros).
  2. The rest of the index is often just a collection of where in the document certain words or phrases are being used. This part is difficult to develop along with the document, because consistent entries for each occurrence are needed and are best selected when the document is ready. RefTeX supports this with an index phrases file which collects phrases and helps indexing the phrases globally.

Before you start, you need to make sure that RefTeX knows about the index style being used in the current document. RefTeX has builtin support for the default \index and \glossary macros. Other LaTeX packages, like the multind or index package, redefine the \index macro to have an additional argument, and RefTeX needs to be configured for those. A sufficiently new version of AUCTeX (9.10c or later) will do this automatically. If you really don't use AUCTeX (you should!), this configuration needs to be done by hand with the menu (Ref->Index Style), or globally for all your documents with

     (setq reftex-index-macros '(multind))     or
     (setq reftex-index-macros '(index))