# Tocloft + KOMA, get rid of numberings in table of content, but keep them in the content and in other lists such as list of figures

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 and as well not in the other lists I will have (such as list of figures, list of terms, list of mentioned authors etc.) themselves.

There is already a similar question posed here, but now I would like to get a solution for this specific case. Here is a solutions, which disables all numberings in all lists by lockstep. But as mentioned above I need one, where I could specify it for each category of lists (list of figures, list of xxxx. etc.).

\documentclass{scrbook}

\usepackage{tocloft}

\usepackage{lipsum}

\makeatletter

% Without number and indentation
\renewcommand*{\numberline}[1]{}

\makeatother

\begin{document}

\tableofcontents
-

Before you redefine \numberline to do nothing (or more precisely, to gobble its argument), make a copy named, say, \oldnumberline. Then use the etoolbox package to patch the internal LaTeX macro \@caption (which is used for floats like figure and table) to use \oldnumberline instead of \numberline.

\documentclass{scrbook}

\usepackage{tocloft}

\usepackage{etoolbox}

\usepackage{lipsum}

\makeatletter
\let\oldnumberline\numberline
\patchcmd{\@caption}{\numberline}{\oldnumberline}{}{}
\renewcommand*{\numberline}[1]{}
\makeatother

\begin{document}

\tableofcontents

\listoffigures

\chapter{foo}

\section{foobar}

\subsection{foobargnu}

\lipsum

\begin{figure}
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{A figure}
\end{figure}

\end{document}

-