TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

This is how the original TOC looks.

This original format of the table of contents takes too much space. I wanted some format that is compact and found this sample.

I am also searching for other nicer looking formats that are compact. For example

enter image description here

share|improve this question
2  
I suppose the non-numbered items correspond to unnumbered sections in the body of the book? What is your question? – Bernard Feb 26 at 12:45
    
nope the structure of TOC – bgr95 Feb 26 at 12:50
    
On which criteria are some items numbered and others not, then? – Bernard Feb 26 at 12:52
    
Actually I am not worried about the numbering I added some image that will just reflect my requirement. I am OK with any compact toc format. Currently my table of contents takes some 4 pages and the the work is not even half complete – bgr95 Feb 26 at 12:55
up vote 20 down vote accepted

The titletoc can achieve this though the \titlecontents command. The starred version places all the titles on the same paragraph.

The command isn't the most user friendly to use, so I tried to annotate as best as I could.

\documentclass{book}

\usepackage{titletoc}
\titlecontents{chapter}             % Section
  [0em]                             % Left
  {\vspace*{\baselineskip}}         % Above code
  {\bfseries\thecontentslabel\quad} % Numbered format
  {}                                % Numberless format
  {\quad\thecontentspage}           % Filler
  []                                % Separator
\titlecontents*{section} % Section
  [0em]                  % Left
  {\space}               % Above code
  {\thecontentslabel~}   % Numbered format
  {}                     % Numberless format
  {}                     % Filler
  [.\space]              % Separator
\titlecontents*{subsection} % Section
  [0em]                     % Left
  {\space}                  % Above code
  {}                        % Numbered format
  {}                        % Numberless format
  {}                        % Filler
  [.\space]                 % Separator

\begin{document}

\tableofcontents

\clearpage

\chapter{Introduction}

\chapter{The Principle of Locality in Classical Physics and the Relativity Theories}

\subsection{Faraday's vision}
\subsection{Fields}

\section{Special relativity}

\subsection{Poincar\'e group}
\subsection{Lorentz group}
\subsection{Spinors}
\subsection{Conformal group}

\section{Maxwell theory}

\section{General Relativity}

\chapter{Poincar\'e Invariant Quantum Theory}

\section{Geometric symmetries in quantum physics}
\subsection{Projective representations and the covering group}

\section{Wigner's analysis of irreducible, unitary representation of the Poincar\'e group}

\section{Single particle states}
\subsection{Spin}

\section{Many particle states: Bose--Fermi alternative, Fock space, creation operators}
\subsection{Separation of CM-motion}
\end{document}

output

An important thing to note is that due to the way the table of contents is generated, LaTeX struggles to create line breaks. In order to allow line breaks between successive elements, I have added \space in the above code and also in the separator. Do not use ~ as this is creates a space that cannot break across lines. The only time I have used ~ is between the a section's number and its title in order to avoid:

... Faraday's vision. Fields. 2.1

Special relativity. Poincare ...

share|improve this answer

The memoir class helps with this. For example look at A Few Notes on Book Design (texdoc memdesign) where the subsubsections under each chapter in the ToC are set as a single paragraph. This document used the memoir class using the memoir macro \setupparasubsecs. You can use this, as well as many other memoir facilities, as a basis for configuring your compressed ToC.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.