6

I need to add a single (possibly more) footnote to the end of the chapter (bottom of last page of chapter).

I do not want a whole complex thing to do this simple task. I simply want to put some text like

* This is the last page of the last chapter

at the bottom of the last page of the last chapter without having to manually keep track of that page.

lockstep
  • 250,273

2 Answers2

6

Here is a version that adds a footnote at the end of every chapter after issuing \chapendfootnote (of course, you could also just make this the default and not have to issue \chapendfootnote at all). The test to insert the end-of-chapter footnote is based on whether you're in a chapter with number >= 1. This would typically exclude \frontmatter chapters or \chapter*s, since they don't increment the chapter counter:

\documentclass[twoside]{report}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\makeatletter
\let\@chapterfootnote\@empty%
\newcommand{\chapterfootnote}[1]{\gdef\@chapterfootnote{#1}}%
\newcommand{\thechapendfootnote}{{%
  \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  \ifx\@empty\@chapterfootnote\else
    \footnotetext[1]{\@chapterfootnote}%
  \fi}%
  \let\@chapterfootnote\@empty}%
\newcommand{\chapendfootnote}{%
  \let\oldchapter\chapter%
  \renewcommand{\chapter}{%
    \ifnum\value{chapter}<1\else\thechapendfootnote\fi%
    \oldchapter%
  }%
}
\makeatother
\AtEndDocument{\thechapendfootnote}%
\begin{document}
\chapendfootnote
\tableofcontents
\chapter{A chapter}
\chapterfootnote{Hello this chapterfootnote for Chapter~1.}
\lipsum[1-20]
\chapter{Another chapter}
\chapterfootnote{This is a completely different chapter foot note for Chapter~2.}
\lipsum[1-15]
\chapter{Final chapter}
\chapterfootnote{And this is another one.}
\lipsum[1-40]
\end{document}​

Individualized end-of-chapter footnotes are specified using \chapterfootnote{<footnote>}.

Werner
  • 603,163
  • Cool, but I'd like to add different footnotes to different chapters ;) e.g., \chapter{chapter 2} .... \chapterfootnote{This is a footnote for chapter 2 at the end of the chapter} I think you code might be easy to convert by just creating a macro like \chapterfootnote and getting the current chapter number that it is called in. One just needs to keep some time of history with the footnote and it's chapter. – AbstractDissonance Aug 29 '12 at 19:18
  • @AbstractDissonance: I've added this "different" footnote to the example I gave. Not sure whether that addresses your concern. – Werner Aug 29 '12 at 19:34
  • No, I mean I need completely different footnotes per chapter. A normal footnote is per page. I want a footnote per chapter(but still be able to do per page footnotes). For example, \chapter{1} ... \chapterfootnote{Hello this chapterfootnote for chapter 1} ... \chapter{2} ... \chapterfootnote{This is a completely different chapter foot note for chapter 2} ... \chapterfootnote{And this is another one} ... – AbstractDissonance Aug 29 '12 at 19:50
  • Your code is very close but I think you just need to store each footnote and the chapter it is applied to in the \thechapendfootnote macro then put them all at the end of the chapters they belong to(instead of hard coding only one global chapterfootnote. – AbstractDissonance Aug 29 '12 at 19:52
  • Exactly! Thanks! Is it possible to allow more than one "chapterfootnote"? I do not need it now but maybe for others or in the future. – AbstractDissonance Aug 29 '12 at 20:00
  • @AbstractDissonance: Yes. This might require keeping a token list with a new footnote counter (perhaps similar to endnotes), which is then expunged at the end of the chapter (or before the new chapter starts). – Werner Aug 29 '12 at 20:02
  • Would it be easier simply to modify endnotes to produce a similar result as yours? Also, your code gives errors when there are no chapterfootnotes created. – AbstractDissonance Aug 29 '12 at 20:11
  • @AbstractDissonance: I've updated the "no chapterfootnotes" problem. It might be easy to modify endnotes, but I haven't looked into that. – Werner Aug 29 '12 at 20:45
2

As egreg mention in a comment, the endnotes package does what you need: a little example using standard \footnotes and \endnotes:

\documentclass{book}
\usepackage{endnotes}
\usepackage{lipsum}

\begin{document}

\chapter{Test Chapter One}
\lipsum*[2]\footnote{A regular footnote}
\lipsum*[4]\endnote{An endnote}
\lipsum*[2]\footnote{Another regular footnote}
\lipsum*[4]\endnote{Another endnote}
\lipsum*[1-4]
\theendnotes
\chapter{Test Chapter Two}

\end{document}
Gonzalo Medina
  • 505,128
  • One thing I'm trying to avoid is having to specify the location of the notes(else I can just do it myself easily). i.e, having to specify \theendnotes. Also, I want more of a footnote like note rather than some fancy list of notes. I only have one note(or two) and I don't want it to stand out. The endnote package doesn't really accomplish this as it does too much. – AbstractDissonance Aug 29 '12 at 17:28