4

I use scrartcl and I want to …

  1. have list of figures and list of tables listed in the table of contents
  2. fill the space between sections and their pagenumbers with dots in the table of contents
  3. leave the rest of the table of contents unchanged.

So this is the desired output, generated using tocstyle (code below):

\documentclass[listof=totoc]{scrartcl}

% Problem: alpha version and warning.
\usepackage{tocstyle}
\newtocstyle[KOMAlike][leaders]{alldotted}{}
\usetocstyle{alldotted}

\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

Question: How can I get the same output without using tocstyle? I would like to avoid tocstyle because it always generates a warning that the package is an alpha version that may change in the future.

I would prefer a solution that is as minimal as possible, avoiding additional packages, manually adding LOF and LOT to the TOC, etc.

I already tried to use tocloft instead, but then other things break: Result with <code>tocloft</code>

\documentclass[listof=totoc]{scrartcl}

% Problem: LOF and LOT not in TOC; different font style for sections.
\usepackage{tocloft}
\renewcommand{\cftsecdotsep}{\cftdotsep}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}

\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

1 Answer 1

7

Use the option toc=sectionentrywithdots. Though the manual says it is a beta feature, no warnings are generated.

\documentclass[listof=totoc,toc=sectionentrywithdots]{scrartcl}  


\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

enter image description here

1
  • 1
    Great, thank you. I didn't expect such an easy solution. Actually, I had a look into scrguide myself, but unfortunately in an obviously outdated version (from 2011) – and at that time "sectionentrywithdots" did not yet exist.
    – CL.
    Apr 18, 2015 at 15:10

You must log in to answer this question.

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