# Pagestyle wrong after \cleardoublepage [closed]

Using KOMA-script I have problems with a twosided document. I want my sections to start on an odd page, so i use \cleardoublepage before starting the next section. I want the section title to be displayed in the right headline and the subsection title displayed in the left headline.

Whenever a section ends on an odd page everything works fine, one empty page is added and the sections starts on the next odd page with the correct pagestyle. But it blows up when a section ends on an even side. The new section correctly starts on the next odd page without an additional blank page but it has the wrong pagestyle and no headers at all.

\documentclass[a4paper,11pt,headsepline=true,twoside=true]{scrartcl}

\usepackage{scrpage2}

\automark[subsection]{section}
\usepackage{lipsum}

%Dokument
\begin{document}
\section{test}
blah blah blah
\cleardoublepage
\section{test2}
\lipsum
\cleardoublepage
\section{test3}
\lipsum
\end{document}


Headers are shown on the page where section test2 starts but not on the page where section test3 starts.

What goes wrong here?

-

## closed as too localized by lockstep, Werner, Speravir, mafp, KurtMar 27 '13 at 23:02

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

If I get it right the problem should be that in your MWE the headers of page 5 with section "test3" are missing because the section before ends on an even page? –  Quincy Mar 27 '13 at 17:51
Are you sure that the documentclass scrartcl is the correct choise. I think you should use scrbook! –  Marco Daniel Mar 27 '13 at 18:59
On odd numbered pages you want the \leftmark, which is empty, because no \chapter command has set it. –  egreg Mar 27 '13 at 21:17
In your example, section "test3" starts at page 5 which features the correct heading. –  lockstep Mar 27 '13 at 22:00
When I compile the above example on my computers "test3" starts on page 5 but shows no heading at all in contrast to "test2" on page 3, which does. Kubuntu 12.04 and Linux Mint 13... Both featuring very old TeXlive-Distributions (2009). What version are you using @lockstep? –  Sunday Mar 27 '13 at 22:08

The aforementioned release notes proposes to add \thispagestyle{...} after \cleardoublepage. This solves the problem, at least in TexLive 2009.