Skip to content

Commit e02b26a

Browse files
authored
Merge pull request doxygen#11971 from albert-github/feature/bug_docu_latex_toc
More readable table of contents in doxygen's LaTeX documentation.
2 parents f6aa434 + d79e4eb commit e02b26a

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

doc/doxygen_manual.tex

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}
104104
\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left }
105105
\makeindex
106-
\setcounter{tocdepth}{3}
107106
\renewcommand{\footrulewidth}{0.4pt}
108107
\renewcommand{\familydefault}{\sfdefault}
109108
\renewcommand{\cftsecindent}{0 em}
@@ -131,6 +130,11 @@
131130
\etocsetlevel{subsubsubsubsubsubsection}{7}
132131
\etocsetlevel{paragraph}{8}
133132
\etocsetlevel{subparagraph}{9}
133+
\newcommand{\AppendixChapter}[1]%
134+
{%
135+
\chapter{#1}%
136+
\localtableofcontentswithrelativedepth{+3}%
137+
}
134138
\begin{document}
135139
\raggedbottom
136140
\pagenumbering{alph}
@@ -148,6 +152,7 @@ \chapter*{Contents}
148152
\tableofcontents
149153
\clearemptydoublepage
150154
\pagenumbering{arabic}
155+
\setcounter{tocdepth}{3}
151156
\part{User Manual}
152157
\input{index}
153158
\input{install}
@@ -185,25 +190,27 @@ \part{Developers Manual}
185190
\input{arch}
186191
\renewcommand{\thepart}{}
187192
\renewcommand{\partname}{}
193+
\setcounter{tocdepth}{0}
194+
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
188195
\part{Appendices}
189196
\appendix
190197
%mean that subinputfrom requires a / at the end of the path
191-
\chapter{Autolink Example}\label{autolink_example}\hypertarget{autolink_example}{}
198+
\AppendixChapter{Autolink Example}\label{autolink_example}\hypertarget{autolink_example}{}
192199
\subinputfrom{examples/autolink/latex/}{refman_doc}
193-
\chapter{Resolving Typedef Example}\label{restypedef_example}\hypertarget{restypedef_example}{}
200+
\AppendixChapter{Resolving Typedef Example}\label{restypedef_example}\hypertarget{restypedef_example}{}
194201
\subinputfrom{examples/restypedef/latex/}{refman_doc}
195202

196203
\IfFileExists{examples/diagrams/latex/refman_doc.tex}
197204
{
198-
\chapter{Diagrams Example}\label{diagrams_example}\hypertarget{diagrams_example}{}
205+
\AppendixChapter{Diagrams Example}\label{diagrams_example}\hypertarget{diagrams_example}{}
199206
\subinputfrom{examples/diagrams/latex/}{refman_doc}
200207
}{}
201208

202-
\chapter{Grouping Example}\label{modules_example}\hypertarget{grouping_example}{}
209+
\AppendixChapter{Grouping Example}\label{modules_example}\hypertarget{grouping_example}{}
203210
\subinputfrom{examples/group/latex/}{refman_doc}
204-
\chapter{Member Groups Example}\label{memgrp_example}\hypertarget{memgrp_example}{}
211+
\AppendixChapter{Member Groups Example}\label{memgrp_example}\hypertarget{memgrp_example}{}
205212
\subinputfrom{examples/memgrp/latex/}{refman_doc}
206-
\chapter{Style Examples}
213+
\AppendixChapter{Style Examples}
207214
\doxysection{After Block Example}\label{afterdoc_example}\hypertarget{afterdoc_example}{}
208215
\begin{DoxygenSubAppendix}
209216
\subinputfrom{examples/afterdoc/latex/}{refman_doc}
@@ -220,9 +227,9 @@ \chapter{Style Examples}
220227
\begin{DoxygenSubAppendix}
221228
\subinputfrom{examples/javadoc-banner/latex/}{refman_doc}
222229
\end{DoxygenSubAppendix}
223-
\chapter{Structural Commands Example}\label{structcmd_example}\hypertarget{structcmd_example}{}
230+
\AppendixChapter{Structural Commands Example}\label{structcmd_example}\hypertarget{structcmd_example}{}
224231
\subinputfrom{examples/structcmd/latex/}{refman_doc}
225-
\chapter{Language Examples}
232+
\AppendixChapter{Language Examples}
226233
\doxysection{Python Docstring Example}\label{python_example}\hypertarget{python_example}{}
227234
\begin{DoxygenSubAppendix}
228235
\subinputfrom{examples/docstring/latex/}{refman_doc}
@@ -236,31 +243,31 @@ \chapter{Language Examples}
236243
\subinputfrom{examples/mux/latex/}{refman_doc}
237244
\end{DoxygenSubAppendix}
238245

239-
\chapter{Class Example}\label{class_example}\hypertarget{class_example}{}
246+
\AppendixChapter{Class Example}\label{class_example}\hypertarget{class_example}{}
240247
\subinputfrom{examples/class/latex/}{refman_doc}
241-
\chapter{Define Example}\label{define_example}\hypertarget{define_example}{}
248+
\AppendixChapter{Define Example}\label{define_example}\hypertarget{define_example}{}
242249
\subinputfrom{examples/define/latex/}{refman_doc}
243-
\chapter{Enum Example}\label{enum_example}\hypertarget{enum_example}{}
250+
\AppendixChapter{Enum Example}\label{enum_example}\hypertarget{enum_example}{}
244251
\subinputfrom{examples/enum/latex/}{refman_doc}
245-
\chapter{Example Example}\label{example_example}\hypertarget{example_example}{}
252+
\AppendixChapter{Example Example}\label{example_example}\hypertarget{example_example}{}
246253
\subinputfrom{examples/example/latex/}{refman_doc}
247-
\chapter{Extends/Implements Example}\label{extends_example}\hypertarget{extends_example}{}
254+
\AppendixChapter{Extends/Implements Example}\label{extends_example}\hypertarget{extends_example}{}
248255
\subinputfrom{examples/manual/latex/}{refman_doc}
249-
\chapter{File Example}\label{file_example}\hypertarget{file_example}{}
256+
\AppendixChapter{File Example}\label{file_example}\hypertarget{file_example}{}
250257
\subinputfrom{examples/file/latex/}{refman_doc}
251-
\chapter{Fn Example}\label{fn_example}\hypertarget{fn_example}{}
258+
\AppendixChapter{Fn Example}\label{fn_example}\hypertarget{fn_example}{}
252259
\subinputfrom{examples/func/latex/}{refman_doc}
253-
\chapter{Overload Example}\label{overload_example}\hypertarget{overload_example}{}
260+
\AppendixChapter{Overload Example}\label{overload_example}\hypertarget{overload_example}{}
254261
\subinputfrom{examples/overload/latex/}{refman_doc}
255-
\chapter{Page Example}\label{page_example}\hypertarget{page_example}{}
262+
\AppendixChapter{Page Example}\label{page_example}\hypertarget{page_example}{}
256263
\subinputfrom{examples/page/latex/}{refman_doc}
257-
\chapter{Relates Example}\label{relates_example}\hypertarget{relates_example}{}
264+
\AppendixChapter{Relates Example}\label{relates_example}\hypertarget{relates_example}{}
258265
\subinputfrom{examples/relates/latex/}{refman_doc}
259-
\chapter{Author Example}\label{author_example}\hypertarget{author_example}{}
266+
\AppendixChapter{Author Example}\label{author_example}\hypertarget{author_example}{}
260267
\subinputfrom{examples/author/latex/}{refman_doc}
261-
\chapter{Par Example}\label{par_example}\hypertarget{par_example}{}
268+
\AppendixChapter{Par Example}\label{par_example}\hypertarget{par_example}{}
262269
\subinputfrom{examples/par/latex/}{refman_doc}
263-
\chapter{Include Example}\label{include_example}\hypertarget{include_example}{}
270+
\AppendixChapter{Include Example}\label{include_example}\hypertarget{include_example}{}
264271
\subinputfrom{examples/include/latex/}{refman_doc}
265272

266273

0 commit comments

Comments
 (0)