如何使用 \section*{something} 而不將其從目錄中刪除?

如何使用 \section*{something} 而不將其從目錄中刪除?

我正在嘗試在我的報告中插入摘要和致謝頁。我想抑制(前面的數字):

  1. 抽象的
  2. 致謝

部分透過使用\section*.但這樣做後,它也會從目錄中刪除。有沒有辦法在目錄中維護一個條目,同時防止這種情況發生?

答案1

使用

\section*{Section heading}
\addcontentsline{toc}{section}{Section heading}

如果您使用的是report文檔類,那麼您應該使用

\chapter*{Chapter heading}
\addcontentsline{toc}{chapter}{Chapter heading}

答案2

當您使用自己的部分名稱時,它可能會丟失計數。

這是一種選擇:

\section*{Your section name}
\addcontentsline{toc}{section}{Your section name}\stepcounter{section}

之後只需添加一個計數器即可。

相關內容