# Indentation on long centered chapter titles

My publisher wants the chapter titles centered. Sometimes the title is spreading over two lines which means that the title in the first line very much looks like text. Is it possible to add some indent on the right and left? Or limit the \textwidth to say 0.8\textwidth?

MWE:

\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage{blindtext}

\renewcommand*{\raggedchapter}{\centering}
\setkomafont{chapter}{\normalfont}

\begin{document}

\chapter{A very long title with more than one line of text to be typeset in the center with indentation at the left and right}

\blindtext
\end{document}


Current output with the desired maximum expansion in red:

You can redefine \chapterlinesformat:

\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage{blindtext}

\renewcommand*{\raggedchapter}{\centering}
\setkomafont{chapter}{\normalfont}

\renewcommand*\chapterlinesformat[3]{%
\raggedchapter
\parbox{.8\textwidth}{\raggedchapter#2#3}%
\par\nopagebreak
}

\begin{document}

\chapter{A very long title with more than one line of text to be typeset in the center with indentation at the left and right}

\blindtext
\end{document}


• Both solutions seem to work fine! I prefer this one to Ulrikes because it works without loading a package. But from a technical side it is beyond me which one is better/preferable. Dec 14 '17 at 9:28

You can do it with the ragged2e package:

\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{ragged2e}
\renewcommand*{\raggedchapter}{%
\CenteringLeftskip=2cm plus 2em\relax
\CenteringRightskip=2cm plus 2em\relax
\Centering}
\setkomafont{chapter}{\normalfont}

\begin{document}

\chapter{A very long title with more than one line of text to be typeset in the center with indentation at the left and right}

\blindtext
\end{document}


But I normally prefer to add a new line manually as you can than more easily choose a semantically sensible place:

  \chapter[text for the toc]{%
A very long title with more than one line of text \\
to be typeset in the center with indentation at the left and right}

• I just noticed this solution does not center the chapter mark properly. this is easily done by moving \thechapter to the beginning of the main text of the chapter. Dec 14 '17 at 22:35