1

I'm trying to write a book using the Tufte-Style, and this problem has been bothering me for a while.

I want to format the chapters titles showing the numbers by the side of it. Simple enough, but the numbers are not showing in my example.

The minimal code for my problem is this:

\documentclass{tufte-book} %Tufte's style for books
\usepackage{titlesec} %Formatting of chapters, sections and subsections
\usepackage{color}  %Used in the format
\definecolor{gray75}{gray}{0.75} %Color used in the chapter format
\newcommand{\hsp}{\hspace{20pt}} %Also used in the chapter format

\setcounter{secnumdepth}{0} %Supposed "Switch" to turn numbering on
%Found as a response here: https://groups.google.com/forum/#!topic/tufte-latex/s5aAqdvDSpg

%My chapter style
\makeatletter
\titleformat
{\chapter}[hang]
{\Huge\bfseries}
{\thechapter\hsp\textcolor{gray75}{|}\hsp}
{0pt}
{\Huge\bfseries}
\makeatother

\begin{document}

\frontmatter

\chapter{First Chapter}
\label{ch:first-chapter}

\end{document}

The result being this:

enter image description here

Any help will be greatly appreciated. :)

  • 2
    It's because you're using \frontmatter. Do you need that? – Werner Dec 12 '16 at 5:33
  • OMG, of course that was it. I'm supposed to use \mainmatter right? – Javier Levio Dec 12 '16 at 5:41
  • Yes, which would be equivalent to not using anything, since the default should be \mainmatter. – Werner Dec 12 '16 at 5:54
4

\frontmatter is the cause of the numbering to be lost, since it sets the "main matter flag" to false. And, under this condition, the chapter counter is not stepped nor printed under \chapter.

Either drop \frontmatter or use \mainmatter.

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.