Wrong Page Number for List of Figures within Table of Contents

Yqazra's picture

Hi, I have a problem when I typeset my document. The document class is book. I added the List of Figures to Table of Contents manually using following command:

\newpage
\phantomsection\label{listoffig}
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

The Table of Contents itself contains of 3 pages and started at page xii. The List of Figures appears at page xv. However, the Table of Contents showed that the List of Figures is at page xiii (which is wrong).

I have also tried this command:

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

but the problem still occurs. Every page number within the Table of Contents is correct, except for the List of Figures. Strangely, when I open the .toc files, the page number for the List of Figures is correct (it showed xv).

For clarity, you can see some files in the attachment. Thanks for your help.

AttachmentSize
Example.pdf80.89 KB
Example.tex7.82 KB

To generate the toc with an

To generate the toc with an entry in the toc, you are using an encapsulated TeX field containin:

\tableofcontents
\addcontentsline{toc}{chapter}{Report Contents} \markboth{Report Contents}{\textbf{Reports Contents}}

This prints the toc, then adds an entry for the toc, but by that time the counter is at the end of the toc so you get the last page of the toc instead of the first page of the toc listed.

Try this instead:

\clearpage
\addcontentsline{toc}{chapter}{Report Contents}
\tableofcontents
\markboth{Report Contents}{\textbf{Reports Contents}}

This starts a new page, adds the current page to the toc with "Report Contents", then does the toc starting on the current page.  This way the beginning of the toc matches the entry you created.