3

First of all, I've seen the answers which are recommending fiddling with \pnumwidth and \tocmarg -- changing these are only shifting the problem elsewhere within the toc, lof and lot.

How can I get no overfull hboxes in the toc, lof and lot (e.g. allow it to be sloppy and underfill)? I've also seen tocloft package but wish to avoid, as it causes problems with page headers.

\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 Answer 1

3

You could use the optional argument of the sectioning commands:

\subsection[shorter title]{longer title}

In this way LaTeX will show the longer title in the main document, using the shorter version for headings and toc entries.

4
  • 5
    Adding suitable \\ or \protect\linebreak commands in the “shorter title” can be an option.
    – egreg
    Commented Jul 29, 2015 at 13:03
  • 1
    @egreg -- might not \\ cause a problem in the running head? Commented Jul 29, 2015 at 13:43
  • 1
    @barbarabeeton Subsection titles don't usually go in the header
    – egreg
    Commented Jul 29, 2015 at 13:45
  • 1
    @egreg -- good point. (stupid observation.) thanks. Commented Jul 29, 2015 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .