【问题标题】:Latex - Blank table of contents with unnumbered sectionLatex - 带有未编号部分的空白目录
【发布时间】:2014-09-09 19:50:43
【问题描述】:

在尝试创建包含未编号部分的目录时,即使经过多次重复编译,我也会得到一个空目录。

当我使用编号部分时,目录可以正常工作。

一个示例(完整的 Latex 文档)如下所示(我试图使其尽可能简单):

\documentclass[12pt,a4paper,english]{article}

\begin{document}
\tableofcontents
\section*{Testsection} %Works when section* is replaced with section
 Test
\end{document}

【问题讨论】:

    标签: latex tex


    【解决方案1】:

    带星号的部分单元的条目可以使用

    插入到 ToC
    \addcontentsline{toc}{<type>}{<content>}
    

    其中&lt;type&gt;section,或subsection,或...这是一个最小示例:

    \documentclass{article}
    \begin{document}
    \tableofcontents
    \section{A numbered section}
    \section*{An unnumbered section}
    \addcontentsline{toc}{section}{Testsection}
    \section{Another numbered section}
    \section*{Another unnumbered section}
    \addcontentsline{toc}{section}{\protect\numberline{}Another unnumbered section}
    \end{document}
    

    出于对齐目的,您可能有兴趣在 ToC 条目中添加 \protected \numberline

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      • 2019-10-05
      • 2011-02-21
      相关资源
      最近更新 更多