2

I am using the documentclass scrbook (KOMA) with tocloft and would like to get rid of all the numberings of the chapters, sections and subsections in the table of content, but not in the content itself. How can I do that? I searched a lot, but couldn't find anything.

I tried

 \renewcommand{\thechapter}{}

but then all the numberings will disappear...

3

You could simply redefine the LaTeX/scrbook macro \numberline which is responsible for typesetting the number in \contentsline. (Sectioning entries in the header/footer will keep their number.)

\documentclass{scrbook}

\usepackage{tocloft}

\usepackage{lipsum}

\makeatletter

% Original LaTeX definition
% \def\numberline#1{\hb@xt@\@tempdima{#1\hfil}}

% scrbook definition
% \renewcommand*{\numberline}[1]{%
%   \numberline@box{%
%     \numberline@prefix\numberline@numberformat{#1}\numberline@postfix
%   }%
% }

% Variant A -- without number, but with indentation
% \renewcommand*{\numberline}[1]{%
%   \numberline@box{%
%     \numberline@prefix\numberline@numberformat{}\numberline@postfix
%   }%
% }

% Variant B -- without number and indentation
\renewcommand*{\numberline}[1]{}

\makeatother

\begin{document}

\tableofcontents

\chapter{foo}

\section{foobar}

\subsection{foobargnu}

\lipsum

\end{document}
  • I have a follow up problem described here. – algomachine Apr 12 '12 at 11:04
0

Since KOMA-Script Version 3.20 (current on CTAN) it is possible to remove the entry numbers in TOC using \RedeclareSectionCommands.

\documentclass{scrbook}[2016/05/10]
\usepackage{lipsum}

\newcommand\remove[1]{}

\RedeclareSectionCommands[
  %tocindent=0pt,% if the indentation should also be removed
  tocnumwidth=0pt,
  tocentrynumberformat=\remove
]{part,chapter,section,subsection,subsubsection}


\begin{document}
\tableofcontents

\chapter{foo}
\section{foobar}
\subsection{foobargnu}
\lipsum
\end{document}

enter image description here enter image description here

And with tocindent=0pt

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.