1

I would like to customise how my odd and even header looks like in scrbook class.

Even pages should look like this:

Pagenumber (left) Chapter 1: Title of the first Chapter (center) empty (right)

Odd pages should look like this for the first section:

empty (left) 1. Title of the first Section (center) Pagenumber (right)

Odd pages should look like this for the second section:

empty (left) 2. Title of the second Section (center) Pagenumber (right)

Here is the MWE of what I have so far:

\documentclass[twoside]{scrbook}
\usepackage[]{scrlayer-scrpage}
\usepackage{lipsum}
\clearpairofpagestyles
\lehead{}
\cehead{Chapter\space\leftmark}
\lehead{\pagemark}
\lohead{}
\cohead{\rightmark}
\rohead{\pagemark}
\lefoot{}
\cfoot{}
\begin{document}
\chapter{CHTITLE}
\lipsum[1-20]
\section{STITLE}
\lipsum[21-40]
\end{document}

Note that the section number should not include number of the chapter as it does now (instead of 1.1. or 1.2 it should be just 1 or 2)

1
  • What should be in header/footer on chapter pages? And what should be in header of odd pages if there did not start a section yet?
    – esdd
    Commented Oct 18, 2017 at 20:35

1 Answer 1

1
\documentclass[twoside]{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum}
\clearpairofpagestyles
\ohead*{\pagemark}
\chead{\headmark}

\renewcommand\sectionmarkformat{\arabic{section}.\enskip}
\renewcommand\chaptermarkformat{\chaptername\ \thechapter:\enskip}

\begin{document}
\chapter{CHTITLE}
\lipsum[1-20]
\section{STITLE}
\lipsum[21-40]
\section{SECOND STITLE}
\lipsum[41-60]
\end{document}

results in

enter image description here

4
  • This works perfectly, thanks, except in the case when chapter is set with \chapter*. In that case there should be nothing on the even page. Can this be achieved?
    – stx932
    Commented Oct 18, 2017 at 21:46
  • 1
    @eklisiarh Replace \chapter* by \addchap*.
    – esdd
    Commented Oct 18, 2017 at 22:45
  • Can you elaborate, why there is a star after \ohead?
    – stollenm
    Commented Sep 9, 2021 at 7:23
  • @stollenm \ohead*{\pagemark} is a short version of \ohead[\pagemark]{\pagemark}. The mandantorry argument of \ohead is the content for page style scrheadings and the optional argument is the content for the assoiciated plain style.
    – esdd
    Commented Sep 10, 2021 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .