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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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.
http://tex.stackexchange.com/questions/96676/how-to-reset-sidenote-numbering-in-chapters-tufte-latex
tex.stackexchange.com
crawl=CC-MAIN-2016-26
80207
application/http; msgtype=response
sha1:EV6R2T7DUX5WQMKWCY5IROUFXTJSDO46
<urn:uuid:fa449475-e919-45b8-ad7e-112648b0f203>
2016-06-26T06:20:41Z
151.101.193.69
sha1:2TYXQDSCDWLQTFCCZFILJ6KFMN7LBEVR
<urn:uuid:4a1d60df-57ee-4824-9fc1-f316975e3389>
http://tex.stackexchange.com/questions/96676/how-to-reset-sidenote-numbering-in-chapters-tufte-latex
response
<urn:uuid:b23a7bf7-7410-4a59-a3e0-91950f22b196>
robots: classic
hostname: ip-10-164-35-72.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2016-26
operator: CommonCrawl Admin
description: Wide crawl of the web for June 2016
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf