Page Layouthepthesis | Wrong Page Numbers in ToC

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jawiti
Posts: 2
Joined: Fri Aug 03, 2012 11:11 am

hepthesis | Wrong Page Numbers in ToC

Post by jawiti »

Hello,

I am currently working on my thesis using the hepthesis class. The thesis has many figures and diagrams. I have a small problem in that the page numbers shown in the Table of Contents, List of Figures, and List of Tables are wrong. Does anyone know the solution?

Japheth

The following is a minimal working example:

Code: Select all

\documentclass[a4paper,oneside,bind,ams,booktabs,12pt]{hepthesis}
\RequirePackage{afterpage}
\usepackage{tocbibind}
\begin{document}
\begin{frontmatter}
xyz
\tableofcontents
\listoffigures
\listoftables
\end{frontmatter}
\begin{mainmatter}
\chapter{A}
\chapter{B}
\chapter{C}
\end{mainmatter}
Last edited by localghost on Fri Aug 03, 2012 4:51 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

hepthesis | Wrong Page Numbers in ToC

Post by Stefan Kottwitz »

Hi Japheth,

welcome to the board!

What do you want to show with this minimal working example?
Did you run this, and does it show the problem with the wrong numbers? That's the main point of an MWE: to reproduce the problem. Besides that, it should be as short as possible, but still containing the error.

If not, it would not be usable. When I tested it ( I had to add \end{document} to make it compilable, the page numbers were correct.

Stefan
LaTeX.org admin
jawiti
Posts: 2
Joined: Fri Aug 03, 2012 11:11 am

Re: hepthesis | Wrong Page Numbers in ToC

Post by jawiti »

Dear Stefan

Thank you for the correction. I forgot the \end{document}. Actually it is not possible to include all the information in the example for us to see the problem since I think the problem has got something to do with the diagrams in the document or having a table of contents that covers more than one page. The main issue is that in making the entries in the table of contents, all pages having diagrams are skipped. The page numbers in the table of contents are actually correct until we encounter the first diagram. From there onwards the entries are wrong. For example, if the first diagram is on Page 10, the entries in the tabe of contents are correct up to Page 9, and then they become wrong. If, say, I have some material on Page 11 in the document, it is shown as appearing on Page 10 in the table of contents yet what I actually have on Page 10 is a diagram. I hope this clarifies the problem.

Japheth
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

hepthesis | Wrong Page Numbers in ToC

Post by Stefan Kottwitz »

Run several times to get references including page numbers correct, they can change during compilation, as external files are used.

Even if a document is big, you can always produce a Infominimal working example. Follow this link! Hack down a copy step by step, reduce it as long as it shows the problem. The result can be a short preamble (unrelated packages removed, a diagram (possibly replaced by a dummy), some code.
Don't create a fictional example from scratch. There's no point, if it doesn't contain the problem: it's a different and possibly a correct document.

Creating an MWE can take some time, I know. However, readers may also invest some of there own time to help! Often one finds the cause during the hacking-down process, as it gets clearer.

Stefan
LaTeX.org admin
Post Reply