Chapter 1
The minitoc package
Contents
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . 2
1.2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Fonts and Titles . . . . . . . . . . . . . . . . . . . 7
1.2.2 Special Features . . . . . . . . . . . . . . . . . . . 9
Horizontal Rules . . . . . . . . . . . . . . . . . . . 9
Page Numbers, Leaders . . . . . . . . . . . . . . . 10
The “Chapter 0” Problem . . . . . . . . . . . . . . 10
1.2.3 Usage with MS-DOS . . . . . . . . . . . . . . . . . 11
1.3 The mtcoff package . . . . . . . . . . . . . . . . . 11
Tables
1.1 Commands for a minitoc . . . . . . . . . . . . . . . . . . 4
1.2 Commands for a secttoc . . . . . . . . . . . . . . . . . . 5
1.3 Commands for a parttoc . . . . . . . . . . . . . . . . . . 6
1.4 Available languages . . . . . . . . . . . . . . . . . . . . . . 13
1
2 CHAPTER 1. THE MINITOC PACKAGE
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 begin-
ning of each chapter of the 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 (styles like book or report) or sections
(styles like article). Thus, this package should not be used with document
classes without sectioning 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 the 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 ta-
ble of contents in the same document. This restriction is intented to avoid
documents full of local tables of contents, list of figures and tables at every
sectionning level.
The current version of this package is #30.
Note: the commands relative to the part level are defined only if the doc-
ument class defines \part. The commands relative to the section level are
defined only if the document class does not define \chapter.
Licence
It may be distributed and/or modified under the conditions of the LaTeX
Project Public License, either version 1.1 of this license or (at your option)
any later version. The latest version of this license is in
http://www.latex-project.org/lppl.txt
1
The minitoc package introduces its own jargon, explained in this note. It should not
be too difficult, however, to learn and use.
1.2. USAGE 3
and version 1.1 or later is part of all distributions of LaTeX version 1999/06/01
or later.
But please don’t bother me about hacked versions.
1.2 Usage
To use the minitoc package, you must introduce a command
\usepackage{minitoc}
in the preamble of your document. The mini-table of contents will appear
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 For each mini-table of contents, an auxiliary file
will be created with a name of the form hdocumenti.mtchN i, where hN i is
the absolute chapter number. “Absolute” means that this number is unique,
and increasing from the first chapter. The suffix is .mlfhN i for mini-lists of
figures and is .mlthN i for mini-lists of tables. (If you are under MS-DOS
or any operating system with short extensions to filenames, see Section 1.2.3
and Chapter 2, item 5).
The section-level table of contents will appear 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, eventually after some 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 For each section-level table of contents, an auxiliary file
will be created with a name of the form hdocumenti.stchN i, where hN i is
the absolute section number. The suffix is .slfhN i for section-level lists
of figures and is .slthN i for section-level lists of tables. (If you are under
MS-DOS or any operating system with short extensions to filenames, see
Section 1.2.3 and Chapter 2, item 5).
4 CHAPTER 1. THE MINITOC PACKAGE
Table 1.1: Commands for a minitoc
\documentclass[...]{book}
\usepackage{minitoc}
...
\setcounter{minitocdepth}{2} default
\setlength{\mtcindent}{24pt} 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
\minilof if you want one
\minilot if you want one
...
If you want to add the partial table of contents for a part, you must
use the sequence given in Table 1.3. For each partial table of contents, an
auxiliary file will be created with a name of the form hdocumenti.ptchN i,
where hN i is the part number. The suffix is .plfhN i for partial lists of
figures and is .plthN i for partial lists of tables. (If you are under MS-DOS
or any operating system with short extensions to filenames, see Section 1.2.3
and Chapter 2, item 5).
Note: the user is responsible of requiring or not requiring a mini-toc (lof
or lot) for some chapter. Asking a minilof for a chapter without any figure
will 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
1.2. USAGE 5
Table 1.2: Commands for a secttoc
\documentclass[...]{article}
\usepackage{minitoc}
...
\setcounter{\secttocdepth}{2} default
\setlength{\stcindent}{24pt} default
\renewcommand{\stcfont}{\small\rm} default
\renewcommand{\stcSSfont}{\small\bf} default
...
\begin{document}
...
\dosecttoc
\dosectlof
\dosectlot
\tableofcontents or \faketableofcontents
\listoffigures or \fakelistoffigures
\listoftables or \fakelistoftables
...
\chapter{...}
\secttoc if you want one
\sectlof if you want one
\sectlot if you want one
...
will 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).
By default, the mini-tables and partial tables of contents contain only ref-
erences to sections and subsections. The minitocdepth and parttocdepth
counters, similar to tocdepth, allows the user to modify this behaviour.
Mini or partial lists of figures or tables are not affected by the value of these
counters.
NOTE: if you are using \chapter* and a
\addcontentsline{toc}{chapter}{...}
6 CHAPTER 1. THE MINITOC PACKAGE
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
...
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
1.2. USAGE 7
\addcontentsline{toc}{section}{...}
by 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}
1.2.1 Fonts and Titles
The mini and partial tables and lists are typeset in a verse-like environ-
ment, and can be split over pages. The mini-table of contents is type-
set in the \mtcfont font, which is \small\rm by default. Section entries
are typeset in the \mtcSfont font, which is \small\bf by default. For
subsections, subsubsections, paragraphs and subparagraphs, the commands
\mtcSSfont, \mtcSSSfont, \mtcPfont and \mtcSPfont are available (by de-
fault, \small\rm) to enable the use of various fonts. Mini lists of figures and
tables are typeset in the fonts \mlffont and \mltfont, which are \small\rm
by default.
Titles are typeset in the \mtifont (\large\bf by default) font and the
texts 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 english.mld 2 (and
others 3 ) are available. You can easily prepare a similar file for your preferred
language.
The partial table of contents is typeset in the \ptcfont font, which is
defined as \normalsize\rm by default. Chapter entries are typeset in the
2
The suffix .mld means “minitoc language definition (file)”.
3
Most of the strings defined in these language option files were taken from the superb
Babel system by Johannes Braams and some were adapted, others were offered by gentle
users or taken from specific packages, like ArabTEX or vietnam.sty. Other languages are
welcome.
8 CHAPTER 1. THE MINITOC PACKAGE
\ptcCfont font, which is \normalsize\bf by default. Section entries are
typeset in the \ptcSfont font, which is \normalsize\rm by default. For
subsections, subsubsections, paragraphs and subparagraphs, the commands
\ptcSSfont, \ptcSSSfont, \ptcPfont and \ptcSPfont are available (by
default, \normalsize\rm) if you want to use various fonts. Partial lists of
figures and tables are typeset in the fonts \mlffont and \mltfont, which
are \normalsize\rm by default.
Titles are typeset in the \ptifont (\Huge\bf by default) font and the
texts 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 3 above) are available. You
can easily prepare a similar style for your preferred language.
The section-level table of contents is typeset in the \stcfont font, which
is defined as \normalsize\rm by default. Subsection entries are typeset
in the \stcSSfont font, which is \normalsize\bf by default. Subsubsec-
tion entries are typeset in the \stcSSSfont font, which is \normalsize\rm
by default. For subsubsections, paragraphs and subparagraphs, the com-
mands \stcSSSfont, \stcPfont and \stcSPfont are available (by default,
\normalsize\rm) 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\rm by default.
Titles are typeset in the \stifont (\normalsize\bf by default) font and
the texts 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 3 above) are available. You can easily prepare a
similar style for your preferred language.
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.
1.2. USAGE 9
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.
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.
With the commands \tightmtctrue (or the tight package option) and
\tightmtcfalse (or the loose package option, which is te default), the
minitocs (minilofs, etc.) will have less (tight) or more (loose) space between
contents lines.
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).
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 LATEX run, the mini-tables and lists,
partial tables and lists and section-level tables and lists will be empty; after
the second run, they appear, but because they modify the page numbering,
page numbers are wrong; after the third LATEX run, the mini, partial and
section-level tables and lists should be correct.
1.2.2 Special Features
Horizontal Rules
By default, most of minitocs and siblings have horizontal rules after their
titles and at their ends. The exception is the “partoc” in a book- or report-
10 CHAPTER 1. THE MINITOC PACKAGE
like document (i.e. when \chapter is defined). To activate or desactivate
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
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 option is the default.
The “Chapter 0” Problem
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
1.3. THE MTCOFF PACKAGE 11
\firstchapteris{hN i}
before the \dominitoc and analogous commands. hN i is the number of your
first chapter. This command does not modify the numbering of chapters,
you must use a \addtocounter{chapter}{-1} command to get a first chap-
ter 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 give a harmless warning.
1.2.3 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 .mtchN i suffix will become
.MhN i, where hN i is the absolute chapter number. The suffixes .mlfhN i and
.mlthN i become .FhN i and .ThN i. The .ptchN i suffix will become .PhN i,
where hN i is the part number. The suffixes .plfhN i and .plthN i become
.GhN i and .UhN i. The .stchN i suffix will become .ShN i, where hN i is the
absolute section number. The suffixes .slfhN i and .slthN i become .HhN i
and .VhN i. 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 Chapter 2,
item 5).
1.3 The mtcoff package
When a document has been prepared with the minitoc package, it con-
tains 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 have just to replace the minitoc package by the mtcoff pack-
age, and all these commands will be ignored. At least two LATEX runs will
be necessary to get a correct page numbering and correct cross references.
12 CHAPTER 1. THE MINITOC PACKAGE
It also purges the .aux, .toc, .lof, and .lot files from minitoc specific
spurious commands.
1.3. THE MTCOFF PACKAGE 13
Table 1.4: Available languages
1. afrikaan 17. estonian 34. polish
(afrikaans)
18. ethiopia 35. portuges
a (ethiopian)
2. arab (arabic)
36. romanian
3. armenian 19. finnish
37. russian b
4. bahasa 20. french (francais)
38. russianb
5. basque 21. galician
39. russianc
6. bicig 22. german (austrian)
40. scottish
7. brazil 23. germanb
41. serbian
8. breton 24. greek
42. slovak
9. buryat 25. irish
43. slovene
10. catalan 26. italian
27. lithuanian 44. spanish
11. croatian
28. lsorbian 45. swedish
12. czech
29. magyar 46. turkish
13. danish
(hungarian)
47. ukraineb
14. dutch
30. mongol
48. usorbian
15. english 31. ngerman
(american) 49. vietnam
32. norsk (vietnamese)
16. esperant
(esperanto) 33. nynorsk 50. welsh
a
The arab(ic) language requires the use of ArabTEX.
b
The russian language is not yet supported, but russianb is supported if you use
babel-3.6; russianc is an extra.
14 CHAPTER 1. THE MINITOC PACKAGE
Chapter 2
Frequently Asked Questions
Here is a list of problems and frequently asked questions about minitoc.sty.
If your version has a number less than 30, please upgrade to version #30.
1. How 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. How about implementing others layouts for the minitoc? Suggestions
are welcome.
3. \\ in a contents line makes an error.
Use \protect\linebreak.
4. If you reorder chapters, havoc follows. . . minitocs going in wrong chap-
ters.
The best way seems to make one run with the mtcoff package replacing
the minitoc package, then restore the minitoc package and re-execute
LATEX three times (yes, it is time consuming. . . ). Running with the
mtcoff package ensures that auxiliary are cleared from “spurious” com-
mands introduced by minitoc.
5. This package creates auxiliary files with extensions like .mtchN i. Some
operating systems allow only 3 letters extensions. What to do?
No modification is needed: all is automatic since version #28! If you
insist to use 3 characters extensions, even on operating systems allow-
ing more, just use the package option shortext. Then you will get first
15
16 CHAPTER 2. FREQUENTLY ASKED QUESTIONS
the auto-configuration messages, then a message saying that you will
however use short extensions.
6. Do not cheat with the “chapter” counter, i.e. do not write horrible
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.
7. Some demanding users want to have minilof, minilot and minibbl.
First, minibbl is an other problem, strongly related to the BibTEX’s
dealing with .aux files. Look at chapterbib.sty, bibunits.sty,
multibib.sty, ans bibtopic. Version #13 has implemented basic
minilofs and minilots. Minibbls are not the aim of this package.
8. This package creates a lot of auxiliary files and some users argue 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, and it would be
read for each \miniXXX macro!
9. How to do minitocs (minilofs and minilots) at levels other than chap-
ter? Here also, some redesign is 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
style 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 ∗ ∗
10. Since version #23, works with document classes resetting chapter (or
section) number at each part.