# scrlayer-scrpage: “Part No.” in header

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

\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}

• 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

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}
\clearpairofpagestyles

\ofoot*{\pagemark}

\usepackage{lipsum}

\begin{document}
\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}


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

\lehead{Part \thepart}


Or is that not what you want?

• 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

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

MWE:

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

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

\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}