目录中有几个较长的章节和子章节名称与页码非常接近。它们的长度使得章节名称占用了通常由句号占据的所有空间。这看起来很糟糕。理想情况下,如果句号填充的空间低于阈值,则将强制分页。人们可以只更改章节名称,但这并不理想。
被调用的类是 dalthesis.cls。相关文章是这里。
答案1
解决这个问题被提议我问的一个问题,(尽管我也担心页码是否变得太大)并改进了这个答案,但我认为说你的问题是重复的是不公平的,所以我将在这里重复/复制他们的一些答案:
从包rightindent
中设置:TOCStyleEntries
tocbasic
\documentclass{extarticle}
\usepackage{lipsum}
\usepackage[nottoc]{tocbibind}
\usepackage{tocbasic}
\DeclareTOCStyleEntries[
rightindent=10em,% <-- Adjust as you wish
pagenumberbox=\pagenumberbox
]{tocline}{section,subsection,subsubsection,paragraph,subparagraph,figure,table}
\newcommand*\pagenumberbox[1]{\mbox{\hspace{0.5em}#1}}
\begin{document}
\tableofcontents
\addtocontents{toc}{\sloppy}
\pagenumbering{arabic}
\section{Something}
\subsection{Something else}
\subsection{Some possibly very long title section that might just decide to span several lines in the table of contents. Why would someone write this}
\end{document}
答案2
另一个解决方案是增加目录中页码占用的空间
% tocpageprob2.tex SE 550154
\documentclass{report}
\makeatletter
\renewcommand{\@pnumwidth}{3em} % also try with this commented out
\makeatother
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{Short section title}
Some text.
\section{Long section title that may get too close to the page number in the}% ToC}
More text.
\end{document}