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

1

1 Answer 1

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.

0

You must log in to answer this question.

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