scrlayer-scrpage: „Kapitel 1“ in lehead, „Kapiteltitel“ in rohead

scrlayer-scrpage: „Kapitel 1“ in lehead, „Kapiteltitel“ in rohead

Mittels scrlayer-scrpage in der Dokumentklasse scrreprt möchte ich, dass das Wort "Kapitel 1" (oder 2 oder welches Kapitel es auch ist) im äußeren Kopf der geraden Seiten erscheint und der Kapiteltitel - ohne "Kapitel 1" davor - im äußeren Kopf der ungeraden Seiten (siehe Bild). EDIT: Bei unnummerierten Kapiteln sollte der Kopf leer sein. Wie erreiche ich das?

Bildbeschreibung hier eingeben

Mein MWE:

\documentclass[twoside, openright, BCOR=1cm, bibliography=totoc,headsepline,chapterprefix=true]{scrreprt}

\usepackage{scrlayer-scrpage}

\pagestyle{scrheadings}
\automark[chapter]{chapter}
\usepackage{lipsum}

\setcounter{secnumdepth}{0}

\begin{document}

\chapter{An interesting title}
\thispagestyle{empty}

\newpage

\section{A slightly less interesting title}
\lipsum[1-5]

\end{document}

Antwort1

Frage: Was sollte in der Kopfzeile der geraden Seiten stehen, wenn das Kapitel keine Nummerierung hat?


Hier ist ein Vorschlag, wo der Kapiteltitel auf geraden Seiten in nicht nummerierten Kapiteln verwendet werden könnte:

\documentclass[
  twoside, open=right, BCOR=1cm,
  bibliography=totoc,
  headsepline,
  chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text

\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\automark{chapter}

\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{\chaptermarkformat}{#1}}{#1}%
}

\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\end{document}

oder ohne Paket scrlayer-scrheadings:

\documentclass[
  twoside, open=right, BCOR=1cm,
  bibliography=totoc,
  headsepline,
  chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text

\pagestyle{headings}

\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{\chaptermarkformat}{#1}}{#1}%
}
\renewcommand*\sectionmark[1]{}

\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\end{document}

Wenn die Kopfzeile der geraden Seite bei nicht nummerierten Kapiteln leer sein soll, können Sie

\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}

Zusätzlich muss noch auf manuelle Markierungen umgeschaltet werden und die Markierungen für das Inhaltsverzeichnis etc. manuell gesetzt werden:

\manualmark% or option manualmark for package `scrlayer-scrpage`
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}

Beispiel:

\documentclass[
  twoside, open=right, BCOR=1cm,
  bibliography=totoc,
  headsepline,
  chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text

\usepackage[manualmark]{scrlayer-scrpage}% sets pagestyle scrheadings automatically

\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}

\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}

\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}

oder ohne Paket scrlayer-scrheadings:

\documentclass[
  twoside, open=right, BCOR=1cm,
  bibliography=totoc,
  headsepline,
  chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text

\pagestyle{myheadings}

\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}

\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}

\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}

Antwort2

Um dies zu erreichen, können Sie \chaptermarkes neu definieren.\sectionmark

\documentclass[twoside]{scrreprt}

\usepackage{lipsum} % just for example text

\pagestyle{headings}

\renewcommand*\chaptermark[1]{%
  \markboth{Chapter~\thechapter}{#1}%
}
\renewcommand*\sectionmark[1]{}

\begin{document}

\chapter{Some Title}
\lipsum[1-5]

\section{A Section}
\lipsum[6-12]

\section{Another Section}
\lipsum[13-20]

\end{document}

verwandte Informationen