1

How to remove the section number ("1" in the example below) in the toc of scrartcl?

  • it does not matter if the section number is or is not stated in the text (I already know how to remove it there).

  • I know, I could use a starred section and manually add it to the toc, but in my real document, I use them for something else with a different format

MWE:

\documentclass{scrartcl}

\KOMAoption{sectionentrydots}{true} \renewcommand*{\sectionformat}{}

\begin{document}

\tableofcontents

\section{non-star section}

\end{document}

enter image description here

  • Related (but maybe not same): https://tex.stackexchange.com/q/197991, https://tex.stackexchange.com/q/192902, https://tex.stackexchange.com/q/171831, https://tex.stackexchange.com/q/193767 – Schweinebacke Oct 10 '18 at 10:13

1 Answers1

3

Maybe you want something like

\documentclass{scrartcl}
\RedeclareSectionCommand[
  toclinefill=\TOCLineLeaderFill,
  %tocnumwidth=0pt,
  tocentrynumberformat=\gobbleentrynumber
]{section}
\newcommand*\gobbleentrynumber[1]{}

\renewcommand*{\sectionformat}{}

\begin{document}
\tableofcontents
\section{non-star section}
\end{document}

enter image description here

Or if you uncomment tocnumwidth=0pt:

enter image description here

But I would use

\documentclass{scrartcl}

\KOMAoptions{
  sectionentrydots=true,
  toc=indenttextentries
}

\begin{document}
\tableofcontents
\addsec{non-star section}
\end{document}

with or without toc=indenttextentries.

esdd
  • 85,675