【问题标题】:Split TOC in classicthesis在经典论文中拆分目录
【发布时间】:2023-02-01 02:06:15
【问题描述】:

我试图找到一种方法来拆分 classicthesis 中的目录,这样我就不会在主目录中出现附录的内容(只是它们的标题),而是在附录之前的单独目录中。这是一个 MWE:

\documentclass[paper=a4, fontsize=11pt, titlepage, headinclude, footinclude, numbers=noenddot, cleardoublepage=empty]{scrreprt}
\usepackage[eulerchapternumbers, beramono, eulermath, pdfspacing]{classicthesis}
\usepackage{blindtext}

\begin{document}

%TOC (as coded in classicthesis download)
\pagestyle{scrheadings}
%\phantomsection
\pdfbookmark[1]{\contentsname}{tableofcontents}
% Set the numbering level to be shown: part=-1, chapter=0, section=1, subsection=2, subsubsection=3, paragraph=4, subparagraph=5.
\setcounter{tocdepth}{2} % <-- 2 = up to subsections in the ToC
% \setcounter{secnumdepth}{3} % <-- 3 = numbers up to subsubsections in the text
\manualmark
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\tableofcontents
\automark[section]{chapter}
\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\textsc{\thesection}\enspace\spacedlowsmallcaps{#1}}}

\part{Main Text}
\blinddocument

\part{Appendices}
\appendix
\blinddocument

\end{document}

如您所见,在 TOC 页面上,附录 A 获得了完整列表(我更喜欢 \setcounter{tocdepth}{0}),而且我看不出有任何方法可以在附录之前重复另一个 TOC(使用 \设置计数器{tocdepth}{2})。

我已经通过组合 tocloft 和 titletoc 对其他文档完成了此操作,但 classicthesis 没有使用后者(我认为)。

【问题讨论】:

    标签: latex tableofcontents


    【解决方案1】:

    事实证明,停止列出的部分等的最简单方法是在 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 是不可能的。

    所以,更进一步,但仍然存在一些问题,这意味着它并不是一个真正可靠的解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-30
      相关资源
      最近更新 更多