manpagez: man pages & more
info texinfo
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 Printing Indices and Menus

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 separate types of predefined index, which suffice in most cases. See section Indices, for information on this, as well defining your own new indices, combining indices, and, most importantly advice on writing the actual index entries. This section focuses on printing indices, which is done with the @printindex command.

@printindex takes one argument, a two-letter index abbreviation. It reads the corresponding sorted index file (for printed output), and formats it appropriately into an index.

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

For example:

@node Variable Index
@unnumbered Variable Index

@printindex vr
@node Concept Index
@unnumbered Concept Index

@printindex cp

If you have more than one index, we recommend placing the concept index last.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October 2, 2013 using texi2html 5.0.

© 2000-2021
Individual documents may contain additional copyright information.