2

According to Robert Bringhurst (Elements of Typographical Style), leaders in a table of contents is unsightly. This question asks about one better way to set the table of contents.

Another way, even closer to TeX's default, is to have a small space (perhaps 2em) after the section title, and then set the number right afterwards. Bringhurst does this in the actual contents of his book (picture below).

Curiously enough, tocloft doesn't seem to support this style directly. Am I wrong in believing this? Or is there another package which enables this?

Example of typographical style desired: page numbers not flush right

4

It's possible with tocloft. The example also takes care of the section numbers:

\documentclass[openany]{book}
\usepackage{tocloft}
\usepackage{color}

\renewcommand*{\cftchappresnum}{\hss\color{red}}
\renewcommand*{\cftchapaftersnum}{\hspace{.5em}}

\settowidth{\cftchapindent}{\cftchapfont 99\cftchapaftersnum}
\setlength{\cftchapnumwidth}{0pt}

\renewcommand*{\cftchapleader}{\hspace{1em}}
\renewcommand*{\cftchapafterpnum}{\cftparfillskip}
\renewcommand*{\cftpnumalign}{l}

\begin{document}
\tableofcontents

\chapter*{Forword}
\addcontentsline{toc}{chapter}{Forword}
\setcounter{page}{9}

\chapter*{Historical Synopsis}
\addcontentsline{toc}{chapter}{Historical Synopsis}
\setcounter{page}{12}

\chapter{Rhytm \& Proportion}
\setcounter{page}{25}

\chapter{Harmony \& Counterpoint}
\setcounter{page}{45}

\chapter{Structural Forms \& Devices}
\setcounter{page}{61}

\chapter{Analphabetic Symbols}
\setcounter{page}{75}

\chapter{Choosing \& Combining Type}
\setcounter{page}{93}

\chapter{Historical Interlude}
\setcounter{page}{119}

\chapter{Shaping the Page}
\setcounter{page}{143}

\chapter{The State of the Art}
\setcounter{page}{179}

\chapter{Grooming the Font}
\setcounter{page}{198}

\chapter{Prowling the Specimen Books}
\setcounter{page}{209}

\end{document}

Result

  • Since this seem to be a manual TOC I think this should be made in the final stage when there are no more correction than can change the page numbers of each chaper, section and so on, isn't it? – Aradnix Sep 22 '14 at 23:20
  • @Aradnix It's about the layout of the table of contents. Therefore it does not matter, how the entries are generated. Of course, the part after \tableofcontents would be generated by the real contents, in this case more than 209 pages. Much too large for a (minimal) example. – Heiko Oberdiek Sep 22 '14 at 23:56
  • I understand it, but I never said nothing about the real contents or the entries. Now I need to run an example to see if this manual edition of the layout of the table of contents don't breaks the automation of the \tableofcontents. – Aradnix Sep 23 '14 at 0:08
1

Using the titletoc package (a companion of titlesec), this is possible using a command similar to the following:

\titlecontents{chapter}[0pt]{}%
{\contentslabel{2.25em}}{}%
{\hspace{2em}\thecontentspage}

In order, the parameters represent:

  • The section type
  • The indentation before the
  • Any code for global formatting of the entry
  • The label if the section is numbered
  • The label if the section is unnumbered
  • The code to display the page number, including any space before it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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