#StackBounty: #table-of-contents #koma-script #indentation #tocbasic KOMA toc equal numsep with exact indentation

Bounty: 50

I’m trying to format the toc, but I stuggle with the horizontal spacing and indentation.

  1. The chapter and part headings should have a minimum numsep of 1em for the longest number while also being equal for all other numbers.
  2. When using dynnumwidth to achive equal seperation for all toc levels, the indentation of sections and subsections is different. They should be flush with the heading of the level above, but adjusting them manually does not give exact results.
  3. Is there a way to adjust the distance after a part heading?

enter image description here

MWE:

documentclass[10pt, oneside, numbers=noenddot, listof=totoc, toc=indentunnumbered]{scrbook}
usepackage[osf]{newpxtext}
usepackage{microtype}
usepackage[left=32.5mm, right=25mm, top=25mm, bottom=20mm]{geometry} 

renewcommand*{thepart}{scshaperoman{part}}

addtokomafont{chapterentry}{normalfontlsstylescshape}
addtokomafont{partentry}{normalsizenormalfontlsstylescshape}

DeclareTOCStyleEntries[raggedpagenumber=true, linefill=qquad, pagenumberbox=mbox]{tocline}{part, chapter, section, subsection}
DeclareTOCStyleEntry[beforeskip=1em plus 1pt]{tocline}{part}

DeclareTOCStyleEntries[numsep=1em, dynnumwidth]{tocline}{part, chapter}
DeclareTOCStyleEntries[dynnumwidth, numsep=1em, indent=2em]{tocline}{section}
DeclareTOCStyleEntries[dynnumwidth, numsep=1em]{tocline}{subsection}


begin{document}

tableofcontents
listoffigures
listoftables
chapter{test}
part{test}
chapter{test}
    section{Test}
        subsection{Test}
part{test}
part{test}

end{document}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.