我已经更改了目录第一页中索引和章节(章节的编号和标题)之间的空间,但它不适用于第二页...我该怎么办?
\documentclass[french]{report}
\usepackage[french]{babel}
\usepackage{fancyhdr}
\usepackage[utf8]{inputenc}
\makeatletter
\renewcommand*\l@section{\@dottedtocline{2}{1.8em}{1.8em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{3.3em}{2.3em}}
\makeatother
\pagestyle{plain}
\renewcommand{\contentsname}{Table des matières}
\tableofcontents{}
答案1
问题不在于目录的第二页,而是你没有为诸如 之类的数字留出足够的空间13.1
。如果你要更改目录(或 LoF 或 LoT)的布局,我建议你使用tocloft
下面的包。
% tocspaceprob.tex SE 572798
\documentclass[french]{report}
\usepackage[french]{babel}
\usepackage{fancyhdr}
\usepackage[utf8]{inputenc}
\usepackage{comment}
\begin{comment}
\makeatletter
\renewcommand*\l@section{\@dottedtocline{2}{1.8em}{1.8em}}
\renewcommand*\l@section{\@dottedtocline{2}{2.3em}{2.3em}} % this works
\renewcommand*\l@subsection{\@dottedtocline{2}{3.3em}{2.3em}} % change this
\makeatother
\end{comment}
\usepackage[T1]{fontenc} % use this for French
\usepackage{tocloft}
\setlength{\cftsecnumwidth}{2.3em} % more space for section numbers
\setlength{\cftsubsecnumwidth}{3.3em} % more space for subsection numbers
\pagestyle{plain}
\renewcommand{\contentsname}{Table des matières}
\begin{document}
\tableofcontents
\chapter{First}
\section{Early section}
\subsection{Subsection}
\setcounter{section}{12}
\section{Later section}
\subsection{Another subsection}
\end{document}