書中章節號和標題之間的水平間距

書中章節號和標題之間的水平間距

book我正在編寫一個包含類別和重新定義的命令的文檔\thechapter。由於我有很多章節,目錄中的章節號碼和章節標題重疊。如何更改它們之間的水平間距?我只看到了對班級不起作用的解決方案book

微量元素:

\documentclass{book}
\begin{document}
\tableofcontents
\renewcommand*{\thechapter}{I.\arabic{chapter}}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\end{document}

答案1

盡量提前為號碼預留一些空間\setlength{\cftchapnumwidth}{3em},例如在加載tocloft包裹後。

\documentclass{book}

\usepackage{tocloft}
\setlength{\cftchapnumwidth}{3em}

\begin{document}
\tableofcontents
\renewcommand*{\thechapter}{I.\arabic{chapter}}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\chapter{AAA}
\end{document}

相關內容