# Why does starting a new chapter makes footnotes start at 2?

Please have a look at the following MWE:

\documentclass{report}
\usepackage{perpage}
\usepackage{lipsum}
\MakePerPage{footnote}
\begin{document}
\chapter*{unnumbered}
Wombat unnumbered\footnote{Capybara unnumbered}
\chapter{Introduction}
Wombat\footnote{Capybara}
\chapter{C}
\lipsum
\footnote{b}%This would be footnote number 2 as well if called on the first page of the chapter. (Bug is not limited to the first numbered chapter of a document.)
\end{document}


\MakePerPage{footnote} seems to make the footnote number start at 2 when calling a footnote on the first page of a numbered chapter.

• Are the packages requiring XeTeX (and special fonts) needed to rreproduce the problem? If not, kick them out. Same for biblatex and other packages. – Johannes_B Mar 19 '17 at 16:13
• The actual MWE fits into a comment: \documentclass[12pt,a4paper,english]{report} \usepackage{perpage} \MakePerPage{footnote} \begin{document} \chapter{Introduction} a\footnote{b} \end{document} – TeXnician Mar 19 '17 at 16:24
• The problem is situated at \MakePerPage{footnote}, but I don't know why. – TeXnician Mar 19 '17 at 16:24
• Sorry for not providing an MWE straight away, since I never encountered that problem, I thought the issue was coming from a complicated interaction and not just such a simple MWE. I came to the same conclusion as you as I removed more and more packages. – nathdwek Mar 19 '17 at 16:30
• @TeXnician: I guess those were added to fit the footnote call as well as the footnote on a single embeddable picture – nathdwek Mar 19 '17 at 16:35

## 1 Answer

This "bug" was introduced in LaTeX, from changes.txt:

2015-01-10 David Carlisle

• ltcounts.dtx: Reset all within counter levels (latexrelease)

Each LaTeX counter is associated with a counter list. The counter in this list are reset, if the LaTeX counter is incremented by \stepcounter. Thus, if the chapter is advanced, then the section is reset to zero.

In LaTeX before 2015, this reset operation is done by assigning the counter to zero. Since LaTeX release 2015-01, this is done by setting the counter to -1, followed by \stepcounter. The effect is that \stepcounter triggers the reset of the next dependent counters and an advance of counter chapter not only resets section, but also subsection, subsubsection, ...

Class report adds counter footnote to the reset list of chapter.

The problem arises with packages like perpage or zref-perpage that hook into \stepcounter. The hook creates a label to get the current page number to decide, whether the counter needs to be reset, if the counter is incremented on a new page. The basic asumption is that \stepcounter is only called, if a new number for a new object is needed. This assumption is now violated by the LaTeX update.

Workaround: Use of an older LaTeX via package latexrelease:

\RequirePackage[2014/05/01]{latexrelease}
\documentclass{report}
\usepackage{perpage}
\usepackage{lipsum}
\MakePerPage{footnote}
\begin{document}
\chapter*{unnumbered}
Wombat unnumbered\footnote{Capybara unnumbered}
\chapter{Introduction}
Wombat\footnote{Capybara}
\end{document}


Solution: The issue is solved by removing footnote from the reset list of chapter.

The following example uses zref-perpage, but should work with package perpage the same way, because both packages share the assumption about \stepcounter and hook into it.

\documentclass{report}
\usepackage{zref-perpage}
\usepackage{lipsum}
\zmakeperpage{footnote}

% Remove counter "footnote" from the reset counter list
% of counter "chapter".
\usepackage{remreset}
\makeatletter
\@removefromreset{footnote}{chapter}
\makeatother

\begin{document}
\chapter*{unnumbered}
Wombat unnumbered\footnote{Capybara unnumbered}
\chapter{Introduction}
Wombat\footnote{Capybara}
\end{document}

• Thanks for the thorough answer. I will try it out and probably validate it as soon as I can! – nathdwek Apr 7 '17 at 13:51
• Another workaround is to use package footmisc with option perpage. – Éric Guirbal Aug 1 '17 at 20:48