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


Generating a Table of Contents

The @chapter, @section, and other structuring commands supply the information to make up a table of contents, but they do not cause an actual table to appear in the manual. To do this, you must use the @contents and/or @summarycontents command(s).

@contents
Generate a table of contents in a printed manual, including all chapters, sections, subsections, etc., as well as appendices and unnumbered chapters. (Headings generated by the @heading series of commands do not appear in the table of contents.)
@shortcontents
@summarycontents
(@summarycontents is a synonym for @shortcontents; the two commands are exactly the same.) Generate a short or summary table of contents that lists only the chapters (and appendices and unnumbered chapters). Omit sections, subsections and subsubsections. Only a long manual needs a short table of contents in addition to the full table of contents.

Both contents commands should be written on a line by themselves. The contents commands automatically generate a chapter-like heading at the top of the first table of contents page, so don't include any sectioning command such as @unnumbered before them.

Since an Info file uses menus instead of tables of contents, the Info formatting commands ignore the contents commands. But the contents are included in plain text output (generated by makeinfo --no-headers).

The contents commands can be placed either at the very end of the file, after any indices (see the previous section) and just before the @bye (see the next section), or near the beginning of the file, after the @end titlepage (see section @titlepage). The advantage to the former is that then the contents output is always up to date, because it reflects the processing just done. The advantage to the latter is that the contents are printed in the proper place, thus you do not need to rearrange the DVI file with @command{dviselect} or shuffle paper. However, contents commands at the beginning of the document are ignored when outputting to standard output.

As an author, you can put the contents commands wherever you prefer. But if you are a user simply printing a manual, you may wish to print the contents after the title page even if the author put the contents commands at the end of the document (as is the case in most existing Texinfo documents). You can do this by specifying @setcontentsaftertitlepage and/or @setshortcontentsaftertitlepage. The first prints only the main contents after the @end titlepage; the second prints both the short contents and the main contents. In either case, any subsequent @contents or @shortcontents is ignored (unless no @end titlepage is ever encountered).

You need to include the @set...contentsaftertitlepage commands early in the document (just after @setfilename, for example). Or, if you're using @command{texi2dvi} (see section Format with @code{texi2dvi}), you can use its @option{--texinfo} option to specify this without altering the source file at all. For example:

texi2dvi --texinfo=@setshortcontentsaftertitlepage foo.texi


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