I have a document with Chapters and endnotes, and a table of contents (TOC). In order not to generate a number for the last chapter (Epilogue), I use \chapter*{Epilogue} in the code and then I put an extra line in the TOC by hand, using the command \addcontentsline{toc}. The problem is that as the result, the page number for the section "Notes" in the TOC appears to be wrong: it is equal to the page number of the Epilogue.

How to change this number (increase it by 2)?

Here is the code (most of it was borrowed from the answer to my earlier question Chapter numbers in endnotes):



\counterwithin*{endnote}{chapter}  % Reset endnote numbering every new chapter




         {\chaptername\ \thechapter. \unexpanded{#3}}}%






This is the Prologue. There are no endnotes here.

\chapter{Amazing Story}
As I am describing this story, I make a note which should appear at
the end.\endnote{This the first endnote.} And then I make the second
note.\endnote{This is the second note.}

\chapter{Another Amazing Story}
In this chapter, there are no endnotes. So it should not appear in the
"Notes" at the end.

\chapter{Yet Another Amazing Story}
In this chapter, I have some notes again, which I want to go to the
end.\endnote{This note should appear at the end, under the heading
  "Chapter 3. Yet Another Amazing Story", with the counter reset to 1,
  since this is the first endnote of this chapter.}



This is the Epilogue. No endnotes here.




  • 1
    Put \cleardoublepage before \addcontentsline{toc}{chapter}{Notes} (and also \phantomsection if you're using hyperref).
    – egreg
    Mar 7, 2013 at 0:34
  • @egreg: This works in my example. However, I am wondering whether there is a more general method that would allow me in this situation to assign in the TOC any given page number to the Notes (not necessarily increasing it by 1 or by 2).
    – Latex user
    Mar 7, 2013 at 0:46
  • \addtocontents{toc}{\protect\contentsline{chapter}{Notes}{42}} But this will break with hyperref.
    – egreg
    Mar 7, 2013 at 0:52
  • @egreg: What exactly will break with hyperref if I use this line? And also: what did you mean by "\phantomsection if you're using hyperref" above?
    – Latex user
    Mar 7, 2013 at 1:29
  • The annotation on the .toc file written by hyperref is different and depends on the anchor name chosen by it and is not readily predictable. However, why assigning an arbitrary page? The \cleardoublepage\phantomsection\addcontentsline path is safe if hyperref is used.
    – egreg
    Mar 7, 2013 at 10:23

1 Answer 1


Put \cleardoublepage before \addcontentsline{toc}{chapter}{Notes} (and also \phantomsection if you're using hyperref).

%\phantomsection % if you're using hyperref, uncomment this line


In order to assign a specific page number, it's best to say

%\phantomsection % if you're using hyperref, uncomment this line


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .