1

I would like to have "Part 1", "Part 2" etc. in the lehead and the chapter title in the rohead. Getting the chapter title where I want it is no problem, neither is getting the word "Part". However, I have no idea how to get the part number into the header.

\documentclass[twoside, openright, headsepline, chapterpefix=true]{scrreprt}

\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles

\lehead{\partname}
\rohead{\leftmark}

\ofoot[\pagemark]{\pagemark}

\usepackage{lipsum}

\begin{document}
\part{}
\chapter{The First Chapter}
\lipsum[1-10]
\part{}
\chapter{The Second Chapter}
\lipsum[11-30]
\end{document}
2
  • 2
    Do you mean \lehead{\partname~\thepart}? – Ulrike Fischer Mar 26 at 12:27
  • @UlrikeFischer yes, that did it, thank you! (I was closer to the solution than I thought). – Anne Morbach Mar 26 at 15:07
1

You could also use \automark[chapter]{part} and redefine \partmarkformat. Then \part cleans automatically the chapter entry in header. Additionally there is no part entry in header if there are some pages (TOC, Introductino etc.) before the first part.

\documentclass[twoside, openright, headsepline, chapterpefix=true]{scrreprt}

\usepackage{scrlayer-scrpage}
\automark[chapter]{part}% <- added
\renewcommand*{\partmarkformat}{\partname~\thepart}% <- added
\clearpairofpagestyles

\lehead{\leftmark}% <- changed
\rohead{\rightmark}% <- changed

\ofoot*{\pagemark}

\usepackage{lipsum}

\begin{document}
\addchap{Introduction}
\lipsum[1-10]
\part{}
\chapter{The First Chapter}
\lipsum[1-10]
\part{}
\chapter{The Second Chapter}
\lipsum[11-30]
\part{}
Part not followed by a chapter
\lipsum[31-50]
\end{document}
0

When the parts have no names just invent some and use the number

\lehead{Part \thepart}

Or is that not what you want?

4
  • 1
    I would recommend the solution in Ulrike's comment (\lehead{\partname~\thepart}) instead, since it's more flexible (e.g. in combination with babel etc). – schoekling Mar 26 at 13:28
  • I agree but since the \part{} is empty you will only get the number. Maybe if you define \part[Part]{} will give you the output you would like to have. – MiMa Mar 27 at 17:34
  • No, that's what \partname is for.. – schoekling Mar 27 at 17:41
  • Ah my mistake I should have read it correctly :-) – MiMa Mar 27 at 21:20
0

As per Ulrike Fischer's comment, it's \lehead{\partname~\thepart}

MWE:

\documentclass[twoside, openright, headsepline, chapterpefix=true]{scrreprt}

\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles

\lehead{\partname~\thepart}
\rohead{\leftmark}

\ofoot[\pagemark]{\pagemark}

\usepackage{lipsum}

\begin{document}
\part{}
\chapter{The First Chapter}
\lipsum[1-10]
\part{}
\chapter{The Second Chapter}
\lipsum[11-30]
\end{document}

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.