# How does one get endnotes at the end of every chapter?

Is it possible to get endnotes at the end of every chapter? Presently I am using the endnotes package and it seems to only generate all the endnotes together at the point where I put \theendnotes.

-

You can also stick with endnotes. Each time you use \theendnotes, all endnotes that were stored previously will be put there. So just write \theendnotes at the end of each chapter.

\documentclass{report}
\usepackage{endnotes}
\begin{document}

\chapter{First}
Testing.\endnote{First test.}
\theendnotes

\setcounter{endnote}{0}

\chapter{Next}
Again.\endnote{Second test.}
\theendnotes

\end{document}

-
@Farhat: If you want to stick with the endnotes package, here's a quote from endnotes.sty: "The user may want separate endnotes for each chapter, or a big block of them at the end of the whole document. As it stands, either will work; you just say \theendnotes wherever you want the endnotes so far to be inserted. However, you must add \setcounter{endnote}{0} after that if you want subsequent endnotes to start numbering at 1 again." – lockstep Jan 22 '11 at 17:22
@lockstep: thanks, I updated my answer to reflect this. – Bruno Le Floch Jan 22 '11 at 17:56

The pagenote package allows for endnotes ("pagenotes") at the end of each chapter.

\documentclass{book}

\usepackage{pagenote}
\makepagenote

\renewcommand*{\notedivision}{\section*{\notesname\ to chapter~\thechapter}}

\begin{document}

\chapter{bla}

\section{blubb}

Some text.\pagenote{The first endnote.}

\printnotes*

\chapter{foo}

\section{bar}

Some text.\pagenote{The second endnote.}

\printnotes*

\end{document}

-