0

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: Rendering of the Note page

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:

TOC showing Note page on 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?

3
  • 1
    You can simply add a \cleardoublepage explicitly, right before \printendnotes.
    – Jinwen
    May 24 at 7:49
  • Yes @Jinwen it’s the solution. If you write an answer, I can mark it as the solution.
    – fauve
    May 24 at 8:49
  • 1
    I believe someone else might be able to come up with a more clever solution (or fix), since this is certainly not the expected behavior for this command. Adding \cleardoublepage is just my lucky guess.
    – Jinwen
    May 24 at 8:53

2 Answers 2

0

I should put \cleardoublepage before \\addcontentsline{toc} to ensure page number.

0

Not sure, if this is what you are looking for:

\documentclass[12pt]{book}
\usepackage{lipsum}
\usepackage{enotez}

\setenotez{list-heading=\chapter*{#1},totoc=section}

\begin{document}
  \frontmatter% <<<
  \tableofcontents

  \mainmatter% <<<
  \lipsum[1]


  \endnote{foo}

  \backmatter% <<<
  \printendnotes
\end{document}

contents lipsum endnote

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.