【问题标题】:Multiple tables of contents in LaTeXLaTeX 中的多个目录
【发布时间】:2010-10-23 08:30:11
【问题描述】:

我想制作一个包含两个目录的 LaTeX 文档,例如:

内容概览

  • 1 - 简介
  • 2 - 解决方案

详细内容

  • 1 - 简介
    • 1.1 - 问题
    • 1.2 - 为什么?
  • 2 - 解决方案
    • 2.1 - A 阶段
    • 2.2 - B 阶段

我试过了

\setcounter{tocdepth}{1}
\tableofcontents

\setcounter{tocdepth}{2}
\tableofcontents

但这只会根据需要显示第一个目录。第二个目录是空的... (即使没有两个\setcounter 行,第二个目录实际上也是空的。)

(一个相关的问题:如何更改目录的标题(与默认目录不同的内容)?)

【问题讨论】:

    标签: latex tableofcontents


    【解决方案1】:

    您尝试过shorttoc 包吗?

    【讨论】:

      【解决方案2】:

      您可以使用 \renewcommand 更改 ToC 的名称,

      \renewcommand{\contentsname}{My New Table Of Contents}
      

      例子:

      \documentclass{amsart}
      \usepackage{hyperref}
      \renewcommand{\contentsname}{My New Table of Contents}
      \begin{document}
      
      \setcounter{tocdepth}{3}
      \tableofcontents
      \newpage
      
      \newpage
      \section{Section a}
      Some a text.
      \subsection{Subsection b}
      Some b text.
      \subsubsection{Subsubsection c}
      Some c text.
      
      \newpage
      \section{Section d}
      Some d text.
      \subsection{Subsection e}
      Some e text.
      
      \end{document}
      

      我已经使用 \renewcommand 自定义了 \maketitle 命令的外观,因此您可能需要考虑更新 \tableofcontents。

      【讨论】:

      • 似乎没有改变目录的标题。我不知道怎么用...
      • 您将命令放在序言中。我将编辑一个示例。
      猜你喜欢
      • 2010-10-20
      • 1970-01-01
      • 2019-02-09
      • 1970-01-01
      • 2020-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      相关资源
      最近更新 更多