4

By default, the headings with scrrept, scrlayer-scrpage, and scrheadings are of the form "«number» «title»" in the headings for numbered chapters. I am wishing to change it to "Chapter «number». «title»" (i.e., add "Chapter" and the period). Moreover, the unnumbered chapters should have just "«title»" in the headings. I read through several tex.se Q&A-pages and finally arrived at a bulky solution which goes great lengths to achieve that:

\documentclass[twoside=false]{scrreprt}
\usepackage[automark,headsepline,footsepline,plainheadsepline,plainfootsepline]{scrlayer-scrpage}
\usepackage{lipsum}
\pagestyle{scrheadings}
\lehead{} 
\lohead{}
\cehead{}
\cohead{}
\rehead{\normalfont\headmark}
\rohead{\normalfont\headmark}
\begin{document}

\addchap{Introduction}
\lipsum[1-20]

\clearpage
\let\oldchaptermark\chaptermark
\let\oldaddchapmark\addchapmark
\renewcommand{\chaptermark}[1]{\markboth{\chapapp\ \thechapter\autodot}{#1}}
\renewcommand{\addchapmark}[1]{\markboth{#1}{#1}}
\rehead{\normalfont\leftmark. \rightmark}
\rohead{\normalfont\leftmark. \rightmark}

\chapter{The rise of the house of Usher}
\lipsum[1-20]

\chapter{The fall of the house of Usher}
\lipsum[1-20]

\clearpage
\renewcommand{\chaptermark}{\oldchaptermark}
\renewcommand{\addchapmark}{\oldaddchapmark}
\rehead{\normalfont\leftmark}
\rohead{\normalfont\leftmark}

\appendix
\addchap{Bibliography}
\lipsum[1-20]
\end{document}

Is there some more automatic way in which all the additional commands could be issued in the preamble rather than inserted between \begin{document} and \end{document}?

An aside: In the main text, there should be no periods after chapter numbers or section numbers.

  • If also sections etc. should have a period after the number, use KOMA-Script option numbers=endperiod. – esdd Jul 25 '16 at 19:27
2

If you only want to change the chapternumber format in page headers you can redefine the KOMA-Script command \chaptermarkformat to your needs

\renewcommand\chaptermarkformat{%
  \chapapp~\thechapter.\enskip
}

enter image description here

enter image description here

enter image description here

Code:

\documentclass[twoside=false]{scrreprt}

\usepackage[automark,headsepline,footsepline,plainheadsepline,plainfootsepline]{scrlayer-scrpage}
\pagestyle{scrheadings}
\lehead{} 
\lohead{}
\chead{}
\rehead{\headmark}
\rohead{\headmark}
\setkomafont{pagehead}{\normalfont}

\renewcommand\chaptermarkformat{%
  \chapapp~\thechapter.\enskip
}

\usepackage{lipsum}
\begin{document}
\addchap{Introduction}
\lipsum[1-20]
\chapter{The rise of the house of Usher}
\lipsum[1-20]
\chapter{The fall of the house of Usher}
\lipsum[1-20]
\appendix
\addchap{Bibliography}
\lipsum[1-20]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy