
我使用簡單的普通\tableofcontents
命令來產生目錄,我發現節號和節標題之間的間距太小:
有人可以告訴我如何解決這個問題嗎?我的文檔類別是memoir
,如果這很重要的話。
答案1
ToC 中節號的寬度由稱為 的長度定義\cftKnumwidth
,其中K
應替換為節級別,即、chapter
等section
。\setlength
\setlength\cftsectionnumwidth{4em}
參見部分9.2.2 排版條目手冊的memoir
更多資訊。
一個完整的例子:
\documentclass{memoir}
% \setlength\cftsectionnumwidth{4em} % uncomment to see difference
\begin{document}
\tableofcontents
\chapter{A chapter}
\setcounter{section}{999} % just for this example
\section{A section}
\end{document}
或者,如果您正在使用書籍課程,請按照https://tex.stackexchange.com/a/336618/50702以及 Torbjørn T. 的評論如下:
\documentclass{book}
% note you need the subfigure option if you are using the subfigure package
%\usepackage[subfigure]{tocloft}
\usepackage{tocloft}
\setlength\cftsecnumwidth{4em}
\begin{document}
\tableofcontents
\chapter{A chapter}
\setcounter{section}{999}
\section{A section}
\end{document}
答案2
如果目錄中有大量數字,您可以在序言中使用命令\cftsetindents
(texdoc memoir
,第 153 頁)來控制數字前後的空格,語法如下:
\cftsetindents{
種類}{
縮排}{
數字寬度}
在哪裡種類在分段層級(例如,小節)縮排是縮排的長度(數字之前的空格)並且數字寬度是數位的空間和章節標題的分離。
例如:
\cftsetindents{section}{1em}{3em}