I have a problem just as the following picture. Long section names are placed in the header, which overlaps the header number, it will be only seen if one uses short words. I use the following code in my class file:

I have tried to use code such as \mbox, but the previous correct header(like page 5) goes wrong. Thanks!

• most document classes allow a "short form" of a header for just this reason: \chapter[short form]{long form}. if the document class you're using (you don't say which one) always places the optional form in the table of contents, and you don't want that, then you can provide an alternate form of the header with \markboth{short form}{short form}. again, this likely depends on the document class you are using. Sep 28, 2017 at 14:13
• That's why the sectioning commands have an optional parameter for a short title, e.g. \chapter[bug 3 Lange Abschnittsnamen]{bug 3 LangeAbschnittsnamen werden in der ...}. The short title goes into the header and the ToC. And please learn about minimal working example (MWE).
– Mike
Sep 28, 2017 at 14:16
• Thanks for you answer. I use the class of my university, it is based on KOMA-Script. Now the problem is, we want to show the long form not the short form, do you have any idea? Sep 29, 2017 at 7:21

You can use a \parbox inside \ihead:

\ihead{\parbox[c][3\baselineskip][c]{.9\linewidth}{\headmark}}


Then the header must be enlarged. So you have to add headlines=3.25 to the class options. Alternatively you can use

\PassOptionsToPackage{headlines=3.25}{typearea}


before \documentclass{<your class>}.

\PassOptionsToPackage{headlines=3.25}{typearea}% option headlines is needed!
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\renewcommand\chaptermarkformat{}% to remove the chapter number in header

\usepackage{scrlayer-scrpage}
\automark[chapter]{chapter}

\clearpairofpagestyles

\usepackage{blindtext}% only for dummy text
\begin{document}

\chapter{bug 3 - Lange Abschnittsnamen werden in der Kopfzeile des D.o.kuments mit zu wenig Abstand gesetzt, was man nur sieht wenn man kurze Wörter verwendet und der Text lang genug ist.}
\Blindtext[10]
\chapter{Kurzer Titel}
\Blindtext[10]
\end{document}


If your class uses the outdated package scrpage2 the example changes to

\PassOptionsToPackage{headlines=3.25}{typearea}% option headlines is needed!
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\renewcommand\chaptermarkformat{}% to remove the chapter number in header

\usepackage{scrpage2}
\automark[chapter]{chapter}