我对目录有疑问。如您所见,当数字超过 1 位时,数字和子节名称之间没有空格。有没有简单的命令可以更改间距?
这段代码变得更糟
\documentclass[a4paper,11pt]{report}
\usepackage[dutch]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\tableofcontents
\setcounter{chapter}{10} %use to adjust chapter number incase you don't include certain chapters
\setcounter{section}{10}
\setcounter{subsection}{10}
\section{section1}
\section{section2}
\section{section3}
\setcounter{subsection}{10}
\subsection{subsectionA}
\subsection{subsectionB}
\subsection{subsectionC}
\end{document}
答案1
因为这是一个标准类,所以你可以直接使用包tocloft
。使用 Fx
\usepackage{tocloft}
\addtolength\cftsecnumwidth{1em}
\addtolength\cftsubsecnumwidth{1em}
\addtolength\cftsubsecindent{1em}
最后一行调整小节项目的缩进,以便与上面的小节元素保持匹配。
答案2
使用包非常容易tocbasic
:
\documentclass[a4paper,11pt]{report}
\usepackage[dutch]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tocbasic}
\DeclareTOCStyleEntries[dynnumwidth,dynindent]{tocline}{chapter,section,subsection,subsubsection,paragraph,subparagraph}% Reconfigure ToC entries for chapter … subparagraph to use the needed number width and indent
\begin{document}
\tableofcontents
\setcounter{chapter}{10} %use to adjust chapter number incase you don't include certain chapters
\setcounter{section}{10}
\setcounter{subsection}{10}
\section{section1}
\section{section2}
\section{section3}
\setcounter{subsection}{10}
\subsection{subsectionA}
\subsection{subsectionB}
\subsection{subsectionC}
\end{document}
您至少需要运行三次 LaTeX 才能自动获得: