You can format the Texinfo file with the shell command
followed by the name of the Texinfo file. For example:
TeX will produce a DVI file as well as several auxiliary files containing information for indices, cross references, etc. The DVI file (for DeVice Independent file) can be printed on virtually any device (see the following sections).
tex formatting command itself does not sort the indices; it
writes an output file of unsorted index data. To generate a printed
index after running the
tex command, you first need a sorted
index to work from. The
texindex command sorts indices.
(The source file texindex.c comes as part of the standard
Texinfo distribution, among other places.) (
texindex as necessary.)
tex formatting command outputs unsorted index files under names
that obey a standard convention: the name of your main input file with
any ‘.texinfo’ (or similar, see What a Texinfo File
Must Have), followed by the two letter names of indices. For
example, the raw index output files for the input file
foo.texinfo would be foo.cp, foo.vr,
foo.fn, foo.tp, foo.pg and foo.ky. Those
are exactly the arguments to give to
Instead of specifying all the unsorted index file names explicitly, you can use ‘??’ as shell wildcards and give the command in this form:
This command will run
texindex on all the unsorted index files,
including any two letter indices that you have defined yourself using
@defcodeindex. You can safely run
‘texindex foo.??’ even if there are files with two letter
extensions that are not index files, such as ‘foo.el’. The
texindex command reports but otherwise ignores such files.
For each file specified,
texindex generates a sorted index file
whose name is made by appending ‘s’ to the input file name. The
@printindex command looks for a file with that name
(see Printing Indices & Menus).
texindex does not alter the
raw index output file.
After you have sorted the indices, you need to rerun
tex on the
Texinfo file. This regenerates the DVI file, this time with
up-to-date index entries.
Finally, you may need to run
tex one more time, to get the page
numbers in the cross references correct.
To summarize, this is a five step process:
texon your Texinfo file. This generates a DVI file (with undefined cross references and no indices), and the raw index files (with two letter extensions).
texindexon the raw index files. This creates the corresponding sorted index files (with three letter extensions).
texagain on your Texinfo file. This regenerates the DVI file, this time with indices and defined cross references, but with page numbers for the cross references from the previous run, generally incorrect.
texone last time. This time the correct page numbers are written for the cross references.
Alternatively, it’s a one-step process: run
(see Format with texi2dvi).
You need not run
texindex each time after you run
you do not, on the next run, the
tex formatting command will use
whatever sorted index files happen to exist from the previous use of
texindex. This is usually ok while you are debugging.
Sometimes you may wish to print a document while you know it is
incomplete, or to print just one chapter of a document. In that case,
the usual auxiliary files that TeX creates and warnings TeX
gives when cross references are not satisfied are just nuisances. You
can avoid them with the
@novalidate command, which you must
give before the
(see @setfilename). Thus, the beginning of your file
would look approximately like this:
\input texinfo @novalidate @setfilename myfile.info …
@novalidate also turns off validation in
makeinfo, just like its
(see Pointer Validation).