# Reset Chapter Endnotes

I'm working on a very large report with a variety of endnotes (using both \footnote and \autocite commands). I need to have the endnotes reset with each chapter (ie. restart at 1). Minimal working example as follows,

\documentclass{report}

\usepackage{biblatex-chicago}
\usepackage{endnotes}
\let\footnote=\endnote

\makeatletter
\@addtoreset{endnote}{chapter}  % Reset endnote numbering every new chapter
\makeatother
\usepackage{footmisc}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}%

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}

\begin{document}

\chapter{Alpha}

Some text \autocite{A01}.

Some text with footnote.\footnote{ \autocite{B02}}

Some text \autocite{A01}.

\theendnotes

\chapter{Bravo}

Some text \autocite{B02}.

Some text \autocite{C03}.

\theendnotes

\end{document}


I'm curious if the preamble I included is the most efficient (or minimal) solution to my desired outcome? This block of code seems a bit unwieldy and trying to refine my LaTeX coding. In other words, is there a simpler or shorter preamble that I can include yet still achieve my desired outcome of resetting the endnote number every chapter?

 \renewcommand\enoteheading{\chapter*{\notesname}\mbox{}\par\vskip-\baselineskip}
\makeatletter
\@addtoreset{endnote}{chapter}  % Reset endnote numbering every new chapter
\makeatother
\usepackage{footmisc}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}%


The code looks OK, but can be shortened a bit.

On first glance, the \renewcommand\enoteheading looks a bit odd with all the \mbox{}\par\vskip-\baselineskip, but that is also what the original definition in endnotes.sty does (and it is required for correct alignment of the endnotes).

But if the endnotes are per-chapter endnotes, I would not set the endnotes themselves as chapters. Logically I'd have thought the endnotes belong to the previous chapter and should therefore be a section of that chapter...

With a current version of LaTeX (at least April 2018), you can use \counterwithin* instead of \@addtoreset. This has two advantages

1. You don't need \makeatletter...\makeatother because \counterwithin* does not contain an @.
2. \counterwithin* checks that its arguments are counters. (Not really necessary here, since you know what you are passing should be counters).

It is not clear to me that you need

\usepackage{footmisc}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}%


I don't think I could see a difference in the example when I omitted it. (Since you have redirected all footnotes to endnotes, which use their own counter, at least the \thefootnote redefinition seems useless.)

\documentclass{report}
\usepackage{biblatex-chicago}
\usepackage{endnotes}
\let\footnote=\endnote

\counterwithin*{endnote}{chapter}

\begin{document}
\chapter{Alpha}
Some text \autocite{sigfridsson}.

Some text with footnote.\footnote{\autocite{worman}}

Some text \autocite{sigfridsson}.

\theendnotes

\chapter{Bravo}
Some text \autocite{worman}.

Some text \autocite{geer}.

\theendnotes
\end{document}


How does one get endnotes at the end of every chapter? also mentions a way to produce per-chapter endnotes with the pagenote package.

I would has suggested looking at enotez, but currently biblatex does not patch enotez, so the footnote detection does not quite work (cf. Biblatex, citing with endnotes, ibid tracker gets thrown off).