I want to achieve the following: In a twoside document I want to display the chapter title on even pages and the section (plus subsection if there is one) title on odd pages. So that for odd pages it looks like "section -- subsection" if there is a subsection and "section" otherwise. So far, I do it this way:
\documentclass[a4paper, 12pt, twoside, openright, appendixprefix, BCOR7.5mm, pointlessnumbers, bibliography=totoc, listof=totoc]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{blindtext}
\usepackage{scrpage2}
\begin{document}
\pagestyle{scrheadings}
\automark[subsection]{chapter}
\renewcommand*{\sectionmark}[1]{%
\markright{\ifnum \value{secnumdepth} >0 \sectionmarkformat\fi
#1}}%
\setheadsepline{.2pt}
\ohead{\headmark}
\chapter{Chapter 1}
\section{section}
\blindtext[15]
\chapter{Chapter 2}
\section{section}
\subsection{subsection}
\blindtext[15]
\end{document}
This works so far in that it displays chapter and section OR subsections, respectively. Now I want to display both, section and subsection. How can I do this? Thank you.
Edit: Added example.
\chapter
.\sectionmark
so that it displays "section -- subsection" if a subsection exists and only "section" otherwise.\documentclass
and ends with\end{document}
and so enables us to make sensible tests.