Download The etoc package

Transcript
One more example of colored TOC layout . . . . . . . . . . . . . 31, p. 52
Part VII. Tips
... and tricks . . . . . . . . . . . . . . . . . . . . . . . . . . 32, p. 54
Hacking framed parboxes – Interverting the levels – All subsections of this document – Displaying statistics
– Using depth tags – Typesetting the TOC as a table – Compatibility with other packages – TEXnical matters
– Errors and catastrophes.
Part VIII. The code
Timestamp
. . . . . . . . . . . . . . . . . . . . . . . . . . 33, p. 67
Change history
. . . . . . . . . . . . . . . . . . . . . . . . 34, p. 67
Implementation
. . . . . . . . . . . . . . . . . . . . . . . . 35, p. 68
Abstract
The etoc package gives to the user complete control on how the entries of the
table of contents should be constituted from the name, number, and page number of
each sectioning unit. This goes via the definition of line styles for each sectioning
level used in the document. The package provides its own custom line styles. Simpler
ones are given as examples in the documentation. The simplest usage will be to take
advantage of the layout facilities of packages dealing with list environments.
Regarding the global toc display, etoc provides pre-defined styles based on a
multi-column format, with, optionally, a ruled title or framed contents.
The \tableofcontents command may be used arbitrarily many times and it has
a variant \localtableofcontents which prints tables of contents ‘local’ to the current surrounding document unit. An extension of the \label/\ref syntax allows to
reproduce (with another layout) a local table of contents defined somewhere else in
the document.
Via “depth tags”, one gets an even finer control for each table of contents of which
sectioning units it should, or not, display.
The formatting inherited (and possibly customized by other packages) from the
document class will be used when in compatibility mode.
The assignment of levels to the sectioning units can be changed at any time, and
etoc can thus be used in a quite general manner to create custom “lists of”, additionally to the tables of contents related to the document sectioning units. No auxiliary
file is used additionally to the standard .toc file.
1. Foreword
Popular packages dealing with TOCs include tocloft, titletoc and minitoc. Why another one? I started etoc for my own use, and found out only later about these mentioned
packages.
As is well explained in the tocloft package documentation, the standard LATEX layout for the Table of Contents is buried in the class definitions. In particular, most of the
3