# How to reset sidenote numbering in chapters? (Tufte-LaTeX)

I've looked at this question:

but the answers concern using \chapter*, and assume the OP is not using the Tufte-LaTeX package. I use \chapter to indicate the start of a new chapter in Tufte-LaTeX; my sidenote numbers are not reset between chapters, and I would like to do so.

Here is a MWE, using the first suggestion. Unfortunately the sidenote in chapter 2 starts at 2.

\documentclass{tufte-book}

\makeatletter% so we can use @ in the command name
\@addtoreset{footnote}{chapter}% restart the sidenote counter for each chapter
\makeatother% resets the meaning of @

\begin{document}

\chapter{ONE}
TEST\sidenote{footnote \#1}

\chapter{TWO}
LOOK\sidenote{footnote \#2}

\end{document}


To reset the sidenote counter each chapter, add the following lines to the preamble of your document:

\let\oldchapter\chapter
\def\chapter{%
\setcounter{footnote}{0}%
\oldchapter
}


Here's a minimal example:

\documentclass{tufte-book}

% Generate some dummy text
\usepackage{lipsum}
\newcommand{\sometext}{%
Blah\sidenote{First sidenote.} \lipsum[1]\par
Blah\sidenote{Second sidenote.} \lipsum[2]\par
}

% Reset the sidenote number each chapter
\let\oldchapter\chapter
\def\chapter{%
\setcounter{footnote}{0}%
\oldchapter
}

\begin{document}

% Regular chapter
\chapter{First}
\sometext

\chapter[Second in TOC]{Second}
\sometext


• Goodness gracious that is wonderful! It works great. added the line \setcounter{ex}{0} (ex is my example environment) to reset the example counter at every chapter as well. – Miguel-Angel Manrique Feb 4 '13 at 7:00