Table of Contents Updating – How to Replace TOCStyle KOMAlike

table of contentstocstyleupdating

I have been using tocstyle up until now like this:

% table of content styling
\usepackage[tocindentauto]{tocstyle}
\usetocstyle{KOMAlike}
\settocstylefeature{pagenumberbox}{\hbox}

I understand that the recent version of KOMA-script remove the tocstyle package. But can't find what I should use as a replacement… Any help would be highly appreciated!

Thank you very much in advance!

edit: As per question of the bot: currently I get the error: ! LaTeX Error: File 'tocstyle.sty' not found. But I can't find anything showing me how to replace the tocsytle package to get the same layout that I currently have.

This is what it currently looks like:
table of contents

Best Answer

Unfortunaly there is no MWE in the question, so I do not know which class is used etc. Additionally, I do not know how the desired result looks like. So the following example is only a guess:

\documentclass{book}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[%
  entryformat=\bfseries\textsf,
  pagenumberformat=\bfseries\textsf,
]{tocline}{chapter}
\DeclareTOCStyleEntries[
  pagenumberbox=\hbox,
  dynnumwidth
]{tocline}{%
  chapter,section,subsection,subsubsection,paragraph,subparagraph,%
  figure,table
}
\DeclareTOCStyleEntries[
  dynindent
]{tocline}{subsection,subsubsection,subparagraph}

\begin{document}
\frontmatter
\tableofcontents
\chapter{Abstract}
\mainmatter
\chapter{Interesting chapter}
\section{A section}
\subsection{A subsection}

\cleardoublepage\setcounter{page}{1001}% only for large page number in the example

\chapter{Boring chapter}
\section{Boring section}
\end{document}

enter image description here