When I set the list heading of an endnote part to \chapter
in order to have a page break, it occur a bad pagenumber of the endnote part in the TOC.
MWE
\documentclass{book}
\usepackage{lipsum}
\usepackage{enotez}
\setenotez{list-heading=\chapter*{#1},totoc=section}
\begin{document}
\lipsum[1]
\tableofcontents
\endnote{foo}
\printendnotes
\end{document}
Rendering
So the Notes page is correctly begin in a new dedicated page as desired:
As you see, it is in this example set in the page 5.
But unfortunatly, the table of content mark it as in page 3:
Guessess
My guesses it’s because the \\addcontentsline{toc}
start immediatly at the \printendnotes
call and doesn’t wait the \cleardoublepage
takes effect.
So, how to make the Note page number apears at the TOC at his real beginning page?
\cleardoublepage
explicitly, right before\printendnotes
.\cleardoublepage
is just my lucky guess.