# Page numbering in Latex TOC (using memoir class) [closed]

The issue that I am having is that the page numbers appearing in my TOC do not correspond with the actual pages on which the section/chapter is found. The problem occurs in the mainmatter, as well as in the backmatter. It gets progressively less accurate the further you go. At the end, it is off by about 20 pages. It starts getting things wrong from as early as page 11.

I have extensively searched online already before posting. Did find the following thread: http://www.latex-community.org/forum/viewtopic.php?f=5&t=3577, but I am not using the addcontentsline command anywhere (I removed it, just be sure).

A few sections are unnumbered (e.g.: \section*{Method}), but like I said, these are not added to the TOC with a addcontentsline command.

My code is the standard TOC, no options added:

``````\setcounter{tocdepth}{1}
\tableofcontentssure
``````

Any help will be much appreciated.

-
Please provide a compilable minimal example. And what is `\tableofcontentssure`, I do not know that command –  daleif Jun 6 '11 at 13:27
How many times do you build your project? –  ℝaphink Jun 6 '11 at 13:33
I don't know the `tableofcontentssure`command either. But I had that same problem until I figured it was caused by the first chapter, which was a starred one. So I added a `\cleardoublepage\ phantomsection\addcontentsline{toc}{chapter}{<Chapter Name>}` before the `\chapter*` command, and all is going well. –  henrique Jun 6 '11 at 16:16
actually I have retested it (and reread your question --- I had not noticed you especifically mention `\addcontentsline`, sorry) and `\phantomsection` alone before a starred chapter (followed by 2 runs to build the TOC) corrects the page numbering in the TOC. –  henrique Jun 6 '11 at 17:00
@henrique where are you using unnumbered chapters? Remember the use of `\frontmatter` in `memoir`, –  daleif Jun 6 '11 at 18:18