事实证明,停止列出的部分等的最简单方法是在 ppendix 之后插入 ddtocontents{toc}{protectsetcounter{tocdepth}{0}}。
不过,这有点生硬,因为它仍然留下了为附录做一个单独的 TOC 的问题。我已经尝试过 etoc,这只是一部分。
长MWE:
documentclass[paper=a4, fontsize=11pt, titlepage, headinclude, footinclude, numbers=noenddot, cleardoublepage=empty]{scrreprt}
usepackage[eulerchapternumbers, beramono, eulermath, pdfspacing]{classicthesis}
usepackage{blindtext}
usepackage{etoc}
egin{document}
setcounter{secnumdepth}{3} % Number up to subsubsection level.
pagenumbering{roman}
% Short TOC - chapters and sections only.
setcounter{tocdepth}{1} % Set depth to section in the (short) table of contents.
etocsettocstyle{chapter*{Short Contents}}{} % Heading for the short toc.
localtableofcontents
% Long TOC - down to subsubsection.
setcounter{tocdepth}{3} % Set depth to subsubsection in the (long) table of contents.
% ddcontentsline{toc}{chapter}{Long Contents}
etocsettocstyle{chapter*{Long Contents}}{} % Heading for the long toc.
localtableofcontents
pagenumbering{arabic}
setcounter{tocdepth}{2}
etocsettocstyle{section*{Contents of Chapter hechapter}}{
oindent
ule{linewidth}{0.5pt}skip0.5aselineskip} % Chapter TOC
chapter{Chapter One}
localtableofcontents
section{One}
lindtext
subsection{One-One}
lindtext
subsubsection{One-One-One}
lindtext
subsubsection{One-One-Two}
lindtext
subsection{One-Two}
lindtext
subsubsection{One-Two-One}
lindtext
subsubsection{One-Two-Two}
lindtext
section{Two}
lindtext
subsection{Two-One}
lindtext
subsubsection{Two-One-One}
lindtext
subsubsection{Two-One-Two}
lindtext
subsection{Two-Two}
lindtext
subsubsection{Two-Two-One}
lindtext
subsubsection{Two-Two-Two}
lindtext
chapter{Chapter Two}
localtableofcontents
section{One}
lindtext
subsection{One-One}
lindtext
subsubsection{One-One-One}
lindtext
subsubsection{One-One-Two}
lindtext
subsection{One-Two}
lindtext
subsubsection{One-Two-One}
lindtext
subsubsection{One-Two-Two}
lindtext
section{Two}
lindtext
subsection{Two-One}
lindtext
subsubsection{Two-One-One}
lindtext
subsubsection{Two-One-Two}
lindtext
subsection{Two-Two}
lindtext
subsubsection{Two-Two-One}
lindtext
subsubsection{Two-Two-Two}
lindtext
ppendix
ddtocontents{toc}{protectsetcounter{tocdepth}{0}} % Set the display depth for the TOC to chapter only.
% List of appendices.
etocsettocstyle{skip0.3aselineskipchapter*{Appendices}}{} % Heading for the list of appendices.
localtableofcontents
chapter{Appendix A}
section{One}
lindtext
subsection{One-One}
lindtext
subsubsection{One-One-One}
lindtext
subsubsection{One-One-Two}
lindtext
subsection{One-Two}
lindtext
subsubsection{One-Two-One}
lindtext
subsubsection{One-Two-Two}
lindtext
section{Two}
lindtext
subsection{Two-One}
lindtext
subsubsection{Two-One-One}
lindtext
subsubsection{Two-One-Two}
lindtext
subsection{Two-Two}
lindtext
subsubsection{Two-Two-One}
lindtext
subsubsection{Two-Two-Two}
lindtext
end{document}
这允许额外的目录(我这里有一个短的和一个长的),以及每章的部分目录。
然而,仍然有一些皱纹。
(1)页码错误。长目录的第一页有一个罗马数字,这意味着正文从 p2 而不是 p1 开始。
(2) 附录的目录为空。这很奇怪,因为在我的“真实”文档中,它有一行用于附录 A,并且使用了完全相同的命令。
(3) tocdepth 在附录之前设置为 0 的事实大概意味着节等数据未记录到目录文件中,这意味着 etoc 因此无法访问附录的节数据。无论如何,每个附录的部分 TOC 是不可能的。
所以,更进一步,但仍然存在一些问题,这意味着它并不是一个真正可靠的解决方案。