0

I am new to this forum, but I try to make my problem as clear as possible and hope someone can help me out. If anything in my question can be improved for a better understanding, please let me know and I will try to fix it.

I am writing a thesis, which consists of two parts (Roman numbering for parts) that have to be completely independent from eachother but use the same structure, i.e. both contain for example a 'Data' chapter. Whilst this is acceptable in the toc, it is a bit confusing regarding the headers.

Let's say I have section 3: "Weather Reports" of chapter 2: "Data" of part I: "Weather in Brazil". The code below (if my MWE is setup correctly) produces on a left page the header: [2.3 Weather Reports] and on the right page [Chapter 2. Data].

Is there a way to change this to include the part (number) for a clearer structure? An example would be [I.2.3 Weather Reports] and [Chapter I.2. Data]. Although, I am definitely open to alternative suggestions as I do not know what is possible here.

Note: There might be easier solutions using fancyhdr, but if possible I would like to stick with scrlayer-scrpage to not being forced to change everything shortly before my deadline.

Thanks for any kind of help!

Best, John

A MWE for my current headers (based on a template I am using):

\documentclass{book}
\usepackage[markcase=used]{scrlayer-scrpage}

\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles
\automark[chapter]{chapter}
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
}
\ifoot{}
\ofoot{}
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
\ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}

\begin{document}
Text Text Text
\end{document}

1 Answer 1

0

Redefine \chaptermarkformat and \sectionmarkformat to your needs. Example:

\renewcommand\chaptermarkformat{\chaptername\ \thepart.\thechapter\enskip}
\renewcommand\sectionmarkformat{\thepart.\thesection\enskip}

enter image description here

Code:

\documentclass{book}
\usepackage[markcase=used]{scrlayer-scrpage}
\renewcommand\chaptermarkformat{\chaptername\ \thepart.\thechapter\enskip}
\renewcommand\sectionmarkformat{\thepart.\thesection\enskip}
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles
\automark[chapter]{chapter}
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
}
\ifoot{}
\ofoot{}
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
\ifoot[\today]{\today}
}
\pagestyle{thesis}
%\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}% \ifbool is not defined in this MWE

\usepackage{blindtext}% dummy text
\begin{document}
\part{First part}
\blinddocument
\part{Second part}
\blinddocument
\end{document}
7
  • Follow-up, if I refer to a certain section of my document, is there also a way to refer to it as "see section I.2.3" instead of "see section 2.3" (e.g. \autoref{sec:Weather_pt1}, with the corresponding label set)?
    – John A.
    Jan 30, 2018 at 18:07
  • Maybe then it is easier to include the part number in all chapter, section etc. numbers? \renewcommand\thechapter{\thepart.\arabic{chapter}}?
    – esdd
    Jan 30, 2018 at 18:39
  • This works great for part 1, but somehow messes up in part 2 as the spaces disappear: "I.2 Data" but "II.2Data". Otherwise, this would work for my purposes. Do you know a way to handle this? Thank you very much already!
    – John A.
    Jan 30, 2018 at 18:44
  • In the table of contents or in the document?
    – esdd
    Jan 30, 2018 at 19:02
  • Indeed only in the table of contents
    – John A.
    Jan 30, 2018 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .