based on this post I was able to customize the appearence of my table of contents. I am very pleased with the result exept for one small detail: The spacing between the ToC-entries.
I would like the entries to be closer together. A solution for standard chapters/parts etc. is something like \setlength{\cftbeforeXskip}
(probably more like \cftafterXskip
, to keep the spacing to previous entries?), but I don't quite understand how to apply this command to the new sectionstyle (chapterstar
).
Thank you for your help!
MWE:
\documentclass[12pt,a4paper,ngerman]{scrbook}
\usepackage[titles]{tocloft}
\usepackage{etoolbox}
\makeatletter
\let\l@chapterstar\l@chapter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\l@chapterstar}{\cftchapfont}{\cftchapstarfont}{}{}% Insert starred chapter font
\patchcmd{\l@chapterstar}{#2}{\cftchapstarpagefont #2}{}{}% Insert starred chapter page number font
\makeatother
\newcommand{\cftchapstarfont}{\cftchapfont\normalsize}
\newcommand{\cftchapstarpagefont}{\cftsecpagefont\normalsize}
%%%%%%%%%%%%%%%%%%%%% START BODY
\begin{document}
\tableofcontents
\chapter{Full Chapter 1}
\section{Section 1}
\section{Section 2}
\chapter{Full Chapter 2}
\addcontentsline{toc}{chapterstar}{StarChap1}
\chapter*{StarChap1}
\addcontentsline{toc}{chapterstar}{StarChap2}
\chapter*{StarChap2}
\end{document}
Edit: Thank you for improving the post, I thought I was posting within the specific Latex Stack-exchange.
Edit 2: I have updated the code (and image) to be a little more complex. As I have normal parts, chapters and subsections in my original document, but I just want to decrese the distance for the chapterstar entries, while keeping the other distances (such as the blue boxes) unchanged.