# How do I get multiple ToC entries on the same line with tocloft?

This question is almost a repeat of previous one : How do I get multiple ToC entries in the same line?. However, I need an answer using tocloft, not titletoc, since tocloft customization capabilities are better in my views that titletoc ones. Do you thing it is feasible with tocloft?

EDIT: Here is what I would like to get, the subsubsection in the book class are on the same line, with no numbering but with page numbers:

-
– lockstep Nov 15 '12 at 11:54
Yes, it is doable. What entries should be displayed in a paragraph style? – Gonzalo Medina Nov 15 '12 at 14:30
I need the subsubsection to be displayed in a paragraph style. I am currently playing with the etoolbox like in the question mentioned by lockstep, but I did not reach my target yet. – Martigan Nov 15 '12 at 18:22
And how should the entries be formatted? As in the example you linked in your question (i.e., no subsubsection number, only the title and the page number)? – Gonzalo Medina Nov 16 '12 at 1:43
I added an edit to show the effect I would like to get, and the format I would like. @GonzaloMedina – Martigan Nov 16 '12 at 14:03

Here's one possible solution, using a variation of the technique used in this answer to How to emulate titletoc with tocloft:

\documentclass{book}
\usepackage{etoolbox}

\newlength\rightmargintoc
\setlength\rightmargintoc{\linewidth}

\makeatletter
\def\subsubsectocline#1#2#3#4#5{%
\parshape 2  0em \rightmargintoc \dimexpr\parindent\relax \rightmargintoc
\@tempdima#3
\ifdim\lastskip=1sp\relax\ \else\par\fi{\small\itshape#4,~p.#5.}\hskip1sp%
}
\renewcommand*\l@subsubsection{\subsubsectocline{2}{0em}{3em}}
\makeatother

\begin{document}
\tableofcontents

\part{Test Part One}
\chapter{Test Chapter}
\section{Test Section One}
\subsection{Test Subsection One One}
\subsubsection{First Test Subsubsection}
\subsubsection{Second Test Subsubsection}
\subsubsection{Third Test Subsubsection}
\newpage
\subsubsection{Fourth Test Subsubsection}
\subsection{Test Subsection One Two}
\subsubsection{First Test Subsubsection}
\subsubsection{Second Test Subsubsection}
\subsubsection{Third Test Subsubsection}
\part{Test Part One}
\chapter{Test Chapter}
\section{Test Section One}

\end{document}


The resulting ToC:

-
Thank you very much, it is working great. I don't know why I did not succeed in adaptating your previous answer... There remains an issue, in the book class, with the parts in the toc. the part toc entry starts right after the last subsubsection item. Do you know why? I can add a phantom section and try to reduce vertical space, but it is quite ugly. @GonzaloMedina – Martigan Nov 17 '12 at 13:37
@Martigan there was a problem with my code that now I've fixed. Please try the improved version (delete the auxiliary files first) of my updated answer. – Gonzalo Medina Nov 17 '12 at 13:53
Thanks a lot. It is now working perfectly. @GonzaloMedina – Martigan Nov 17 '12 at 14:19