1

Setting:

I am writing a thesis, which consists of two parts that have to be completely independent from eachother but use the same structure, i.e. both contain for example a 'Data' chapter. Thus, chapters are numerated following the part number (Roman), e.g. Chapter I.3 or Chapter II.2. The MWE below does that and sets the headers (tribute to esdd, Part Number + Chapter in Header (scrlayer-scrpage)).

Problem:

Unfortunately, using this solution the table of contents is affected for higher part numbers (starting from II) in the way that spaces seem to vanish, e.g.: "II.2Heading on level 0" with the missing " " between "2" and "H". Is there a way to fix this?

Current output (toc):

Toc clash

Unfortunately, I am not well-versed in manipulating the toc (and adding '\ ' in front of all section and chapter names seems wrong), so I highly appreciate all help!

MWE:

\documentclass{book}

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

%headers setup
\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}

%adjust chapter names to include part number for uniqueness
\renewcommand\thechapter{\thepart.\arabic{chapter}} %following the suggestion of esdd

\begin{document}

\tableofcontents

\part{First part}
\blinddocument

\part{Second part}
\blinddocument

\end{document}
John A.
  • 15
  • 3

1 Answers1

0

One possibility is package tocbasic:

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

%headers setup
\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}

%adjust chapter names to include part number for uniqueness
\renewcommand\thechapter{\thepart.\arabic{chapter}} %following the suggestion of esdd

\usepackage{tocbasic}
\DeclareTOCStyleEntry[numwidth=2.3em]{tocline}{chapter}
\DeclareTOCStyleEntry[indent=2.3em,numwidth=2.8em]{tocline}{section}
\DeclareTOCStyleEntry[indent=5.1em,numwidth=3.7em]{tocline}{subsection}

\begin{document}
\tableofcontents
\part{First part}
\blinddocument
\part{Second part}
\blinddocument
\end{document}

enter image description here


Another possibility is package tocloft:

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

%headers setup
\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}

%adjust chapter names to include part number for uniqueness
\renewcommand\thechapter{\thepart.\arabic{chapter}} %following the suggestion of esdd

\usepackage[titles]{tocloft}
\setlength{\cftchapnumwidth}{2.3em}
\setlength{\cftsecindent}{2.3em}
\setlength{\cftsecnumwidth}{2.8em}
\setlength{\cftsubsecindent}{5.1em}
\setlength{\cftsubsecnumwidth}{3.7em}

\begin{document}
\tableofcontents
\part{First part}
\blinddocument
\part{Second part}
\blinddocument
\end{document}
esdd
  • 85,675