6

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

内容概述

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

详细内容

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

我试过了

\setcounter{tocdepth}{1}
\tableofcontents

\setcounter{tocdepth}{2}
\tableofcontents

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

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

4

2 回答 2

7

您是否尝试过shorttoc包?

于 2009-05-02T19:03:55.253 回答
0

您可以使用 \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。

于 2009-05-02T19:08:58.487 回答