# Custom chapter and section header with scrlayer-scrpage

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
\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)

• 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 Oct 18 '17 at 20:35

\documentclass[twoside]{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum}
\clearpairofpagestyles

\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

• 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? – eklisiarh Oct 18 '17 at 21:46
• @eklisiarh Replace \chapter* by \addchap*. – esdd Oct 18 '17 at 22:45