1

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

 \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}}%

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

\addbibresource{\jobname.bib}

\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}}%

1 Answer 1

4

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

\renewcommand\enoteheading{\chapter*{\notesname}\mbox{}\par\vskip-\baselineskip}
\counterwithin*{endnote}{chapter}

\addbibresource{biblatex-examples.bib}

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

4
  • moewe, Is this still a pending issue? What is really required from the point of view of biblatex so that citations work in an end note context? Is it sufficient to set \toggletrue { blx@footnote }? I ask because I'm working on some related stuff and for me it would be critical to get biblatex running smoothly with it. (I understand that part of the problem for enotez is an expansion which occurs when the .aux file is read. I don't have this particular issue. So what I'd love to know is, excluded .aux file issues, is setting the boolean sufficient?)
    – gusbrs
    Apr 5, 2022 at 14:46
  • @gusbrs What do you mean by this? The MWE here works fine as far as I can see. One big concern when you implement footnotes (or related things) differently is indeed that biblatex needs to know we're in a footnote-like environment (we need the blx@footnote toggle). I can imagine that there are more issues, but I guess those will mostly depend on the exact implementation of your footnotes (e.g. expansion issues when the footnotes are written to a file, cite context [refsection etc.]).
    – moewe
    Apr 5, 2022 at 15:11
  • Sorry, moewe, I didn't mean the answer, but your comment about the relation between enotez and biblatex, saying that "footnote detection does not quite work". So blx@footnote is required for biblatex to know it is in a footnote-like environment, I got that covered. I suppose the requirement is handling idem and ibidem trackers. So far I haven't stumbled in expansion issues, since I don't write the notes contents to a file at all. About the relation between refsection and cite context, I have to think, it may be tricky indeed. I may pester you again later on... And thank you!
    – gusbrs
    Apr 5, 2022 at 15:19
  • Rereading my comment, I see why you didn't understand what it was about. There was no way to, sorry. :-)
    – gusbrs
    Apr 5, 2022 at 15:22

You must log in to answer this question.

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