The minitoc package (version #40)

Jean-Pierre F. Drucbert ONERA / Centre de Toulouse / SRI

drucbert@onecert.fr

2004/12/20

Contents

1 The minitoc package  11
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 How to use the minitoc package . . . . . . . . . . . . . . . . . 13
1.2.1 Loading the package and creating the minitables . . . . . 13
1.2.2 Preparing the minitables . . . . . . . . . . . . . . . . . . 14
1.2.3 Placing the minitables . . . . . . . . . . . . . . . . . . . 15
1.2.4 Starred chapters and sections . . . . . . . . . . . . . . . . 18
1.2.5 Fonts and Titles . . . . . . . . . . . . . . . . . . . . . . . 19
1.2.6 Special Features . . . . . . . . . . . . . . . . . . . . . . 24
1.2.6.1 Horizontal Rules . . . . . . . . . . . . . . . . . 24
1.2.6.2 Page Numbers, Leaders . . . . . . . . . . . . . 24
1.2.6.3 Features for parttoc-s . . . . . . . . . . . . . 25
1.2.6.4 The “Chapter 0” Problem (solved) . . . . . . . 25
1.2.6.5 Special Entries for TOC, LOF, LOT, Bibliography and Index 26
1.2.6.6 The hints option . . . . . . . . . . . . . . . . 26
1.2.6.7 The notoccite option . . . . . . . . . . . . . 27

1.2.7 Usage with MS-DOS . . . . . . . . . . . . . . . . . . . . 27
1.3 The mtcoff package . . . . . . . . . . . . . . . . . . . . . . . . 29

2 Frequently Asked Questions  31
2.1 How to avoid a page break near the rules before and after the minitoc? 32
2.2 How about implementing others layouts for the minitoc? . . . . . 32
2.3 \\ in a contents line makes an error . . . . . . . . . . . . . . . . 32
2.4 Reordering chapters makes havoc . . . . . . . . . . . . . . . . . 32
2.5 Extensions for the names of auxiliary files . . . . . . . . . . . . . 33
2.6 Playing with the chapter number . . . . . . . . . . . . . . . . . . 33
2.7 Supported document classes . . . . . . . . . . . . . . . . . . . . 34
2.8 Compatibility with L^{A}TEX versions . . . . . . . . . . . . . . . . . 34
2.9 Other mini tables . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.10 Why so many auxiliary files? . . . . . . . . . . . . . . . . . . . . 35
2.11 How to do minitocs (minilofs and minilots) at levels other than chapter? 35
2.12 Compatibility with L^{A}TEX2.09 . . . . . . . . . . . . . . . . . . . . 36
2.13 Documents resetting the chapter number at each part . . . . . . . 36
2.14 The minitocs have too much spaced lines . . . . . . . . . . . . . 36
2.15 The secttocs are wrong . . . . . . . . . . . . . . . . . . . . . . . 36
2.16 How to remove lines of dots? . . . . . . . . . . . . . . . . . . . . 36
2.17 How to use the hyperref package with minitoc? . . . . . . . . 37
2.18 Problem while upgrading minitoc . . . . . . . . . . . . . . . . . 37
2.19 A local table of contents for the set of appendices . . . . . . . . . 37

2.20 Use with the appendix package . . . . . . . . . . . . . . . . . . 38
2.21 Use with the tocloft package . . . . . . . . . . . . . . . . . . . 39
2.22 Use with the memoir class . . . . . . . . . . . . . . . . . . . . . 39

List of Figures

2.1 Three compilations for minitoc . . . . . . . . . . . . . . . . . . 33

List of Tables

1.1 Commands for a minitoc . . . . . . . . . . . . . . . . . . . . . 14
1.2 Commands for a secttoc . . . . . . . . . . . . . . . . . . . . . 16
1.3 Commands for a parttoc . . . . . . . . . . . . . . . . . . . . . 17
1.4 Commands to add an entry in the table of contents for a starred chapter, section or part. 19
1.5 Fonts for the \mini... commands and siblings. . . . . . . . . . 20
1.6 Fonts for the table entries. . . . . . . . . . . . . . . . . . . . . . 21
1.7 Available languages . . . . . . . . . . . . . . . . . . . . . . . . . 28

Chapter 1 The minitoc package

\underline{Contents}

1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 How to use the minitoc package . . . . . . . . . . . . . . . 13
1.2.1 Loading the package and creating the minitables … 13
1.2.2 Preparing the minitables . . . . . . . . . . . . . . . . 14
1.2.3 Placing the minitables . . . . . . . . . . . . . . . . . 15
1.2.4 Starred chapters and sections . . . . . . . . . . . . . . 18
1.2.5 Fonts and Titles . . . . . . . . . . . . . . . . . . . . . 19
1.2.6 Special Features . . . . . . . . . . . . . . . . . . . . 24
1.2.6.1 Horizontal Rules . . . . . . . . . . . . . . . 24
1.2.6.2 Page Numbers, Leaders . . . . . . . . . . . 24
1.2.6.3 Features for parttoc-s . . . . . . . . . . . 25
1.2.6.4 The “Chapter 0” Problem (solved) . . . . . 25
1.2.6.5 Special Entries for TOC, LOF, LOT, Bibliography and Index 26
1.2.6.6 The hints option . . . . . . . . . . . . . . 26
1.2.6.7 The notoccite option . . . . . . . . . . . 27
1.2.7 Usage with MS-DOS . . . . . . . . . . . . . . . . . . 27
1.3 The mtcoff package . . . . . . . . . . . . . . . . . . . . . . 29

\underline{Tables}

1.1 Commands for a minitoc . . . . . . . . . . . . . . . . . . . 14
1.2 Commands for a secttoc . . . . . . . . . . . . . . . . . . . 16
1.3 Commands for a parttoc . . . . . . . . . . . . . . . . . . . 17
1.4 Commands to add an entry in the table of contents for a starred chapter, section or part. 19
1.5 Fonts for the \mini... commands and siblings. . . . . . . . 20

1.6 Fonts for the table entries. . . . . . . . . . . . . . . . . . . . 21
1.7 Available languages . . . . . . . . . . . . . . . . . . . . . . . 28

1.1 Introduction

This package, initially written by Nigel Ward and Dan Jurafsky, has been almost completely redesigned at ONERA/Centre de Toulouse by Jean-Pierre Drucbert. It creates a mini-table of contents (a “minitoc”^{1}) at the beginning of each chapter of a document. It is also possible to have a mini-list of figures (a “minilof”) and a mini-list of tables (a “minilot”). The document class should of course define chapters (classes like book or report) or sections (classes like article). Thus, this package should not be used with document classes without standard sectionning commands (like letter). When the document class defines a “part” sectionning level (i.e. classes like book, report and article), you can create a “partial” table of contents (a “parttoc”) at the beginning of each part of a document. It is also possible to have a partial list of figures (a “partlof”) and a partial list of tables (a “partlot”). When the document class has no \chapter command but has a \section command, you may use section level tables of contents (“secttoc”) at the beginning of each section. Note: you cannot use chapter level and section level table of contents in the same document. This restriction is intented to avoid documents with full of local tables of contents, lists of figures and tables at every sectionning level.

The current version of this package is #40.

Note: the commands relative to the part level are defined only if the document class defines \part. The commands relative to the section level are defined only if the document class does not define \chapter but defines \section.

1The minitoc package introduces its own jargon, explained in this document. It should not be too difficult, however, to learn and use.

Licence

This package must be distributed and/or may be modified under the conditions of the L^{A}TEX Project Public License, either version 1.1 of this license or (as convenient) any later version. The latest version of this license is in

     http://www.latex-project.org/lppl.txt

and version 1.1 or later is part of all distributions of L^{A}TEX version 1999/06/01 or later.

But please don’t bother me about hacked versions; they will not be supported.

1.2 How to use the minitoc package

1.2.1 Loading the package and creating the minitables

To use the minitoc package, you must introduce a command

\usepackage[...options...]{minitoc}

in the preamble of the document^{2}. The mini-table of contents will be in the chapter, after the \chapter command, at the point of the \minitoc command. The \minitoc command may occur anywhere inside a chapter. Of course, it is better to put it at the beginning of the chapter, eventually after some introductory material. But you can also decide to put it at the end of the chapter. You should use the same conventions in all chapters. If you want to add the mini-table of contents for a chapter, you must use the sequence given in Table 1.1 on the following page. For each mini-table of contents, an auxiliary file will be created with a name of the form ⟨document⟩.mtc⟨N⟩, where ⟨N⟩is the absolute chapter number. “Absolute” means that this number is unique, and always increasing from the first chapter. The suffix is .mlf⟨N⟩for mini-lists of figures and is .mlt⟨N⟩for minilists of tables. (If under MS-DOS or any operating system with short extensions to filenames, see section 1.2.7on page 27 and section 2.5 on page 33).

2This command must be placed after any modification done on the sectionning commands; if you modify sectionning commands after loading the minitoc package, minitoc will not work properly.

14 CHAPTER 1. THE MINITOC PACKAGE

Table 1.1: Commands for a minitoc

\documentclass[...]{book}
\usepackage[...options...]{minitoc}
...

\setcounter{minitocdepth}{2}  default
\setlength{\mtcindent}{24pt}  default
\setlength{\mtcskip}{\bigskipamount} default
\renewcommand{\mtcfont}{\small\rm} default
\renewcommand{\mtcSfont}{\small\bf} default

...
\begin{document}
...
\dominitoc
\dominilof
\dominilot

\tableofcontents                     or \faketableofcontents
\listoffigures                       or \fakelistoffigures
\listoftables                        or \fakelistoftables

...
\chapter{...}

\minitoc                             if you want one

\mtcskip

\minilof                             if you want one

\mtcskip

\minilot                             if you want one

...

1.2.2 Preparing the minitables

The commands \dominitoc, \dominilof and \dominilot (for mini tables at the chapter level), take the ⟨document⟩.toc, ⟨document⟩.lof and ⟨document⟩.lot files, respectively, and cut slices from them to create the ⟨document⟩.mtc⟨N⟩, ⟨document⟩.mlf⟨N⟩and ⟨document⟩.mlt⟨N⟩files.

The commands \dosecttoc, \dosectlof and \dosectlot (for mini tables

at the section level) and \doparttoc, \dopartlof and \dopartlot (for mini tables at the part level) are analog.

All these commands must be put before the \tableofcontents, \listoffigures and \listoftables commands, or their \fake... siblings.

1.2.3 Placing the minitables

The \mtcskip command may be used to add a vertical skip between two minitoclike tables. Its height is \mtcskipamount (equal to \bigskipamount by default). \mtcskip eliminates any immediate previous vertical skip, to not accumulate vertical space when a mini-table is empty and skipped by the checkfiles option.

The section-level table of contents will be in the section, after the \section command, at the point of the \secttoc command. The \secttoc command may occur anywhere inside a section. Of course, it is better to put it at the beginning of the section, or after some short introductory material. You should use the same conventions in all sections. If you want to add the section-level table of contents for a section, you must use the sequence given in Table 1.2 on the next page. For each section-level table of contents, an auxiliary file will be created with a name of the form ⟨document⟩.stc⟨N⟩, where ⟨N⟩is the absolute section number. The suffix is .slf⟨N⟩for section-level lists of figures and is .slt⟨N⟩for section-level lists of tables. (If under MS-DOS or any operating system with short extensions to filenames, see section 1.2.7on page 27 and section 2.5 on page 33).

As floats (figures and tables) could go somewhere outside the printing area of the text of the section, the sectlofs and sectlots can be rather strange. In order to have a better behaviour of these, it may be useful to add the insection option in

the \usepackage command:
     \usepackage[insection]{minitoc}

if you want more coherent sectlofs and seclots. The insection option loads the placeins package with its section and bottom options. The placeins package, by Donald Arsenau, is available on CTAN archives; placeins.sty contains its own documentation.

If you want to add the partial table of contents for a part, you must use the sequence given in Table 1.3on page 17. For each partial table of contents, an auxiliary file will be created with a name of the form ⟨document⟩.ptc⟨N⟩, where ⟨N⟩ is the absolute part number. The suffix is .plf⟨N⟩for partial lists of figures and

Table 1.2: Commands for a secttoc

  \documentclass[...]{article}
  \usepackage{minitoc}
  ...

  \setcounter{secttocdepth}{2} default
  \setlength{\stcindent}{24pt} default
  \renewcommand{\stcfont}{\small\rmfamily\upshape\mdseries} default
  \renewcommand{\stcSSfont}{\small\rmfamily\upshape\bfseries} default

  ...
  \begin{document}
  ...
  \dosecttoc
  \dosectlof
  \dosectlot

  \tableofcontents             or \faketableofcontents
  \listoffigures               or \fakelistoffigures
  \listoftables                or \fakelistoftables

  ...
  \section{...}

  \secttoc                     if you want one
  \sectlof                     if you want one
  \sectlot                     if you want one

  ...

is .plt⟨N⟩for partial lists of tables. (If under MS-DOS or any operating system with short extensions to filenames, see section 1.2.7on page 27 and section 2.5on page 33).

Note: the user is responsible of asking or not asking a mini-toc (lof or lot) for some chapter. Asking a minilof for a chapter without any figure would result in an empty and ugly mini list of figures (i.e. the title and two horizontal rules). He is also responsible of requiring or not requiring a partial toc (lof or lot) for some part. Asking a partlof for a part without any figure would result in an empty and ugly part list of figures (i.e. the title alone on a page). Analogous remarks apply to section-level tables of contents (secttoc, sectlof and sectlot) and to the part-level tables of contents (parttoc, partlof and partlot).

Table 1.3: Commands for a parttoc

  \documentclass[...]{book}
  \usepackage{minitoc}
  ...

  \setcounter{parttocdepth}{2}  default
  \setlength{\ptcindent}{0pt}  default
  \renewcommand{\ptcfont}{\normalsize\rm} default
  \renewcommand{\ptcCfont}{\normalsize\bf} default
  \renewcommand{\ptcSfont}{\normalsize\rm} default

  ...
  \begin{document}
  ...
  \doparttoc
  \dopartlof
  \dopartlot

  \tableofcontents                         or \faketableofcontents
  \listoffigures                           or \fakelistoffigures
  \listoftables                            or \fakelistoftables

  ...
  \part{...}

  \parttoc                                 if you want one
  \partlof                                 if you want one
  \partlot                                 if you want one

  ...

But since version #35, empty mini tables are just ignored and this problem should disappear in normal circumstances. Nevertheless, we recommend to put no \minitoc command in a chapter without sections and no \minilof or \minilot command in a chapter without figures or tables. The checkfiles package option (default) skips empty mini tables (with a warning); the nocheckfiles package option restores the old behaviour (empty mini tables are displayed).

By default, the mini tables and partial tables of contents contain only references to sections and subsections. The minitocdepth, secttocdepth and parttocdepth counters, similar to tocdepth, allow the user to modify this behaviour. Mini or partial lists of figures or tables are not affected by the value of these counters.

1.2.4 Starred chapters and sections

NOTE: if using \chapter* and a

     \addcontentsline{toc}{chapter}{...}

command to add something in the table of contents, the numbering of minitoc files would be altered. To avoid that problem, say

     \addstarredpart{...}
     \addstarredchapter{...}
     \addstarredsection{...}

These commands apply only for the level of a part-, mini- or sect-toc; for lower levels, use, as usual:

     \addcontentsline{toc}{section}{...}

for example, to add a section-level entry in the toc and the minitoc:

   \chapter*{Title of chapter}
   \addstarredchapter{Title of chapter}
   \minitoc
   \section*{First section}
   \addcontentsline{toc}{section}{First section}
   \section*{Second section}
   \addcontentsline{toc}{section}{Second section}

There is sometimes a problem with minitocs (and siblings) when you use \chapter* (or \section*): the minitocs appear in the wrong chapter. You can

add a \adjustmtc (or \adjuststc or \adjustptc) command at the end of the

starred chapter (or section or part) to increment the corresponding counter. Do not use commands like \stepcounter{mtc} (which should work), because the mtcoff package knows what to do about \adjustmtc (and others), but can do nothing about \stepcounter, as it is a standard basic command of L^{A}TEX, not a minitoc specific command.

A more clever way to solve this problem is to use commands similar to:

Table 1.4: Commands to add an entry in the table of contents for a starred chapter, section or part.

Level  With title

                 chapter \mtcaddchapter[⟨title⟩]
                 section \mtcaddsection[⟨title⟩]
                 part  \mtcaddpart[⟨title⟩]

     \mtcaddchapter[⟨title⟩]

which adds an entry in the table of contents (and adjusts the counter, because it calls \adjustmtc). The table 1.4summarizes these commands, that you put after \chapter*, etc. If the optional argument is omitted or empty or blank, no entry will be visible in the table of contents nor in the minitocs. If the optional argument is something invisible (like ~, \space or \quad), the result will be strange but logically correct.

1.2.5 Fonts and Titles

The mini and partial tables and lists are typeset in a verse-like environment, and can be split over pages. The mini-table of contents is typeset in the \mtcfont font, which is \small\rmfamily by default. Section entries are typeset in the \mtcSfont font, which is \small\bfseries by default. For subsections, subsubsections, paragraphs and subparagraphs, the commands

\mtcSSfont, \mtcSSSfont, \mtcPfont and \mtcSPfont are available (by

default, \small\rmfamily) to enable the use of various fonts. Mini lists of figures and tables are typeset in the fonts \mlffont and \mltfont, which are \small\rmfamily by default.Tables 1.5 on the following page and 1.6 on page 21 summarize these many commands^{3}.

Titles are typeset in the \mtifont (\large\bfseries by default) font and the text strings of the titles are defined by \mtctitle, \mlftitle and \mlttitle, which are the strings “Contents”, “Figures” and “Tables” by default. These commands should be redefined by \renewcommand for languages other than english. The language option files like french.mld and

3Thanks to Stefan Ulrich, who contributed these tables initialy.

Table 1.5: Fonts for the \mini... commands and siblings.

Command Font default setting Title string

default setting Title font

default setting

For the \part... commands:

\parttoc  \ptcfont
              \normalsize\rmfamily^{∗}
              \small\rmfamily^{∗∗}

                                     \ptctitle

Table of Contents^{†}

                                                         \ptifont
                                                             \Huge\bfseries^{∗}
                                                             \Large\bfseries^{∗∗}
\partlof  \plffont
              \normalsize\rmfamily^{∗}
              \small\rmfamily^{∗∗}

                                     \plftitle

List of Figures^{†}

                                                         \ptifont
                                                             \Huge\bfseries^{∗}
                                                             \Large\bfseries^{∗∗}
\partlot  \pltfont
              \normalsize\rmfamily^{∗}
              \small\rmfamily^{∗∗}

                                     \plttitle

List of Tables^{†}

                                                         \ptifont
                                                             \Huge\bfseries^{∗}
                                                             \Large\bfseries^{∗∗}

For the \mini... commands:^{∗}

\minitoc  \mtcfont
              \small\rmfamily

                                     \mtctitle ; Contents^{†}

                                                         \mtifont
                                                             \large\bfseries
\minilof  \mlffont
              \small\rmfamily

                                     \mlftitle ; Figures^{†}

                                                         \mtifont
                                                             \large\bfseries
\minilot  \mltfont
              \small\rmfamily

                                     \plttitle ; Tables^{†}

                                                         \mtifont
                                                             \large\bfseries

For the \sect... commands:^{∗∗}

\secttoc  \stcfont
              \small\rmfamily

                                     \stctitle ; Contents^{†}

                                                         \stifont
                                                             \Large\bfseries
\sectlof  \slffont
              \small\rmfamily

                                     \mlftitle ; Figures^{†}

                                                         \stifont
                                                             \Large\bfseries
\sectlot  \sltfont
              \small\rmfamily

                                     \plttitle ; Tables^{†}

                                                         \stifont
                                                             \Large\bfseries

∗for document classes with \chapter level (e.g. book, report) ∗∗for document classes with no \chapter level (e.g. article) †default for english; changed by the language definition files or \renewcommand All these fonts use \rmfamilyand \upshape, and \mdseriesby default

english.mld^{4} (and others^{5}, more than fifty today) are available.You can easily prepare a similar file for a preferred language.You can change the language of these titles by using the \mtcselectlanguage{language} macro.

4The suffix .mld means “minitoc language definition (file)”.

5Most of the strings defined in these language option files were taken from the superb babel package by Johannes Braams, some were adapted, others were made available by gentle users or taken from specific packages, like ArabTEX, Montex (mongol), or vietnam.sty, or even found by searching on the Web (japanese.mld).Other languages are welcome.

1.2. HOW TO USE THE MINITOC PACKAGE 21

Table 1.6: Fonts for the table entries.

Level  Font  default setting

For the \parttoc entries:

Chapter^{∗}  \ptcCfont^{∗} \normalsize\bfseries^{∗}

Section  \ptcSfont   \normalsize\rmfamily^{∗}
                         \small\bfseries^{∗∗}

Subsection  \ptcSSfont (like \ptcfont)

Subsubsection \ptcSSfont (like \ptcfont)

Paragraph  \ptcPfont (like \ptcfont)
Subparagraph \ptcSPfont (like \ptcfont)

For the \minitoc entries:^{∗}

Section  \mtcSfont   \small\bfseries
Subsection  \mtcSSfont (like \mtcfont)

Subsubsection \mtcSSfont (like \mtcfont)

Paragraph  \mtcPfont (like \mtcfont)
Subparagraph \mtcSPfont (like \mtcfont)

For the \secttoc entries:^{∗∗}

Subsection  \stcSSfont  \normalsize\bfseries

Subsubsection \stcSSfont (like \stcfont)

Paragraph  \stcPfont (like \stcfont)
Subparagraph \stcSPfont (like \stcfont)

∗for document classes with \chapter level (e.g. book, report) ∗∗for document classes with no \chapter level (e.g. article)

The partial table of contents is typeset in the \ptcfont font, which is defined as \normalsize\rmfamily by default. Chapter entries are typeset in the \ptcCfont font, which is \normalsize\bfseries by default. Section entries are typeset in the \ptcSfont font, which is \normalsize\rmfamily by default. For subsections, subsubsections, paragraphs and subparagraphs, the commands

\ptcSSfont, \ptcSSSfont, \ptcPfont and \ptcSPfont are available (by de-

fault, \normalsize\rmfamily) if you want to use various fonts. Partial lists of figures and tables are typeset in the fonts \mlffont and \mltfont, which are

\normalsize\rmfamily by default.

Titles are typeset in the \ptifont (\Huge\bfseries by default) font and the text strings of the titles are defined by \ptctitle, \plftitle and \plttitle, which are the strings “Table of Contents”, “List of Figures” and “List of Tables” by default. These commands should be redefined by \renewcommand for languages other than english. The language option files like french.mld and english.mld (and many others, see footnote 5 on page 20) are available. You can easily prepare a similar file for a preferred language. You can change the language of these titles by using the \mtcselectlanguage{language} macro.

The section-level table of contents is typeset in the \stcfont font, which is defined as \normalsize\rmfamily by default. Subsection entries

are typeset in the \stcSSfont font, which is \normalsize\bfseries by

default. Subsubsection entries are typeset in the \stcSSSfont font, which is \normalsize\rmfamily by default. For subsubsections, paragraphs and subparagraphs, the commands \stcSSSfont, \stcPfont and \stcSPfont are available (by default, \normalsize\rmfamily) if you want to use various fonts. Partial lists of figures and tables are typeset in the fonts \slffont and

\sltfont, which are defined as \normalsize\rmfamily by default.

Titles are typeset in the \stifont (\normalsize\bfseries by default) font and the text strings of the titles are defined by \stctitle, \slftitle and \slttitle, which are the strings “Contents”, “Figures” and “Tables” by default. These commands should be redefined by \renewcommand for languages other than english. The language option files like french.mld and english.mld (and some others, see footnote 5 on page 20) are available. You can easily prepare a similar style for a preferred language.You can change the language of these titles by using the \mtcselectlanguage{language} macro.

By default, titles are on the left. The commands \dominitoc, \dominilof and \dominilot accept an optional argument to change the default position of the corresponding title: [l] for left (default), [c] for center, [r] for right, or [e] (or [n]) for empty (no title). The change is global for all the document. If you want to change the position of the title for only one minitoc (or minilof or minilof), just use such an optional argument with the command \minitoc (or \minilof

or \minilot).

By default, titles are on the left. The commands \doparttoc, \dopartlof and \dopartlot accept an optional argument to change the default position of the corresponding title: [l] for left (default), [c] for center, [r] for right, or [e] (or [n])for empty (no title). The change is global for all the document. If you want to change the position of the title for only one parttoc (or partlof or partlof), just use such an optional argument with the command \parttoc (or \partlof

or \partlot).

By default, titles are on the left. The commands \dosecttoc, \dosectlof and \dosectlot accept an optional argument to change the default position of the corresponding title: [l] for left (default), [c] for center, [r] for right, or [e] (or [n]) for empty (no title). The change is global for all the document. If you want to change the position of the title for only one secttoc (or sectlof or sectlof), just use such an optional argument with the command \secttoc (or \sectlof

or \sectlot).

To summarize: by default, all titles are on the left. However, each one of the following commands:

   \doparttoc, \dopartlof, \dopartlot,
   \dominitoc, \dominilof, \dominilot,
   \dosecttoc, \dosectlof, \dosectlot,
   \parttoc, \partlof, \partlot,
   \minitoc, \minilof, \minilot,
   \secttoc, \sectlof, \sectlot

accepts an optional argument to change the positioning of the title: [l] for left (default), [c] for center, [r] for right, [e] or [n] for empty (no title). The arguments for the \do... commands change the positioning of all corresponding titles of the document. For the other commands, the options only change the formatting of the current heading.

With the commands \tightmtctrue (or the tight package option) and \tightmtcfalse (or the loose package option, which is the default), the minitocs (minilofs, etc.) will have less (tight) or more (loose) space between contents lines.

The mini-tables and lists, as partial and section-level tables and lists, are using some space on the first pages on each chapter, part or section, thus the page numbers are altered. After the first L^{A}TEX run, the mini-tables and lists, partial tables and lists and section-level tables and lists will be empty (in fact skipped since version #35); after the second run, they appear (if not empty), but because they modify the page numbering, page numbers are wrong; after the third L^{A}TEX run, the mini, partial and section-level tables and lists should be correct (see figure 2.1 on page 33).

1.2.6 Special Features

1.2.6.1 Horizontal Rules

By default, most of minitocs and siblings have horizontal rules after their titles and at their ends. The exception is the “parttoc” in a book- or report-like document (i.e. when \chapter is defined). To activate or deactivate these rules, the following commands are available:

defaults for

             rules in  no rules in book  report  article

\ptcrule parttocs \noptcrule parttocs  N  N  Y
\mtcrule minitocs \nomtcrule minitocs  Y  Y  N-A
\stcrule secttocs \nostcrule secttocs  N-A N-A  Y

1.2.6.2 Page Numbers, Leaders

By default, the page numbers are listed in each minitoc, minilof, etc. Some authors want only the section titles (with the section numbers), but not the page numbers. Hence the obvious declarations below are available:

      Type      Page numbers (Default)      No page numbers
      minitoc  \mtcpagenumbers           \nomtcpagenumbers
      secttoc  \stcpagenumbers           \nostcpagenumbers
      parttoc  \ptcpagenumbers           \noptcpagenumbers
      minilof  \mlfpagenumbers           \nomlfpagenumbers
      sectlof  \slfpagenumbers           \noslfpagenumbers
      partlof  \plfpagenumbers           \noplfpagenumbers
      minilot  \mltpagenumbers           \nomltpagenumbers
      sectlot  \sltpagenumbers           \nosltpagenumbers
      partlot  \pltpagenumbers           \nopltpagenumbers

In the minitocs and siblings, they are leaders of dots between the section titles and the page numbers. The undotted package option removes these dots. The dotted package option is the default.

1.2.6.3 Features for parttoc-s

By default, a parttoc (or a partlof or a parlot) is preceeded and followed by a \cleardoublepage, and has a page style of empty. Since version #32, you can modify this behaviour by redefining the following commands, whose meaning is obvious:

      Type     Command                  Default
      parttoc  \beforeparttoc           \cleardoublepage
      parttoc  \afterparttoc            \cleardoublepage
      parttoc  \thispageparttocstyle    \thispagestyle{empty}
      partlof  \beforepartlof           \cleardoublepage
      partlof  \afterpartlof            \cleardoublepage
      partlof  \thispagepartlofstyle    \thispagestyle{empty}
      partlot  \beforepartlot           \cleardoublepage
      partlot  \afterpartlot            \cleardoublepage
      partlot  \thispagepartlotstyle    \thispagestyle{empty}

1.2.6.4 The “Chapter 0” Problem (solved)

Some documents do not begin with chapter number one, but with chapter number zero (or even a weirder number). To make the minitoc package work with such documents, you must insert the command

     \firstchapteris{⟨N⟩}

before the \dominitoc and analogous commands. ⟨N⟩is the number of the first chapter. This command does not modify the numbering of chapters, you must use a \addtocounter{chapter}{-1} command to get a first chapter numbered 0. The \firstpartis and \firstsectionis commands are analogous for parts and sections with a non standard numbering.

Since version #17c, these commands are obsolete, as this problem has been solved. Thus they just produce a harmless warning.

1.2.6.5 Special Entries for TOC, LOF, LOT, Bibliography and Index

If you want to add entries in the Table of Contents for objects like the Table of Contents itself, the List of Figures, the List of Tables, the Bibliography or the Index, you should use the tocbibind package by Peter R. Wilson (this package is available from the CTAN archives).

But these entries are considered as chapters (or sections in an article class document) when the .toc file is scanned to prepare the minitocs (the \dominitoc phase).

So you must add an \mtcaddchapter command, without argument, after the

commands \tableofcontents, \listoffigures and \listoftables.

For the bibliography, you should add a \adjustmtc command after the

\bibliography command.

For the index, it is a bit more complicated, you add the following commands just after the \printindex command:

     \addcontentsline{lof}{xchapter}{}
     \addcontentsline{lot}{xchapter}{}
     \mtcaddchapter

Of course, in documents were the TOC, LOF, LOT, bibliography and/or index are processed as starred sections, you must modify these additions to use section level commands.

And proceed with care, tracking in the .log file the insertion of .mtcN files (and siblings). They are some examples in the add.tex file distributed with

minitoc.

1.2.6.6 The hints option

This option detects the loading of some packages known to interact with minitoc. This list of interacting packages is not closed. If a known package is loaded, this option writes some hints in the .log file and emits a warning. The hints written in the .log file may suggest you to consult the present document or the minitoc.bug file. This option is still experimental; you advice is welcome.

1.2.6.7 The notoccite option

This option loads the notoccite package (by Donald Arseneau). It avoids problems with \citecommands in sectionning commands or captions: if you then run BibTEX using the unsrt (unsorted) style, they get numbered starting from 1, not the number they should have in the main text. The notoccite package prevents this. As minitoc prints TOCs, it is subject to the same problem.

1.2.7 Usage with MS-DOS

Under MS-DOS (and other PC oriented operating systems), the filename extensions are limited to 3 characters. The minitoc package determines dynamically the type of extensions available and will use it. All other modifications will be done automatically. The .mtc⟨N⟩suffix will become .M⟨N⟩, where ⟨N⟩is the absolute chapter number. The suffixes .mlf⟨N⟩and .mlt⟨N⟩become .F⟨N⟩and .T⟨N⟩. The .ptc⟨N⟩suffix will become .P⟨N⟩, where ⟨N⟩is the part number. The suffixes .plf⟨N⟩and .plt⟨N⟩become .G⟨N⟩and .U⟨N⟩. The .stc⟨N⟩suffix will become .S⟨N⟩, where ⟨N⟩is the absolute section number. The suffixes .slf⟨N⟩and .slt⟨N⟩become .H⟨N⟩and .V⟨N⟩. Of course, this implies a limit of 99 chapters in a document, but do you really need so many chapters (or sections in an article)? The limit of 99 parts does not seem too serious for most documents. See also section 2.5 on page 33).

Table 1.7: Available languages

1. afrikaan (afrikaans)

2. arab (arabic)^{a,c}

3. armenian

4. bahasa

5. bangla

6. basque

7. bicig^{c}

8. brazil

9. breton

10. bulgarian

11. buryat

12. catalan

13. croatian

14. czech

15. danish

16. dutch

17. english (american, canadian)

18. esperant (esperanto)

19. estonian

20. ethiopia (ethiopian)

21. finnish

22. french (frenchb, frenchle, frenchpro, francais, acadien, canadien)

23. galician

24. german (austrian)

25. germanb

26. greek^{c}

27. hebrew^{c}

28. icelandic

29. interlingua

30. irish

31. italian

32. japanese^{c}

33. latin

34. lithuanian

35. lsorbian

36. magyar (hungarian)

37. mongol^{c}

38. ngermanb (ngerman, naustrian)

39. norsk

40. nynorsk

41. polish

42. portuges

43. romanian

44. russian^{b,c}

45. russianb^{b,c}

46. russianc^{b,c}

47. samin

48. scottish

49. serbian

50. slovak

51. slovene

52. spanish (castillan)

53. swedish

54. turkish

55. ukraineb^{b,c}

56. usorbian

57. vietnam (vietnamese)^{b,c}

58. welsh

a The arab(ic) language requires the use of ArabTEX.

b The russian language is not yet supported by babel, but russianb is supported if you use babel-3.6 or higher; russianc is an extra.

c Some languages may require specific fonts.

1.3 The mtcoff package

When a document has been prepared with the minitoc package, it contains many minitoc specific commands, most of them being \dominitoc, \faketableofcontents, and \minitoc commands (and their equivalents for lists of figures and tables). If you want to typeset this document without any mini-table, you has just to replace the minitoc package by the mtcoff package (without option), and all these commands will be ignored. At least two L^{A}TEX runs will be necessary to get a correct page numbering and correct cross references.It also sanitizes the .aux, .toc, .lof, and .lot files from minitoc specific spurious commands.

Chapter 2 Frequently Asked Questions

\underline{Contents}

2.1 How to avoid a page break near the rules before and after the minitoc?  32
2.2 How about implementing others layouts for the minitoc?  . 32
2.3 \\ in a contents line makes an error . . . . . . . . . . . . . 32
2.4 Reordering chapters makes havoc . . . . . . . . . . . . . . 32
2.5 Extensions for the names of auxiliary files . . . . . . . . . . 33
2.6 Playing with the chapter number . . . . . . . . . . . . . . . 33
2.7 Supported document classes . . . . . . . . . . . . . . . . . 34
2.8 Compatibility with L^{A}TEX versions . . . . . . . . . . . . . . 34
2.9 Other mini tables . . . . . . . . . . . . . . . . . . . . . . . 34
2.10 Why so many auxiliary files? . . . . . . . . . . . . . . . . . 35
2.11 How to do minitocs (minilofs and minilots) at levels other than chapter?  35
2.12 Compatibility with L^{A}TEX2.09 . . . . . . . . . . . . . . . . . 36
2.13 Documents resetting the chapter number at each part  … 36
2.14 The minitocs have too much spaced lines . . . . . . . . . . 36
2.15 The secttocs are wrong . . . . . . . . . . . . . . . . . . . . 36
2.16 How to remove lines of dots? . . . . . . . . . . . . . . . . . 36
2.17 How to use the hyperref package with minitoc? . . . . . 37
2.18 Problem while upgrading minitoc . . . . . . . . . . . . . . 37
2.19 A local table of contents for the set of appendices . . . . . . 37
2.20 Use with the appendix package . . . . . . . . . . . . . . . 38
2.21 Use with the tocloft package . . . . . . . . . . . . . . . . 39
2.22 Use with the memoir class . . . . . . . . . . . . . . . . . . . 39

\underline{Figures}

2.1 Three compilations for minitoc . . . . . . . . . . . . . . . . 33

Here is a list of problems and frequently asked questions about minitoc.sty. If the version has a number less than 40, please upgrade to version #40.

2.1 How to avoid a page break near the rules before and after the minitoc?

This problem seemed solved since version #8, but version #12 adds better fixes.

2.2 How about implementing others layouts for the minitoc?

Suggestions are welcome.

2.3 \\ in a contents line makes an error

Use \protect\linebreak.

2.4 Reordering chapters makes havoc

If you reorder chapters, havoc follows… minitocs going in wrong chapters.

The best way seems to make one run with the mtcoff package replacing the minitoc package, then restore the minitoc package and re-execute L^{A}TEX three times (yes, it is time consuming…). See figure 2.1 on the facing page. Running with the mtcoff package ensures that auxiliary files are cleared from “spurious” commands introduced by minitoc. A more radical solution is to delete the files .aux, .lof and .lot relative to the document, then re-execute L^{A}TEX three times.

   \dominitoc                       \dominitoc                       \dominitoc \tableofcontents                 \tableofcontents                 \tableofcontents \minitoc                         \minitoc                         \minitoc L^{A}TEX (1)  L^{A}TEX (2)  L^{A}TEX (3) .toc                             .toc .mtc⟨N⟩  .mtc⟨N⟩ (A)  (C) (B)  (D)

(A) \tableofcontents produces a table of contents, which is likely inaccurate.

(B) \minitoc produces minitocs, which are likely inaccurate.

(C) \tableofcontents produces a table of contents, which is accurate.

(D) \minitoc produces minitocs, which are accurate.

Figure 2.1: Three compilations for minitoc

2.5 Extensions for the names of auxiliary files

This package creates auxiliary files with extensions like .mtc⟨N⟩. Some operating systems allow only 3 letters extensions. What to do? No modification is needed: all became automatic since version #28! If you insist to use 3 characters extensions, even on operating systems allowing more, just use the package option shortext. Then you will get first the auto-configuration messages, then a message saying that you will use short extensions.

2.6 Playing with the chapter number

Do not cheat with the “chapter” counter, i.e. do not write ugly things like

     \setcounter{chapter}{6}

The mechanism would break. It is better to add \chapter commands, to create empty (but numbered in a legal way) chapters. Since version #10, minitoc.sty works with appendices. Version #19 allows to begin with a chapter other that number 1. And look at “Special Entries for TOC, LOF, LOT, Bibliography and Index”, section 1.2.6.5on page 26.

2.7 Supported document classes

The minitoc package is restricted to document classes which define chapters in the standard way, like ‘book’ and ‘report’, or sections in the standard way, like ‘article’. There are “parttocs” if the document class defines the \part command.

2.8 Compatibility with L^{A}TEX versions

Some users have failed to make minitoc to work. They got a message like:

     Undefined command ... \@inputcheck ...

or:

     Undefined command ... \reset@font ...

The \reset@font command has been added to latex.tex on 29 September 1991 and the \@inputcheck command on 18 March 1992 and this version of latex.tex has been released on 25 March 1992. If you get this message, you have an old version of latex.tex. Get a recent one from the archives and regenerate a latex.fmt format via initex (or your configuration tool).

2.9 Other mini tables

Some demanding users want to have minilof, minilot and minibbl. First, minibbl is another problem, strongly related to the BibTEX’s dealing with .aux files. Look

at the chapterbib, bibunits, multibib, and bibtopic packages. Version #13

has implemented basic minilofs and minilots. Minibbls are not the aim of this package.

2.10 Why so many auxiliary files?

This package creates a lot of auxiliary files and some users have argued that it is too many. A deep redesign would be necessary to avoid that. Using only one big auxiliary file (or one for all minitocs, one for all minilofs, …) would make the reading of such file very slow, as it would be read for each \miniXXX macro! Moreover, this would make the checkfiles option impractical to implement. Note that the many files *.mtc*, etc., may be deleted after the L^{A}TEX run. They are rebuilt by the \dominitoc command (and siblings). Moreover, since version #35, empty minitocs (and co.) can be automatically detected and skipped. It would not be easy to do with one big auxiliary file. But, since version #38, minitoc is able to detect and skip empty minitoc files (and co.) to avoid ugly titles with just two thin rules.

2.11 How to do minitocs (minilofs and minilots) at levels other than chapter?

Here also, some redesign was needed. From version #15, there are parttocs, partlofs and partlots for the part level in book-like and article-like documents, secttocs, sectlofs and sectlots for the section level in article-like documents. Note that you can not have minitocs features at chapter and section level in the same document, because doing so would make an unreadable monster. The user must choose the main class of the document accordingly to the size of it (e.g. do not write an article of more than 130 sections: this is a report, or even a book!).

                         part  chapter  section
                book  ∗  ∗
                report  ∗  ∗
                article ∗  ∗

2.12 Compatibility with L^{A}TEX2.09

The more recent version of L^{A}TEX 2ε adds \protect before \contentsline in the .toc, .lof and .lof files. Minitoc version #17 attempts to be compatible with L^{A}TEX 2ε and L^{A}TEX-2.09. This will be the last version usable with L^{A}TEX-2.09. Versions #18 and later are L^{A}TEX 2ε specific, and no more compatible with L^{A}TEX2.09, which is obsolete.

2.13 Documents resetting the chapter number at each part

Since version #23, minitoc works with document classes resetting chapter (or section) number at each part.

2.14 The minitocs have too much spaced lines

From version #29, you can have tight minitocs with the tight option.

2.15 The secttocs are wrong

Secttocs did not work: corrected (#38).

2.16 How to remove lines of dots?

The lines of dots between section titles and page numbers are removed by the undotted option (#29).

2.17 How to use the hyperref package with minitoc?

Since version #31, minitoc works with the hyperref package, thanks to Heiko Oberdiek (oberdiek@ruf.uni-freiburg.de). If you add the loading of the hyperref package to a document yet using minitoc, you will get error message about spurious closing braces. Just let finish the L^{A}TEX run, then re-L^{A}TEX the document. There will be no problem if you remove the loading of hyperref and add it again: the problem occurs only when upgrading from minitoc #30 to minitoc #31 (or higher) with a document already processed and adding hyperref at the same time! It seems better to process the document with minitoc #31 (or higher) without hyperref, then with hyperref, because some internal commands written into the auxiliary files have been modified. If used, the hyperref package must be loaded before minitoc. Note that minitoc.tex shows a basic example of the use of the hyperref package with minitoc.

2.18 Problem while upgrading minitoc

If upgrading from version #30 or lower to version #31 or higher, you should delete the .aux, .toc, .lof, .lot of the document, else the first L^{A}TEX run with version #31 or higher will produce a lot of errors (the next run should be ok).

2.19 A local table of contents for the set of appendices

Some users need a table of contents for the appendices, but without putting the entries of it into the main table of contents. The solution is to put the appendices in a \part subdivision of the document and ask for a table of contents at the \part level:

     \doparttoc           % after \begin{document}
     . . .
     \appendix
     \part{Appendices}    % create a part level subdivision
     \parttoc             % create a local table of contents

     % To suppress the appendix part in the main toc
     \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
     \chapter{First appendix}
     . . .
     % Add this at the end of appendices if there is something
     % after the appendices (like an index or a bibliography)
     % to put a bound to the contents of \parttoc
     \addtocontents{toc}{\protect\partbegin}

2.20 Use with the appendix package

If you use the appendix package (by Peter R. Wilson), you will observe a serious problem with minitocs in the appendices environment (and after it): they do not match with their appendix. In fact, the environnement opening \begin{appendices} hides a \addcontentsline command for a chapter or a section, putting trouble in the numbering of minitocs or secttocs. Two solutions are available. The first one is to add a \adjustmtc or \adjuststc command (depending if the appendices are at the chapter or section level) after each \begin{appendices} command. The other solution is to add the following commands in the preamble after the loading of the appendix package:

     \let\oldappendices\appendices
     \def\appendices{\oldappendices\adjustmtc}

if appendices are at the chapter level, OR:

     \let\oldappendices\appendices
     \def\appendices{\oldappendices\adjuststc}

if appendices are at the section level.

2.21 Use with the tocloft package

(This answer is given in the documentation of the tocloft package.) The tocloft (by Peter R. Wilson) and minitoc packages have an unfortunate interaction,^{1} which fortunately can be fixed. In the normal course of events, when minitoc is used in a chaptered document it will typeset section entries in the minitocs in bold font. If tocloft is used in conjunction with minitoc, then the minitoc section entries are typeset in the normal font, except for the page numbers which are in bold font, while the ToC section entries are all in normal font.

One cure, if you want the minitoc section entries to be all in normal font is to put:

\renewcommand{\mtcSfont}{\small\normalfont}

in the preamble.

Otherwise, the cure is the following incantation:

\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftsecleader}{\bfseries\cftdotfill{\cftdotsep}}
\renewcommand{\cftsecpagefont}{\bfseries}

To have the section entries in both the ToC and the minitocs in bold then put the incantation in the preamble. To have only the minitoc section entries in bold while the ToC entries are in the normal font, put the incantation between the \tableofcontents command and the first \chapter command.

2.22 Use with the memoir class

The memoir class offers the functionnalities of the tocbibind and tocloft packages, hence it has the same problems; see upper the solutions available.

1Discovered by Lyndon Dudding (lyndon.dudding@totalise.co.uk).