目次のhboxがいっぱいです

目次のhboxがいっぱいです

まず、 をいじることを推奨する回答を見てきましたが\pnumwidth\tocmargこれらを変更すると、問題が toc、lof、lot 内の別の場所に移るだけです。

toc、lof、lot で hbox が過剰に満たされないようにするにはどうすればよいでしょうか (たとえば、ずさんで不足した hbox を許可するなど)?tocloftパッケージも見たことがありますが、ページ ヘッダーに問題が発生するため、避けたいと思っています。

\documentclass[a4paper, 12pt]{report}
\usepackage[a4paper,left=4cm,right=2.5cm,top=3.5cm,bottom=3cm]{geometry}

\begin{document}
\begin{titlepage}
\centering
\today
\end{titlepage}
\tableofcontents
\chapter{Chapter title}
\section{Section title}
\subsection{Subsection containing extremely lengthy heading obnoxiously} % toc overrun by this title, words picked deliberately to exhibit the flaw
\end{document}

答え1

セクションコマンドのオプション引数を使用できます。

\subsection[shorter title]{longer title}

この方法では、LaTeX はメイン文書に長いタイトルを表示し、見出しと目次エントリには短いバージョンを使用します。

関連情報