如何為目錄設定與文件其餘部分不同的行距?

如何為目錄設定與文件其餘部分不同的行距?

我正在寫關於大學的期末論文,我們必須使用雙行擴展和 Times New Roman。如果我\linespread{1.6}在序言中設定一切都很好,除了目錄中的\section間距很大。如果我在標記註釋發生後設定線寬\tableofcontents,則線寬保持正常。

是否有可能僅在 TOC 中保留正常的線分佈?

答案1

您可以使用該套件提供的功能setspace

\documentclass{article}
\usepackage{setspace}

\doublespacing

\begin{document}

\begingroup
\singlespacing
\tableofcontents
\endgroup

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}

或者

\documentclass{article}
\usepackage{setspace}

\begin{document}

\tableofcontents

\doublespacing

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}

答案2

您可以使用該setspace套件。只需添加\usepackage{setspace}到序言和\doublespacing目錄之後:

\documentclass{article}
\usepackage{setspace}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\doublespacing
\section{one}
\lipsum[1-4]
\section{two}
\lipsum[5-8]
\section{three}
\lipsum[9-12]
\end{document}

不同間距的 toc

相關內容