summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/aeb-minitoc/examples/manual-exmpls-default.tex
blob: 1a9d08ca9f66be164e1d61938e4e036d2a16740d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
\documentclass{article}
\usepackage[linktocpage,colorlinks,bookmarksnumbered]{hyperref}
\usepackage{booktabs}
\usepackage[!nominitocs]{aeb-minitoc}
\usepackage{ifthen}

\let\db\mtocgobble

% Same as manual-exmpls, but with numbers at all levels. Numerous adjustments
% to the mini-toc entries were necessary.

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\makeatletter
\def\cs#1{\texttt{\@backslashchar#1}}
\makeatother

\title{Examples from the aeb-minitoc manual}
\author{D. P. Story}

\begin{minitocfmt}{\minitocFmt}
\declaretocfmt{subsection}{\@W{1.5em}\@D{0em}}
\declaretocfmt{subsubsection}{\@W{2.5em}\@D{1.5em}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmti}
\@A{\def\@linkcolor{blue}\@PW{1.5em}}%
\declaretocfmt{subsection}{\@W{1.5em}\@D{0em}}
\declaretocfmt{subsubsection}{\@W{2.5em}\@D{1.5em}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmtii}
\declaretocfmt{subsection}{\@W{1.7em}\@D{0em}\@N{\textbf}}
\declaretocfmt{subsubsection}{\@W{2.5em}\@D{1.7em}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmtvii}
\declaretocfmt{subsection}{\@W{1.7em}\@D{0em}\@F{\bfseries}}
\declaretocfmt{subsubsection}{\@W{2.5em}\@D{1.7em}\@F{\color{blue}}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmtiv}
\@A{\FmtTOCEntry}
\declaretocfmt{subsection}{\@W{1.5em}\@D{0em}}
\declaretocfmt{subsubsection}{\@W{2.5em}\@D{1.5em}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmtv}
\declaretocfmt{paragraph}{\@W{3.3em}\@D{0em}}
\declaretocfmt{subparagraph}{\@W{4em}\@D{3.3em}}
\end{minitocfmt}

