5

I can't use titletoc, since there are incompatibilities between this package and others that I am using. However, tocloft works fine. I would like to simulate the \titlecontents* effect using tocloft. How can I do this (main problem, of course, being having all the entries on the same line)?

\documentclass{report}
\usepackage{lipsum}
\usepackage{titletoc}
\titlecontents*{section}
    [1.5em] 
    {\small} 
    {\thecontentslabel. } 
    {}
    {, \thecontentspage} [\ \textbullet\ ][.]
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{A section}
\lipsum
\section{Another section}
\lipsum
\section{Yet another section}
\lipsum
\section{And another section}
\end{document}

output of code

EDIT: When I try to run titletoc on my file (without providing the class, which is quite long to analyse, it is meaningless to put a MWE), I get an error code like this one:

\GenericError  ...                                
\endgroup  \addpenalty ...kipb \fi \fi \fi \else \@noitemerr 
\fi  \l@chapterifnoframe ...ddpenalty {-\@highpenalty }
\vskip 1.0em \@plus \p@ \s... l.14 ...ine {chapter}{\numberline {B}Chapter 2}{5}

It is of course highly unspecific, and the l.14 in my code is a line not linked to any kind of title or table of content matter... That is why I leaned toward finding a way with tocloft...

EDIT 2 : here is a link to the class (which is book-derived): http://www.loria.fr/~roegel/TeX/TL.tar.gz. I warn you, this might not be easy to see where it fails...

EDIT 3 : The problem only appears when I am using this on subsection or subsubsection... It works fine with section. Any idea why?

6
  • Can you add a minimal working example please? Nov 6, 2011 at 15:30
  • @Marco I think Martigan is assuming some familiarity with titletoc. I've added a MWE to make the question clearer.
    – Alan Munn
    Nov 6, 2011 at 22:52
  • 2
    I don't think this is very easy to do with tocloft at all. Perhaps you could explain the problems you encountered with titletoc? Maybe there are ways around them?
    – Alan Munn
    Nov 7, 2011 at 1:31
  • Thank you Alan for the clarification. It is exactly the effect I am aiming to. The problem with titletoc is a very tricky one to analyse, since I am using a special class (book-based) with many special custom macro, and that I did not make. I had been trying to find the issue, but to no avail for now. Since tocloft is working perfectly, I wanted to try it. I will try to post something about the issue encountered with titletoc, for it might give advanced users an inkling of what could be the cause, but I am not very confident.
    – Martigan
    Nov 7, 2011 at 11:57
  • 2
    @Martigan when I compile the example above using the thloria class, it compiles without error. So the error you are getting isn't caused directly by the class+titletoc. To solve this problem you'll need to gradually add packages to this example to see when things break.
    – Alan Munn
    Nov 8, 2011 at 12:49

0

Browse other questions tagged .