Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/doc/latex/minitoc/minitoc-ex.tex

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


%%%%%%%%%%%%%%%%%%%%% A example file (differs from previous versions)
% minitoc-ex.tex
% This file contains a set of tests for the minitoc.sty version #27
% style option file. You can alter most of parameters to test.
% book/report (\chapter must be defined)
\documentclass[12pt,a4paper]{book}
\usepackage{minitoc}
\setcounter{secnumdepth}{5}   % depth of numbering of sectionning commands
\setcounter{tocdepth}{3}           % depth of table of contents
\setlength{\mtcindent}{24pt}       % indentation of minitocs, default
\renewcommand{\mtcfont}{\small\rm} % font for minitocs, default
\renewcommand{\mtcSfont}{\small\bf} % font for minitocs, sections, default
%\renewcommand{\mtcSSfont}{\small\sf} % font for minitocs, subsections
% you can make experiments with \mtcSSSfont, \mtcPfont and \mtcSPfont
% but it is ``fontomania''...
\raggedbottom                   % or \flushbottom, at your choice
%\parskip=12pt                  % a bug about \parskip has been fixed
%%% TEST: uncomment the 3 next lines to test
%%% resetting chapter number in each part
%\makeatletter
%\@addtoreset{chapter}{part}
%\makeatother
%%% END TEST
\begin{document}
\dominitoc
\dominilof[c]                   % center title of minilof's
\dominilot
\doparttoc                      % test of parttoc/partlof stuff
\dopartlof                      % added in version #15
\dopartlot                      % added in version #15
\faketableofcontents            % or \tableofcontents
\fakelistoffigures              % to check compatibility
\fakelistoftables
%\addtocounter{chapter}{-1} % to begin with Chapter 0
\part{First Part}
\parttoc
\partlof[r]
\partlot[r]
\twocolumn                      % the minitoc in twocolumn layout is ugly,
                                % but works. Ideas to make it better?
\chapter{AAAAA}                 % a chapter with a lot of sections
\minitoc[r]                     % minitoc title on the right
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S2}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S3}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S4}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S5}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S6}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S7}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S8}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S9}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S10}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S11}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S12}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S13}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S14}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S15}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S16}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S17}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S18}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S19}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S20}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S21}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S22}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S23}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S24}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S26}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S27}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S28}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S29}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{S30}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\onecolumn                              % back to one column
\chapter{BBBBB}
\minitoc
\bigskip                                % put some skip here
\minilof                                % a minilof
\bigskip                                % put some skip here
\minilot                                % a minilot
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{T1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\begin{figure}[t]        % tests compatibility with floating bodies
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption{F1}             % (I have not tested tables, but it is similar)
\end{figure}
\begin{table}[b]        % tests compatibility with floating bodies
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption{T1}             % (I have not tested tables, but it is similar)
\end{table}
\clearpage
\subsection[tt1]{TT1}    % tests optionnal arg. of a sectionning command
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsubsection{TTT1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\paragraph{TTTT1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\begin{figure}
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption[f2]{F2}         % tests optionnal arg. of a caption
\end{figure}
\section{T2}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\chapter*{CCCCC}         % tests a pseudo-chapter. should have no minitoc
\addcontentsline{toc}{starchapter}{CCCCC}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section*{U1}
\addcontentsline{toc}{starsection}{U1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsection*{UU1}
\addcontentsline{toc}{starsubsection}{UU1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsubsection*{UUU1}
\addcontentsline{toc}{starsubsubsection}{UUU1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\paragraph*{UUUU1}
\addcontentsline{toc}{starparagraph}{UUUU1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section*{U2}
\addcontentsline{toc}{starsection}{U2}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\part{Second Part}
\parttoc
\partlof[c]
%                        % the following chapter should have no minitoc,
\chapter{DDDDD}          % but if you uncomment \minitoc,
%\minitoc
                         % the minitoc appears
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{V1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsection{VV1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsubsection{VVV1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\paragraph{VVVV1}
bla bla bla bla bla bla bla bla bla bla bla
\begin{figure}[t]        % tests compatibility with floating bodies
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption{F3}             % (I have not tested tables, but it is similar)
\end{figure}
bla bla bla bla bla bla bla bla bla bla bla
\section{V2}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\chapter{EEEEE}                 % this chapter should have a minitoc
{%                              % left brace, see below
\setcounter{minitocdepth}{3}    % depth of mini table of contents;
                                % try with different values.
\minitoc
}                               % right brace
% this pair of braces is used to keep local the change
% on minitocdepth.
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{W1}                    % with the given depth
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsection{WW1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subsubsection{WWW1}
bla bla bla bla bla bla bla bla bla bla bla
\begin{figure}[t]        % tests compatibility with floating bodies
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption{F4}             % (I have not tested tables, but it is similar)
\end{figure}
bla bla bla bla bla bla bla bla bla bla bla
\paragraph{WWWW1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\subparagraph{WWWWW1}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\section{W2}
bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla
\appendix
\chapter{Comments}
\minitoc
\section{C1}
\section{C2}
\section{C3}
\begin{figure}[t]        % tests compatibility with floating bodies
\setlength{\unitlength}{1mm}
\begin{picture}(100,50)
\end{picture}
\caption{F5}             % (I have not tested tables, but it is similar)
\end{figure}
\section{C4}
\chapter{Evolution}
\minitoc
\section{D1}
\section{D2}
\section{D3}
\section{D4}
\end{document}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.