Go to the first, previous, next, last section, table of contents.


Index Menus and Printing an Index

To print an index means to include it as part of a manual or Info file. This does not happen automatically just because you use @cindex or other index-entry generating commands in the Texinfo file; those just cause the raw data for the index to be accumulated. To generate an index, you must include the @printindex command at the place in the document where you want the index to appear. Also, as part of the process of creating a printed manual, you must run a program called texindex (see section Formatting and Printing Hardcopy) to sort the raw data to produce a sorted index file. The sorted index file is what is actually used to print the index.

Texinfo offers six different types of predefined index: the concept index, the function index, the variables index, the keystroke index, the program index, and the data type index (see section Predefined Indices). Each index type has a two-letter name: `cp', `fn', `vr', `ky', `pg', and `tp'. You may merge indices, or put them into separate sections (see section Combining Indices); or you may define your own indices (see section Defining New Indices).

The @printindex command takes a two-letter index name, reads the corresponding sorted index file and formats it appropriately into an index.

The @printindex command does not generate a chapter heading for the index. Consequently, you should precede the @printindex command with a suitable section or chapter command (usually @unnumbered) to supply the chapter heading and put the index into the table of contents. Precede the @unnumbered command with an @node line.

For example:

@node Variable Index, Concept Index, Function Index, Top
@comment    node-name,         next,       previous, up
@unnumbered Variable Index

@printindex vr

@node     Concept Index,     , Variable Index, Top
@comment      node-name, next,       previous, up
@unnumbered Concept Index

@printindex cp

Readers often prefer that the concept index come last in a book, since that makes it easiest to find. Having just one index helps readers also, since then they have only one place to look (see section @synindex).


Go to the first, previous, next, last section, table of contents.