I really enjoy the table of contents formatting (all sections of a chapter in a single paragraph), of the Motion Mountain's physics books. Does anyone know how to reproduce that kind of style? Is there a LaTeX package for managing TOC styles?

BTW, I need to use XeLaTeX, and it seems to exist an incompatibility between 'fontspec' and 'titletoc'.

-

The tocloft and titletoc packages let you customize the table of contents. In your case, the second package could be a better choice: the starred version of \titlecontents groups the entries in a single paragraph.

Here's a little example (of course, feel free to adapt it according to your needs):

\documentclass{scrbook}
\usepackage{titletoc}

{\llap{\makebox[3em]{\oldstylenums{\thecontentspage\hfill\thecontentslabel}}\hskip1em}
\small\scshape\vskip-\baselineskip}{}{}{}
\titlecontents*{section}[20pt]
{\upshape}{}{}
{, \oldstylenums{\thecontentspage}}[][\ \textbullet\ ][]

\begin{document}

\tableofcontents
\chapter{Test chapter one}
\section{Test section one one}
\section{Test section one two}
\section{Test section one three}
\section{Test section one four}
\section{Test section one five}
\chapter{Test chapter two}
\section{Test section two one}
\section{Test section two two}
\section{Test section two three}

\end{document}


The resulting ToC:

EDIT: as Alan Munn noticed in a comment, the above example fails to compile with fontspec and xelatex, due to the \addvspace{15pt} command in the first optional argument of \titlecontents{chapter}; a possible workaround would be to introduce the vertical skip in the second mandatory argument of \titlecontents:

\documentclass{scrbook}
\usepackage{fontspec,xltxtra}
\usepackage{titletoc}

\titlecontents{chapter}[0pt]
{\vskip15pt\llap{\makebox[3em]{\oldstylenums{\thecontentspage\hfill\thecontentslabel}}\hskip1em}
\small\scshape\vskip-\baselineskip}{}{}{}
\titlecontents*{section}[20pt]
{\upshape}{}{}
{, \oldstylenums{\thecontentspage}}[][\ \textbullet\ ][]

\begin{document}

\tableofcontents
\chapter{Test chapter one}
\section{Test section one one}
\section{Test section one two}
\section{Test section one three}
\section{Test section one four}
\section{Test section one five}

\chapter{Test chapter two}
\section{Test section two one}
\section{Test section two two}
\section{Test section two three}

\end{document}

-
Nice... But it seems to be incompatible with fontspec and xelatex? For example, by adding: \usepackage{fontspec,xltxtra} \setmainfont[Mapping=tex-text]{Hoefler Text} –  Hugo S Ferreira Jul 31 '11 at 2:12
–  Hugo S Ferreira Jul 31 '11 at 2:19
@Hugo S Ferreira: indeed, there seems to be an incompatibility and I don't know a workaround. I'll try to think of something. Perhaps you should add the information to your question (about you using XeLaTeX and fontspec). –  Gonzalo Medina Jul 31 '11 at 2:28
@Hugo Interestingly, it doesn't work even if I remove the titletoc stuff. Without a bug report (please, do) it's difficult to say where the problem is. As to the link, note it says \vspace{3px} and the error is what you could expect, since px is not a unit in TeX or XeTeX. –  Javier Bezos Aug 5 '11 at 14:26
The error is caused by the \addvspace{15pt} command in the \titlecontents{chapter} command. That's the minimal document that fails. –  Alan Munn Aug 8 '11 at 17:01