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

4. Ending a Texinfo File

The end of a Texinfo file should include commands to create indices, and the @bye command to mark the last line to be processed.

For example:

@node Index
@unnumbered Index

@printindex cp


[ < ] [ > ]   [ << ] [ 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.

It’s not possible to generate an index when writing to standard output; makeinfo generates a warning in this case.

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

4.2 @bye File Ending

An @bye command terminates Texinfo processing. None of the formatters read anything following @bye. The @bye command should be on a line by itself.

If you wish, you may follow the @bye line with notes. These notes will not be formatted and will not appear in either Info or a printed manual; it is as if text after @bye were within @ignore@end ignore. Also, you may follow the @bye line with a local variables list for XEmacs. See section Using Local Variables and the Compile Command, for more information.

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

This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.