Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've looked at this question:

How to reset footnote numbering at \chapter* and at frontmatter chapters?,

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}
share|improve this question
    
Welcome to TeX.SE! –  cmhughes Feb 4 '13 at 1:43
add comment

1 Answer

up vote 3 down vote accepted

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 with different table of contents entry
\chapter[Second in TOC]{Second}
\sometext

% Chapter with no table of contents entry
\chapter*{Third}
\sometext

\end{document}
share|improve this answer
    
Awesome---thank you! So that's what \makeatletter does... –  Miguel-Angel Manrique Feb 4 '13 at 2:16
    
Glad I could help! –  godbyk Feb 4 '13 at 2:17
    
Actually the suggestion doesn't reset the counters... I'll edit my post and post a MWE shortly. –  Miguel-Angel Manrique Feb 4 '13 at 2:48
    
Ah, sorry about that. I've updated my answer. See if it works for you now. –  godbyk Feb 4 '13 at 6:43
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.