[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 @bye |
4.1 Printing Indices and Menus | How to print an index in hardcopy and generate index menus in Info. | |
4.2 @bye File Ending | How to mark the end of a file. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [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 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.
@printindex
produces a traditional
two-column index, with dot leaders between the index terms and page
numbers.
@printindex
produces a special menu containing
the line number of the entry, relative to the start of the node. Info
readers can use this to go to the exact line of an entry, not just the
containing node. (Older Info readers will just go to the node.)
Here’s an example:
* First index entry: Top. (line 7) |
The actual number of spaces is variable, to right-justify the line number; it’s been reduced here to make the line fit in the printed manual.
@printindex
produces the same menu, but
the line numbers are relative to the start of the file, since that’s
more convenient for that format.
@printindex
produces links
to the index entries.
It’s not possible to generate an index when writing to standard
output; makeinfo
generates a warning in this case.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
@bye
File EndingAn @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.