# Only print endnote section if there are any endnotes.

Issue #6 closed
Daniel Shub created an issue

I would like to be able to call \printendnotes regardless of if there are actually any endnotes. Right now, even if there are no notes, the section title is printed and the \AtEveryEndnotesList hook and \AfterEveryEndnotesList hook are evaluated. The use case I have in mind is similar to the following MWE

\documentclass{article}
\usepackage{enotez}
\AtEveryEndnotesList{I do not want to see this}
\AfterEveryEndnotesList{I do not want to see this}
\begin{document}
\printendnotes
\end{document}


I would like to have a completely empty document. This would allow adding \printendnotes to the \AtEndDocument hook. I would be happy with a boolean that is true when there are endnotes and false otherwise.