1

I'm trying to use scrlayer-scrpage with a twosided document using the scrartcl class but somehow can't manage to format the plain pagestyle in a way that is similar to the scrheadings style. I prepared the following MWE – thanks in advance!

\documentclass[12,a4paper,twoside]{scrartcl}
\usepackage[automark,headsepline,footsepline,markcase=nouppercase]{scrlayer-scrpage}
\renewcommand*{\sectionmarkformat}{}
\renewcommand*{\subsectionmarkformat}{}
\renewcommand*{\headfont}{\normalfont}
\automark[subsection]{section}
\chead{\leftmark}
\cfoot{\pagemark}
\ihead{}
\ohead{}
\ifoot{}
\ofoot{}

\begin{document}

\pagestyle{scrheadings}

\section{Blah.}

Blah.

\newpage

\section{Blah.}

Blah.

\newpage

\pagestyle{plain.scrheadings}


\section{Blah.}

Blah.

\newpage

\section{Blah.}

Blah.

\end{document}
4
  • 1
    Do \cfoot*{\pagemark} (note the asterisk) and do similar for the other instances. – Johannes_B Jun 28 '16 at 20:23
  • 1
    A different question would be why you are using a plain pagestyle, when an article class generally use one. All the \newpage in your code are clues, that you should have used a report (or een book) class. – Johannes_B Jun 28 '16 at 20:32
  • Thanks for your solution! It seems as if the problem is created by my local tex destribution as it works when I try the starred commands on Overleaf. The \newpage commands were only for illustrative purposes btw :) – JKR Jun 28 '16 at 20:59
  • You might have an old (older than two years?) distribution, which an update could resolve. – Johannes_B Jun 28 '16 at 21:00
4

To format the plain pagestyle use the optional argument of \cfoot etc:

\cfoot[<settings for plain>]{<settings for scrheadings>}

If both arguments are equal, you can use the short starred version:

\cfoot*{<settings for plain and scrheadings>}

If the plain style should also use the lines, add plainheadsepline and/or plainfootsepline to the package options of scrlayer-scrpage.

\documentclass[12,a4paper,twoside]{scrartcl}
\usepackage[
  automark,
  headsepline,
  plainheadsepline,
  footsepline,
  plainfootsepline,
  markcase=nouppercase
]{scrlayer-scrpage}

\renewcommand*{\sectionmarkformat}{}
\renewcommand*{\subsectionmarkformat}{}
\setkomafont{pagehead}{\normalfont}

\clearpairofpagestyles
\chead*{\leftmark}
\cfoot*{\pagemark}

\usepackage{blindtext}% dummy text
\begin{document}
\pagestyle{scrheadings}
\blinddocument

\clearpage
\pagestyle{plain}
\blinddocument
\end{document}

Additional remarks:

  • Option automark does the same as \automark[subsection]{section} if the class does not know chapters.
  • If there should be the section in header on even pages and the subsection you can use \chead{\headmark}.
  • To set the font of the page header use \setkomafont{pagehead}{<font settings>}.
  • With package scrlayer-scrpage pagestyle plain is redefined as an alias for pagestyle plain.scrheadings.

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.