Text FormattingFootnotes and chapters

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Leo__
Posts: 28
Joined: Thu Oct 28, 2010 4:33 pm

Footnotes and chapters

Post by Leo__ »

Hello,

I would like to know how to reset the footnotes counter after an unnumbered chapter.

Here is a minimal not-yet working example (I am actually using three different sets of footnotes with the package bigfoot but I do not think that this should make a difference, since I would like all of them to be reset):

\documentclass[a4paper]{book}

\begin{document}

\chapter{First chapter}

This is the first chapter\footnote{This is ok.}. This is a second sentence\footnote{This is the second footnote.}.

\chapter{Second chapter}

This is the first chapter\footnote{This is ok.}. This is a second sentence\footnote{This is the second footnote.} of the second chapter.

\chapter*{Unnumbered chapter}

Check for yourself\footnote{This is a new footnote. I would like it to start at one.}.

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Footnotes and chapters

Post by Bartman »

Your example does not show how you work with at least one additional set of footnotes.

Suppose it was defined

Code: Select all

\DeclareNewFootnote{R}[Roman]
then you can try

Code: Select all

\usepackage{etoolbox}

\makeatletter
\pretocmd{\@schapter}{\setcounter{footnote}{0}}{}{}
\pretocmd{\@schapter}{\setcounter{footnoteR}{0}}{}{}
\makeatother
Source

That also seems to work

Code: Select all

\let\oldchapter\chapter
\def\chapter{%
  \setcounter{footnote}{0}%
  \setcounter{footnoteR}{0}%
  \oldchapter
}
Source
Leo__
Posts: 28
Joined: Thu Oct 28, 2010 4:33 pm

Footnotes and chapters

Post by Leo__ »

Many thanks. This worked for me.
Post Reply