\begin{minitocfmt}{\minitocFmtvi}
\@A{\@PW{1em}}
\declaretocfmt{subsection}{\@W{2em}\@D{0em}}
\declaretocfmt{subsubsection}{\@W{2.3em}
  \@R{1.55em plus 2em}\leftskip2em\relax
  \rightskip\@tocrmarg\relax{#1},\nobreak{ #2}\enspace\allowbreak}
\end{minitocfmt}

\newcommand{\insMinitoc}[2][]{%
  \begin{center}#2
  \begin{minipage}[c]{0.8\linewidth}
  \insertminitoc[#1]
  \end{minipage}
  \end{center}
}

\newcommand{\insMinitoci}[2][]{%
  \begin{center}#2
  \begin{minipage}[c]{0.8\linewidth}
  Contents of Section~\ref*{CandM}: \nameref*{CandM}
  \par\kern2pt
  \insertminitoc[#1]
  \end{minipage}
  \end{center}
}

\newcommand{\insMinitoctab}[2][]{%
  \begin{center}#2
  \begin{tabular}{c}\toprule
  \begin{minipage}[c]{0.8\linewidth}
  \insertminitoc[#1]
  \end{minipage}\\ \bottomrule
  \end{tabular}
  \end{center}
}

\newcommand{\insMinitocfbox}[2][]{%
  \begin{center}#2
  \fbox{\begin{minipage}[c]{0.8\linewidth}
  \insertminitoc[#1]
  \end{minipage}}
  \end{center}
}



\begin{document}

\maketitle

\bgroup
\value{secnumdepth}=3
\value{tocdepth}=3
\tableofcontents
\egroup

\newpage

\section{Introduction}

Content removed

\section{Required packages and options}

Content removed

\section{Commands and methods}\mtoclabel{CandM}

\insMinitoci{\minitocFmt}

\subsection[\protect\miniorfulltoc{\protect\textbf}{Setting the top and bottom levels}]{Setting the top and bottom levels}

Content removed

\subsubsection{Automatically setting the levels}

Content removed

\subsubsection{Manually setting the levels}

Content removed

\subsection{The \texorpdfstring{\protect\cs{insertminitoc}}{\textbackslash{insertminitoc}} command}\mtoclabel{insertminitoc}

Content removed

\subsubsection{The \texttt{minitocfmt} environment}

Content removed

\subsubsection{Some examples that illuminate}\mtoclabel{SExmpls}

Content removed

\goodbreak

\paragraph{Some basic examples} \leavevmode

\subparagraph{First Example}  \leavevmode

\insMinitoc[CandM]\minitocFmt

\subparagraph{The TOC listing on page~\pageref*{SExmpls}} \leavevmode

\insMinitoc[SExmpls]{\TOCLevels{subsubsection}{subparagraph}\minitocFmtv}

\subparagraph{Color the page numbers} \leavevmode

\insMinitoc[CandM]\minitocFmti

\subparagraph{Make section numbers bold} \leavevmode

\insMinitoc[CandM]\minitocFmtii

\subparagraph{Make section headings some bold, some blue} \leavevmode

\insMinitoc[CandM]\minitocFmtvii

\paragraph{Some more advanced examples} \leavevmode

\subparagraph{Formatting sections with no section number} \leavevmode

\begin{minitocfmt}{\minitocFmtstar}
\declaretocfmt{subsection*}{\@W{0em}\@D{0em}}
\end{minitocfmt}
\insMinitoctab[myRetirement]{\TOCLevels{section}{subsection}\minitocFmtstar}

\subparagraph{Formatting individual title headings} \leavevmode

\insMinitoc[CandM]\minitocFmtiv


\subparagraph{A custom entry for \protect\cs{subsubsection}} \leavevmode

\insMinitoc[CandM]\minitocFmtvi

\subparagraph{Using \texorpdfstring{\protect\cs{@E}}{\textbackslash{@E}} for greater formatting control} \leavevmode

\begin{minitocfmt}{\minitocFmtF}
\declaretocfmt{subsection}
  {\@W{2em}\@D{0em}
   \ifthenelse{\@E=\mtocref{insertminitoc}}{\@F{\bfseries}}{}}
\declaretocfmt{subsubsection}
  {\@W{2.5em}\@D{2em}
   \ifthenelse{\@E > \mtocref{insertminitoc}\and\@E < \mtocref{MPW}}
   {\@F{\color{blue}}}{}}
\end{minitocfmt}
\insMinitoc[CandM]{\TOCLevels{section}{subsubsection}\minitocFmtF}

\subparagraph{No leaders using \texorpdfstring{\protect\cs{@B}}{\textbackslash{@B}}} \leavevmode

\begin{minitocfmt}{\minitocFmtB}
\declaretocfmt{subsection}
  {\vspace{6pt}\@W{2em}\@B{0em}\@F{\bfseries}\@N{\bfseries}\@P{\bfseries}}
\declaretocfmt{subsubsection}
  {\@W{2.5em}\@D{2em}}
\end{minitocfmt}

\insMinitoc[CandM]\minitocFmtB

\subparagraph{Using the
  \texorpdfstring{\protect\cs{@L} and \protect\cs{@Pg}}{\textbackslash{@L}
    and \textbackslash{@Pg}} commands} \leavevmode

\begin{minitocfmt}{\minitocFmtPara} % Para
\@A{\@PW{2.5em}\@R{7em}}
\declaretocfmt{paragraph}
  {%
    \@W{3.2em}\@D{0em}
    \ifthenelse{\arabic{page}=\@Pg}
      {\@P{\small\hyperlink{\@L}{this page}\mtocgobble}}
      {}
  }
\declaretocfmt{subparagraph}
  {%
    \@W{4.1em}\@D{3.2em}
    \ifthenelse{\arabic{page}=\@Pg}
      {\@P{\small\hyperlink{\@L}{this page}\mtocgobble}}
      {}
  }
\end{minitocfmt}

\hfuzz12pt
\insMinitoc[SExmpls]{\TOCLevels{subsubsection}{subparagraph}\minitocFmtPara}

\paragraph{Using \texorpdfstring{\texttt{minitocfmt} with \protect\cs{tableofcontents}}
  {minitocfmt with \textbackslash{tableofcontents}}}\leavevmode

\subsubsection{Alternate presentations of the mini-toc}

Content removed

\paragraph{Predefined presentations} \leavevmode

Defined in preamble

\subparagraph{Enclose the mini-toc in an \texorpdfstring{\protect\cs{fbox}}{\textbackslash{fbox}}} \leavevmode

\insMinitocfbox[CandM]{\TOCLevels{section}{subsubsection}\minitocFmt}

\subparagraph{Enclose the mini-toc in a ruled tabular environment} \leavevmode

\insMinitoctab[CandM]{\minitocFmt}


\section{Methodology}\mtoclabel{MPW}

Content removed

\section{My retirement}\mtoclabel{myRetirement}

\subsection*{Time to get back to it, dps}
\addcontentsline{toc}{subsection}{Time to get back to it, dps}

\end{document}