I have a chapter title that is too long to fit onto one line in the table of contents, but LaTeX does keep it in one line, producing an overfull line in the TOC. How can I insert a line break into this title so that to break it only in the TOC, not when it appears as a chapter heading?
I tried \protect\linebreak[1], but it did the opposite: it broke the line in the chapter heading but not in the TOC.
Here is a simplified version of my source (not quite a minimal example though):
\documentclass[a4paper,12pt]{scrbook}
\usepackage[utf8]{inputenc} % UTF-8 input encoding
\usepackage[T1]{fontenc} % for hyphenation to work with
% accented letters, etc.
\usepackage{lmodern} % modern latin font
\usepackage[french]{babel} % language support
\usepackage[hmargin=3.5cm,vmargin=3.5cm]{geometry}
\usepackage{tocstyle}
\usetocstyle{KOMAlike} % defined in tocstyle package
\renewcommand{\thechapter}{\Roman{chapter}}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Un chapitre}
\chapter{Deux chapitre}
\chapter{Systèmes d'équations différentielles
linéaires à coefficients \protect\linebreak[1]constants}
\section{Généralités}
\section{Résolution d'un système d'ordre $1$
par diagonalisation ou par triangularisation}
\end{document}
\chapter[optional form](form in chapter}. the\linebreakcould then be put only in the optional form. this, of course, will also mess up running heads, but they can be fixed with\markboth{left page}{right page}. – barbara beeton Sep 08 '16 at 15:13