在目录中不带编号的Latex章节

7
我想为本科论文创建目录,但不想对其所有内容进行编号。例如,摘要应包含在目录中,但不带编号。我在文章文档类中写作,无法使用\chapter命令。有没有简单的方法来解决这个问题?
谢谢!

请提供一个最小可复现示例(MRE)。 - samcarter_is_at_topanswers.xyz
1个回答

18

你可以使用\section*{}创建一个没有编号的章节。然而,它将不会出现在目录中。 你可以使用\addcontentsline{toc}{section}{\protect\numberline{}Your section name}手动添加到目录。

例如,对于摘要、引言、两个带编号的章节和结论,可以这样做:

\documentclass{article}

\begin{document}
\tableofcontents

\section*{Abstract}
\addcontentsline{toc}{section}{\protect\numberline{}Abstract}

\section*{Introduction}
\addcontentsline{toc}{section}{\protect\numberline{}Introduction}

\section{Section 1}

\section{Section 2}

\section*{Conclusion}
\addcontentsline{toc}{section}{\protect\numberline{}Conclusion}

\end{document}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接