I would like to know if it's possible to have a Table of Contents looking like the following, where the number of the page is the big number on the left.
The sections could look like in the following "uggly-font-formatted" example. If someone has a better idea for the sections and subsections…
Best Answer
Here's a solution with a redefinition of the
\chapter
command (as implemented inbook.cls
) using\parbox
es and theleftbar
environment from theframed
package:The first
\parbox
will contain the page number; I just reserved space for two-digit numbers (3.5em
); for three-digit numbers, the width of this box will have to be increased, and that of the third\parbox
will have to be decreased in the same amount.I've made some improvements and additions to my first solution. Now there will be no problems when loading
hyperref
(my previous solution was incompatible withhyperref
); the modifications to the ToC emtries are now made with the help of the titletoc package; I've also added redefinitions for the section and subsection entries.As Harish Kumar suggested in a comment, it will be nice to have some decorations for parts too. This new variation explores one possibility for these decorations:
Unfortunately, if
hyperref
is loaded, the part entry formatting will be lost (I'll have to think about this).Memoir document class
In some of the comments below there are suggestions to implement the style using the
memoir
document class. Below I present two variations.First variation
This version works for numbered and unnumbered parts, chapters, sections and subsections, and cooperates with
hyperref
:Second variation
projetmbc has suggested in an edit to the original question a different formatting when including sections and subsections; this is a first attempt to produce this new layout.
Some remarks:
The
\StartMark
command must be placed before each \chapter command and\EndMark
must be placed immediately after the last sectional unit of a chapter that will be included in the ToC:Page breaks can occur for the sectional units associated to a chapter and will be dealt automatically.
The code needs at least three runs.
The code:
The obtained ToC:
Tufte
Here's a variation for the
tufte-book
document class:Images of the resulting ToC: