[Tex/LaTex] Remove dots from TOC, have page numbers right after titles

classicthesiskoma-scripttable of contents

When looking for some inspiration for how to come up with a template for my thesis, I came across the wonderful classicthesis package. Since I'm working on some very progressive material, however, I was more looking for a modernthesis kind of style and am now composing that for my own taste.

One thing I really like about classicthesis is that the page numbers appear right after section titles in the table of contents. I would also like to have that for my documents, which use KOMA-Script throughout. How can I do that?

Best Answer

You could use the tocstyle package which is distributed as part of KOMA-Script.

EDIT: The nopagecolumn style uses \normalfont for the page numbers of all sectioning levels; by disabling this for level 1 (section), page numbers will resemble titles (\sffamily\bfseries).

\documentclass{scrartcl}

\usepackage{tocstyle}
\usetocstyle{nopagecolumn}

% Disabling special font commands for sectioning level 1 (section)
\settocstylefeature[1]{pagenumberhook}{}

\begin{document}

\tableofcontents

\section{bla}

\subsection{blubb}

\section{foo}

\subsection{bar}

\end{document}

enter image description here