The solution given here works, if you are sure that you want to have all endnotes at the end of each chapter. But what if you want to decide to revert to all endnotes at the end? And what if you also have some endnotes in a Preface, indicated as \chapter*{Preface} that appears before the \mainmatter ?
I've extended this solution to give me the choice, using an etoolbox toggle,
\newtoggle{chapternotes}.
\usepackage{etoolbox}
\newtoggle{chapternotes}
\toggletrue{chapternotes}
%\togglefalse{chapternotes}
\iftoggle{chapternotes}{%
% using chapternotes
\renewcommand{\notedivision}{\section*{\notesname\ to Chapter~\thechapter}}%
\renewcommand{\pagenotesubhead}[2]{}%
% \pretocmd{\chapter}{\printnotes*}{}{}%
\pretocmd{\chapter}{%
\ifnum\value{chapter}>0\relax\printnotes*\fi%
}{}{}
\pretocmd{\mainmatter}{\printnotes*}{}{}% Notes in Preface
\pretocmd{\backmatter}{\printnotes*}{}{}%
}{%
% using notes at end of book
\renewcommand{\notedivision}{\chapter*{\notesname}}
}
In my main file, I include another \iftoggle to decide whether to print the the Notes at the end,
\backmatter
% Endnotes, whether in chapters or all at the end
\iftoggle{chapternotes}{%
\relax % using chapternotes
}{%
% using notes at end of book
\addcontentsline{toc}{chapter}{Notes}
\printnotes
}
A related question, change footnotes to endnotes, but allow some old footnotes, describes how to switch some footnotes to endnotes.
\printnotescommand at the end of every chapter, I know I'll forget it somewhere. – jlconlin Nov 22 '12 at 16:51biblatexwhich emits\chapter*? And so on. I don't think that your book has so many chapters that checking for\printnotes*at their end is overwhelming. :) – egreg Nov 22 '12 at 16:54