3

I'm using tocstyle in my document:

% table of contents customizations:
\usepackage{tocstyle}
\usetocstyle{standard}
\settocfeature{raggedhook}{\raggedright}
\settocfeature{leaders}{\hfill}

Which gives me this warning:

Writing index file book.idx
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/tocstyle.sty

Package tocstyle Warning: THIS IS A DEPRECATED ALPHA VERSION!
(tocstyle)                USAGE OF THIS VERSION IS ON YOUR OWN RISK!
(tocstyle)                EVERYTHING MAY HAPPEN!
(tocstyle)                THE PACKAGE IS FROZEN WITH ALL IT'S BUGS!
(tocstyle)                IT WILL BE REMOVED FROM KOMA-SCRIPT SOON!
(tocstyle)                THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE!
(tocstyle)                Maybe it would be better, not to load this package.

What should I use instead?

3
  • 3
    As suggested by the author of tocstyle on its CTAN page, "tocbasic and scrwfile should be used instead". Aug 6, 2020 at 3:18
  • 1
    Another possibility could be tocloft Aug 6, 2020 at 3:44
  • 3
    Although you should not use tocloft when using a KOMA class. In that case, tocbasic is a much better fit (and also inherits some of the tocstyle design choices).
    – TeXnician
    Aug 6, 2020 at 6:58

1 Answer 1

3

With a KOMA-Script class you should use tocbasic. Note that the KOMA-Script class loads tocbasic automatically.

Example:

\documentclass{scrreprt}[2020/07/22]% needs KOMA-Script version 3.31
\usepackage{blindtext}% only for dummy text

\DeclareTOCStyleEntries[
  raggedentrytext,
  linefill=\hfill,
  numwidth=0pt,
  numsep=1ex,
  dynnumwidth
]{tocline}{chapter,section,subsection,subsubsection,paragraph,subparagraph}
\DeclareTOCStyleEntries[
  indent=0pt,
  dynindent
]{tocline}{section,subsection,subsubsection,paragraph,subparagraph}
\setkomafont{chapterentry}{\bfseries}

\begin{document}
\tableofcontents
\blinddocument
\blinddocument
\section{\blindtext}
\end{document}

Run three times to get:

enter image description here

With a standard class you can use package tocbasic.

Example:

\documentclass{report}
\usepackage{blindtext}% only for dummy text

\usepackage{tocbasic}[2020/07/22]% needs KOMA-Script version 3.31
\DeclareTOCStyleEntries[
  raggedentrytext,
  linefill=\hfill,
  numwidth=0pt,
  numsep=1ex,
  dynnumwidth
]{tocline}{chapter,section,subsection,subsubsection,paragraph,subparagraph}
\DeclareTOCStyleEntries[
  indent=0pt,
  dynindent
]{tocline}{section,subsection,subsubsection,paragraph,subparagraph}
\DeclareTOCStyleEntry[indentfollows=chapter]{tocline}{section}
\DeclareTOCStyleEntry[indentfollows=subsubsection]{tocline}{paragraph}

\begin{document}
\tableofcontents
\blinddocument
\blinddocument
\section{\blindtext}
\end{document}

Run three times to get:

enter image description here

You must log in to answer this question.

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