[Tex/LaTex] Long name of Chapter in TOC. Doesn’t work \\ for a new line

line-breakingtable of contents

For a \documentclass{report}, how can I make a long chapter name to wrap onto a second line in TOC ?

For example :

screenshot

Best Answer

Usually line breaks are permitted in the table of contents. Example from Marco Daniel:

\documentclass{report}
\usepackage{blindtext}

\begin{document}
\tableofcontents

\chapter{Really Really Really Really Really Really Really Really Really Really Really Long Text}

\Blinddocument

\end{document}

Result

Package hyperref

If you are using package hyperref with a driver that does not support broken links across lines, then option linktocpage helps. That allows line breaks in the title and the link is put to the page number instead.

Example file:

\documentclass{report}

\usepackage[colorlinks,linktocpage]{hyperref}

\begin{document}
\tableofcontents
\thispagestyle{empty}

\chapter{Really Really Really Really Really Really Really Really Really
Really Really Long Text}

\end{document}

Result

Other classes packages

My guess with package hyperref can be wrong, the screen shot in the question does not show hyper links and the chapter title is set in all uppercase letters, perhaps the questioner is using a special class or package that deals with the table of contents that prevents line breaks.

Justification

Or line breaks are permitted and the effect is just an ordinary overfull \hbox because TeX cannot find a good break point.