
答案1
除此之外,您的文件設定還受到指令使用不當\section
以及\subsection
產生分別標記為「章節」和「節」的標題的影響。為了減少不可避免的混亂,您可能需要切換到report
文檔類,發出序言中的指令\setcounter{secnumdepth}{-1}
,並使用指令\chapter
和\section
產生相應的標頭。
\documentclass{report} % not 'article'
\setcounter{secnumdepth}{-1}
\begin{document}
\tableofcontents
\chapter{Chapter 5}
\section{Section 1}
\end{document}
如果您不想在目錄和第一個標題之間有分頁符,請改用以下程式碼:
\documentclass{report} % not 'article'
\setcounter{secnumdepth}{-1}
\begin{document}
\tableofcontents
\begingroup
\let\clearpage\relax % locally disable '\clearpage'
\chapter{Chapter 5}
\endgroup
\section{Section 1}
\end{document}