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!

  • 1
    Why don't you simply make the titlepage from scratch and avoid messing with page sryles? – Johannes_B Sep 5 '17 at 10:49
  • Thanks Johannes_B, but I want to use the template for several documents. – Toño Sep 5 '17 at 10:50
  • tex.stackexchange.com/questions/209993/… and the wikibooks page linked there. – Johannes_B Sep 5 '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 5 '17 at 11:02
1

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.

  • That was it. The twosideoption is the answer. Thanks – Toño Sep 5 '17 at 11:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.