the spacing has nothing to do with the number of entries in the toc, but in the number of digits in the page number.
in most document classes, there is a box of fixed width assigned for the page number.
it looks like you are using a class designed for a article of fewer than 100 pages in length, because as soon as the page number exceeds two digits, it fills the space available. to test this, you could artificially reset the page number as \setcounter{page}{999}
and see what happens when it exceeds a thousand. depending on the definition, it will either extend to the right (with an overfull hbox warning in the log, and a black mark if you have applied the [draft]
option to the \documentclass
line), or overprint the end of the entry text to the left.
to fix this, it's probably easiest to use one of the packages intended for modification of the toc format, although i'd also take a look into the document class itself and consider increasing the capacity of the field that formats the page number to allow more digits. since in the format shown the page numbers are not flush right, perhaps simply adding a space of fixed width at the beginning of the page number and setting the number flush left to that space is what you want -- you didn't show any one-digit page numbers, so there's no clue as to what you prefer, other than an assurance that you do want some separation.
Update
With the current KOMA-Script Version 3.20 new styles for toc entries can be easily declared. So you can define an own style for unnumbered chapters with more vertical space before.
\documentclass[
final,
paper=a4,
listof=totoc,
bibliography=totoc,
captions=tableheading,
numbers=noenddot,
headings=big,
chapterprefix=false
]
{scrreprt}[2016/05/10]% needs version 3.20 or newer
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage[backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}% example bibdatei
\RedeclareSectionCommand[
tocbeforeskip=1.25em plus 1pt
]{part}
\addtokomafont{partentry}{\color{red!70!black}}
\RedeclareSectionCommand[
tocbeforeskip=0pt plus .2pt,
]{chapter}
\DeclareTOCStyleEntry[
beforeskip=.75em plus 1pt,
level=0,
indent=0pt,
numwidth=0pt,
]{chapter}{unnumberedchapter}
\renewcommand\addchaptertocentry[2]{%
\ifstr{#1}{}
{\addtocentrydefault{unnumberedchapter}{#1}{#2}}
{\addtocentrydefault{chapter}{#1}{#2}}
}
%\usepackage{hyperref}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\cleardoubleoddpage
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\blinddocument
\nocite{westfahl:space}% nur für Beispielbibliography
\printbibliography
\addpart{Additional Stuff}
\end{document}
Original answer
Here is a suggestion using package tocstyle
that is an alpha version but part of the KOMA-Script bundle. It works also with \addpart
.
\documentclass[
final,
paper=a4,
listof=totoc,
captions=tableheading,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false
]
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{xcolor}% <- load this package before tocstyle
\usepackage{tocstyle}
\newtocstyle
[KOMAlike]% parent style
[entryvskip]% exclude the initial vertical skip
{myown}% name of the new style
{%
\settocstylefeature[-1]{entryvskip}{12pt}% set the vertical skip before a part entry
%\settocstylefeature[0]{entryvskip}{2pt}% set the vertical skip before a chapter entry
}
\usetocstyle{myown}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\cleardoubleoddpage
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\blinddocument
\addpart{Additional Stuff}
\end{document}
Run several times to get
Another possibility is redefining \addparttocentry
and \addchaptertocentry
but then there could be page breaks at unfavorable points.
\documentclass[
final,
paper=a4,
listof=totoc,
captions=tableheading,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false
]
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{hyperref}
\renewcommand\addparttocentry[2]{%
\addtocontents{toc}{\protect\vspace{-4ex}}%
\addtocentrydefault{part}{#1}{#2}%
}
\renewcommand\addchaptertocentry[2]{%
\addtocontents{toc}{\protect\vspace{-2ex}}%
\addtocentrydefault{chapter}{#1}{#2}%
}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\cleardoubleoddpage
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\blinddocument
\addpart{Additional Stuff}
\end{document}
Result:
Best Answer
The memoir manual says on page 156 that
In order to get a fixed width after the part number, we have to get rid of the box and insert some whitespace (1em in this example) after the number. We do so by renewing
\partnumberlinebox
:Now the MWE looks like this: