[Tex/LaTex] How to reproduce this beautiful table of contents

table of contents

I stumbled upon this TOC today:

The sample TOC

I really like its structure and simplicity. The page numbers are right behind the entries, and not unnecessarily remote as they often are. The separation between chapter numbering on the left and titles on the right clearly sets the two apart.

I would like to reproduce this design for a book, but have no idea where to start. Can you show me how to reproduce this?

Bonus
Do you have any idea how this could be extended to also list sections, and remove the authors?

Best Answer

pretty toc

Use etoc.

The update enables sections in the TOC (see below for the first answer). Furthermore, it uses \chaptername, \partname (available in the book class) for internationalization. And it uses a non-breakable space before the page number.

pretty toc with sections

\documentclass{book}
\usepackage{etoc}
\etocsetlevel{authors}{1}
\etocsetlevel{section}{2}
\etocsetlevel{subsection}{3}
\etocsettocdepth{section}
\newcommand{\authorstotoc}[1]{\etoctoccontentsline{authors}{#1}}

\newlength{\tocleft}
\setlength{\tocleft}{3cm}

\newlength{\tocsep}
\setlength{\tocsep}{2em}


\etocsetstyle{part}{}{}{{\bfseries\makebox[0pt][r]
                              {\partname\ \etocnumber\hspace{\tocsep}}%
                     \etocname\kern1em\relax\etocpage\par}\vspace{3ex}}{}

% to avoid possible line breaks between chapter (or part) name and page number
% replace \quad by \kern1em\relax

\etocsetstyle{chapter}{}{}{\etocifnumbered
                             {\makebox[0pt][r]
                               {\chaptername\ \etocnumber\hspace{\tocsep}}}
                             {\ifcase\TEMP
                              \def\TEMP{1}\or\def\TEMP{2}%
                              \makebox[0pt][r]
                                  {\parbox[t]{\dimexpr\tocleft-\tocsep\relax}
                                   {\raggedleft Introductory\\ \strut \chaptername}%
                                   \hspace{\tocsep}}\fi
                              }\textbf{\etocname\kern1em\relax\etocpage}\par
                             \etocifnumbered{}{\vspace{2ex}}}{}

\etocsetstyle{authors}{}{}{\etocname\par\vspace{1ex}}{\vspace{2ex}}

\etocsetstyle{section}{}{}{\makebox[0pt][r]{\etocnumber\hspace{\tocsep}}%
                           \etocname\kern1em\etocpage\par}{}

\etocsettocstyle {\noindent\sffamily{\LARGE \contentsname}\par
                  \thispagestyle{empty}%
                  \noindent\rule{\dimexpr\tocleft-\tocsep}{1pt}\par\vspace{3ex}%
                  \leftskip\tocleft\parindent0pt\def\TEMP{0}}{}

\begin{document}
\frontmatter

\tableofcontents

\chapter{Preface}

\mainmatter

\chapter*{A Few Words About Systems Engineering}
\addcontentsline{toc}{chapter}{A Few Words About Systems Engineering}

\part{Systems Engineering Practice}

\chapter{Methodology for an integrated Definition of a System and its
  Subsystems: The Case-Study of an Airplane and its Subsystems}

\authorstotoc{Sergio Chiesa, Marco Fioriti and Nicole Viola}

\section{This is a section}

\section{This is another section}

\chapter{Complex-Systems Design Methodology for Systems-Engineering
  Collaborative Environment}

\authorstotoc{Guido Ridolfi, Erwin Mooij and Sabrina Corpino}

\section{Another section}

\section{One more section}

\chapter*{A Few Words About Systems Engineering}
\addcontentsline{toc}{chapter}{A Few Words About Systems Engineering}

\section*{An unnumbered section}
\addcontentsline{toc}{section}{An unnumbered section}

\end{document}

Earlier code, for the TOC without sections:

\documentclass{book}
\usepackage{etoc}
\etocsetlevel{authors}{1}
\etocsetlevel{section}{2}
\etocsettocdepth{authors}
\newcommand{\authorstotoc}[1]{\etoctoccontentsline{authors}{#1}}

\newlength{\tocleft}
\setlength{\tocleft}{3cm}

\newlength{\tocsep}
\setlength{\tocsep}{2em}


\etocsetstyle{part}{}{}{{\bfseries\makebox[0pt][r]
                              {Part \etocnumber\hspace{\tocsep}}%
                     \etocname\quad\etocpage\par}\vspace{3ex}}{}

% to avoid possible line breaks between chapter (or part) name and page number     
% replace \quad by \kern1em\relax

\etocsetstyle{chapter}{}{}{\etocifnumbered
                             {\makebox[0pt][r]
                               {Chapter \etocnumber\hspace{\tocsep}}}
                             {\ifcase\TEMP
                              \def\TEMP{1}\or\def\TEMP{2}%
                              \makebox[0pt][r]
                                  {\parbox[t]{\dimexpr\tocleft-\tocsep\relax}
                                   {\raggedleft Introductory\\ \strut Chapter}%
                                   \hspace{\tocsep}}\fi
                              }\textbf{\etocname\quad\etocpage}\par
                             \etocifnumbered{}{\vspace{2ex}}}{}

\etocsetstyle{authors}{}{}{\etocname\par\vspace{2ex}}{}

\etocsettocstyle {\noindent\sffamily{\LARGE \contentsname}\par
                  \thispagestyle{empty}%
                  \noindent\rule{\dimexpr\tocleft-\tocsep}{1pt}\par\vspace{3ex}%
                  \leftskip\tocleft\parindent0pt\def\TEMP{0}}{}

\begin{document}
\frontmatter

\tableofcontents

\chapter{Preface}

\mainmatter

\chapter*{A Few Words About Systems Engineering}
\addcontentsline{toc}{chapter}{A Few Words About Systems Engineering}

\part{Systems Engineering Practice}

\chapter{Methodology for an integrated Definition of a System and its
  Subsystems: The Case-Study of an Airplane and its Subsystems}

\authorstotoc{Sergio Chiesa, Marco Fioriti and Nicole Viola}

\chapter{Complex-Systems Design Methodology for Systems-Engineering
  Collaborative Environment}

\authorstotoc{Guido Ridolfi, Erwin Mooij and Sabrina Corpino}

\end{document}