1

I want to create a document with KOMA Script and customized headings for odd/even pages and a predefined first page.

I tried the MWE below, but it seems that the rest of the even pages are affected by the definition of firstpage.

\documentclass{scrartcl}

\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}

% create new header for title page
\renewcommand*\titlepagestyle{firstpage}
\newpairofpagestyles{firstpage}{%
  \ihead{1st page left head}
  \ohead{1st page right head}
}

   \clearscrheadings

\cohead{center odd pages \headmark}
\cehead{center even pages (after 1st page) \headmark} % <=== THIS IS NOT WORKING

\usepackage{lipsum}

\title{Document Title}
\author{Document Author}
\date{}

\begin{document}

\maketitle

\lipsum[1-16]

\end{document}

Any help will be appreciated very much!

Toño
  • 516
  • 3
  • 15
  • 1
    Why don't you simply make the titlepage from scratch and avoid messing with page sryles? – Johannes_B Sep 05 '17 at 10:49
  • Thanks Johannes_B, but I want to use the template for several documents. – Toño Sep 05 '17 at 10:50
  • https://tex.stackexchange.com/questions/209993/how-to-customize-my-titlepage/210280#210280 and the wikibooks page linked there. – Johannes_B Sep 05 '17 at 10:56
  • Thanks, but my question is about headings in odd/even pages like in journal articles, i.e. with a predefined first page. – Toño Sep 05 '17 at 11:02

1 Answers1

2

For the odd/even style to work out of the box, you need to specify the document option [twoside]:

\documentclass[twoside]{scrartcl}

\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}

% create new header for title page
\renewcommand*\titlepagestyle{firstpage}
\newpairofpagestyles{firstpage}{%
  \ihead{1st page left head}
  \ohead{1st page right head}
}

   \clearscrheadings

\cohead{center odd pages \headmark}
\cehead{center even pages (after 1st page) \headmark} % <=== THIS IS NOT WORKING

\usepackage{lipsum}

\title{Document Title}
\author{Document Author}
\date{}

\begin{document}

\maketitle

\lipsum[1-16]

\end{document}

Alternatively if you don't want to specify twoside you can use the \ifthispageodd macro provided by KOMA and use

\chead{\ifthispageodd{center odd pages \headmark}{center even pages (after
  1st page) \headmark}}

instead of \cehead and \cohead. Note that this needs two LaTeX-runs to be correct.

Skillmon
  • 60,462