# How to create this kind of TOC?

There are chapters, sections, and subsections. Subsections are not numbered. I want the TOC to look like this, that is, to squeeze all subsections into one or more lines:

How do I do that? Basically, I am using KOMA-Script -- if that helps answering the question. I created this mock-up in Word.

• What should be taken into account? The dot spacing? Or only the numbering scheme? – Skillmon Aug 17 '17 at 12:04
• The picture represents the requirements. Although, fonts and spacing are supportive only. – Marcel Taeumel Aug 19 '17 at 10:14
• So my answer is enough to get you where you need to be? – Skillmon Aug 19 '17 at 10:29

The following is a hacky way and does have its limitations at the moment. I'm trying to fix these in the future. Some of the limitations are visible in the image below. But the ToC comes yours pretty close I think.

\documentclass[numbers=enddot]{scrreprt}

%\setcounter{secnumdepth}{1} % not necessary anymore

\newdimen\ssectocindent\ssectocindent=1.5cm
\makeatletter
\RedeclareSectionCommand[%
toclinefill=\section@dotfill,%
tocpagenumberbox=\hbox]
{section}
\RedeclareSectionCommand[%
toclinefill=\chapter@dotfill,%
tocpagenumberbox=\hbox]
{chapter}
\newcommand*{\chapter@dotfill}{%
\newcommand*{\section@dotfill}{%
\def\l@subsection#1#2{%
\def\numberline##1{}%
$\cdot$ % this is the delimiting dot, change it to your liking
\else%
\par%
\hangindent\ssectocindent%
\parindent\ssectocindent%
\rightskip\ssectocindent%
\fi#1}
\makeatother

\begin{document}
\tableofcontents

\chapter{Foo}
\section{Bar}
\subsection{Baz}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\section{Bar}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}

\chapter{Foo}
\section{Bar}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\section{Bar}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}
\subsection{Baz}
\subsection{Baz2}
\subsection{Baz3}

\end{document}