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. :)

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .