# Mixing Tufte-and ETOC

For a book I would like to make use of the Tufte Layout/Template to acoomplish a look and feel as in the book 'Principles Of Biochemistry' (see image POB1). The documentclass 'tufte-book' seems to roughly resemble the look-and-feel of that book, but I run into some troubles making the TOC look as in POB2 when using tufte-book. The below MWE works nicely with 'book' and 'scrbook' but tufte-book seems to completely screw up the TOC design. I am using 'etoc' because of its (fair) simplicity compared to the alternatives.

\documentclass{book}
%\documentclass{tufte-book}

\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage{etoc}

\definecolor{DeepOcean}{RGB}{25, 107, 173}

\renewcommand{\thesubsection}{\Alph{subsection}}

\begin{document}

\begingroup  % we start a group to keep the style changes local
\newlength{\tocleftmargin}    \setlength{\tocleftmargin}{4cm}
\newlength{\tocrightmargin}   \setlength{\tocrightmargin}{1cm}
\newlength{\tocmargin}        \setlength{\tocmargin}{1cm}

\etocsetstyle{chapter}
{\nobreak}
{\pagebreak[2]
\noindent
\large\bfseries\sffamily
\vskip0.8\baselineskip}
{\noindent
\color{DeepOcean}
\llap{\makebox[\tocmargin][l]{\etocnumber}}
\etocname{}
\nobreak
\hspace{0.5em}
{\color{black}\bfseries\footnotesize\etocpage}
\vskip3pt\par}
{}

\etocsetstyle{section}
{}
{\noindent
\normalsize\mdseries\sffamily }
{\noindent
\color{black}
\llap{\makebox[\tocmargin][l]{\etocnumber}}
\etocname
\nobreak
\hspace{0.5em}
{\color{black}\bfseries\footnotesize\etocpage}
\par}
{}

\etocsetstyle{subsection}
{}
{\noindent
\normalsize\mdseries\sffamily}
{\noindent\hspace{0em}
\color{black}
\etocnumber{}.\hspace{0.1em}
\etocname
\nobreak
\hspace{0.5em}
{\color{black}\bfseries\footnotesize\etocpage}
\par}
{}

\def\tmptitle{Contents}
\etocsettocstyle{\color{DeepOcean}
\noindent\huge{\tmptitle}\vskip10pt
\hrule height 1pt\hfill \vskip3pt
\leftskip\tocleftmargin
\par}{\bigskip}
\tableofcontents
\endgroup

\fontfamily{ptm}\selectfont

\chapter{Introduction}
\lipsum[11]

\section{Sec 1}
\lipsum[2]

\section{Sec 2}
\lipsum[8]

\section{Sec 3}
\lipsum[7]
%
\subsection{SS1}
\lipsum[8]

\subsection{SS2}
\lipsum[9]

\subsection{SS3}
\lipsum[10]

\chapter{Second Chap}
\lipsum[6]

\section{Sec 1}
\lipsum[1]

\section{Sec 2}
\lipsum[3]

\chapter{Third Chap}
\lipsum[9]

\section{Sec 1}
\lipsum[1]

\end{document}


I guess some overrides are required to force the tufte-book class into submission?

As a side note, I do not NEED per se to use that document class. The margin space for the margin-notes can be achieved via 'geometry' (that much I know), so if there was a solution on howto create such nice margin-notes with images and colored boxes and tables, I guess scrbook and book would do too.

There are three main issues:

• for some reason the tocdepth value will let only chapters pass through,

• the tufte-book has unnumbered chapters and sections, and the toc line styles you defined look fine with numbered ones,

• the font is different and the font sizes would probably need some adaptation for the TOC rendering.

But there does not seem to be an intrinsic incompatibility of tufte-book vs etoc.

Here is result with the sole modification of adding:

\etocsetnexttocdepth{subsection}


before the \tableofcontents.

Here is with book class (I also added hyperref).

The main difference is that the sectioning units are numbered.

• It is possible for etoc to create ab nihilo a dummy numbering of the chapters sections subsections so as to obtain same result as with book class. But of course this numbering will be seen only in the TOC. Hyperlinks will work. If interested, ping me. (hopefully I will still be around by then on the site but I sometimes takes leaves of absence). – user4686 Dec 1 '17 at 18:20
• Thanks for the comment. I find it increasingly hard to use the tufte-book class, because it redefines so many things differently. I am starting to opt for a book-ONLY approach where I simply do my margin-notes an full-width boxes myself (with the help of diligent SE members of course). So I think I need to close this post as it will bear no real benefit to anyone in the future... Any ideas on how to do this? – Edward Dec 4 '17 at 2:54