Page LayoutWrong page numbers in Table of Contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
wjahn
Posts: 9
Joined: Fri Jun 06, 2008 1:13 pm

Wrong page numbers in Table of Contents

Post by wjahn »

Hi,
I'm finishing my thesis, and noticed suddenly that all the page numbers of the preamble in the table of contents are wrong. It works fine for the arabian numbered part.
I use report class with \addcontentsline for table of contents, figures and tables.
It seems to be related to the fact that all three tables are longer than 2 pages. The hyperref package works (it takes me to the right page), but the indicated page number is totally wrong.
I have fixed it by manually changing the *.toc file before the final latexing, but I'm not happy with that solution.
Any ideas why that could be?
Thanks
-------
Wolfram - 5 years and still a beginner

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Wrong page numbers in Table of Contents

Post by meho_r »

For starters, read the Board rules, and pay attention especially to section 2.
wjahn
Posts: 9
Joined: Fri Jun 06, 2008 1:13 pm

Re: Wrong page numbers in Table of Contents

Post by wjahn »

well, thanks for that reply......
I actually thought about providing a minimal example, but that is quite hard, as my particular case involves a list of figures that is over 2 pages long. Can't see how I can manage to get that in a minimal example.
Never mind, I'll look elsewhere.
Thanks,
regards,
wolfram
-------
Wolfram - 5 years and still a beginner
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Wrong page numbers in Table of Contents

Post by localghost »

wjahn wrote:[...] I actually thought about providing a minimal example, but that is quite hard, as my particular case involves a list of figures that is over 2 pages long. [...]
A MWE is always possible if you follow the instructions. Since we have no useful information, every try to help is only a guess. So I assume that you have the commands in a direct sequence. Insert a \newpage or \clearpage command behind every list and see what happens. Due to the lack of useful information there is no guarantee that it works. For an entry of those lists in the ToC you can use the tocbibind package.


Thorsten
wjahn
Posts: 9
Joined: Fri Jun 06, 2008 1:13 pm

Re: Wrong page numbers in Table of Contents

Post by wjahn »

Thanks Thorsten,
I have discovered the problem: the ToC apparently indicates the number of the last page rather than the number of the first page of each section of the preamble. My abstract begins at page v and finishes at page vi, so in the ToC it appears as vi. This happens consistenly in the entire preamble. In the main body it works normally. \clearpage and \newpage didn't change anything.
I appreciate your intention of helping despite the lack of information on my side.

I don't think it's worth the effort of looking further into the issue, I'll just change the *.toc file for the last compilation.

Thanks again.
regards
wolfram
-------
Wolfram - 5 years and still a beginner
chrono
Posts: 5
Joined: Thu Mar 31, 2011 6:55 pm

Re: Wrong page numbers in Table of Contents

Post by chrono »

Hey! I have the exact same problem! Did you find a solution eventually?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Wrong page numbers in Table of Contents

Post by meho_r »

For a solution, the problem must be stated clearly. A MWE in this case is a must. So, if you have the same problem, please create an example which shows what is wrong and post it here so that people can analyze it and suggest what should be done to solve the problem.
chrono
Posts: 5
Joined: Thu Mar 31, 2011 6:55 pm

Re: Wrong page numbers in Table of Contents

Post by chrono »

The solution can be found in this thread:

http://www.latex-community.org/forum/vi ... f=5&t=3577
huunal
Posts: 2
Joined: Tue Dec 27, 2011 5:39 pm

Wrong page numbers in Table of Contents

Post by huunal »

Hi, I have similar problems and the reason stems from the bibliography. However, I have not been solved yet. If I remove the

Code: Select all

\addcontentsline{toc}{chapter}{\bf  BIBLIOGRAPHY}
\chapter*{\bf BIBLIOGRAPHY}
\bibliography{J:/thesis_draft/bibtexf/strings,J:/thesis_draft/bibtexf/myrecbib}
\bibliographystyle{unsrt}

the problem is solved and the page number of list of figures is correct, otherwise, it is shifted. My tex file is as shown below

\documentstyle[caption,12pt,eefleqn,epsf,amsthm,amsmath,amsfonts,graphicx,arydshln,cite]{eereport}

\setlength{\textwidth}{140mm} \setlength{\textheight}{237mm}
\setlength{\topmargin}{-8mm} \spacingset{1.5} \pagestyle{plain}
\setlength{\oddsidemargin}{1.46cm}  %0.5cm}
\setlength{\parskip}{2mm}    %2mm}
\setlength{\itemsep}{1mm} \setcounter{page}{1}
\parindent 15mm


\begin{document}

\makeatletter  %Use internal LaTeX commands (with care)
\makeatother
\setcounter{tocdepth}{3} %We will see subsubsections in toc


\pagenumbering{roman}
\addcontentsline{toc}{chapter}{\bf TABLE OF CONTENTS}\tableofcontents
\addcontentsline{toc}{chapter}{\bf LIST OF FIGURES} \listoffigures
\addcontentsline{toc}{chapter}{\bf LIST OF TABLES} \listoftables
\addcontentsline{toc}{chapter}{\bf NOTATION}\input{notation}
\addcontentsline{toc}{chapter}{\bf LIST OF ACRONYMS} \input{acronyms}
\clearpage \pagenumbering{arabic} \chapter{\bf INTRODUCTION}
\section{Overview and Motivation}



\addcontentsline{toc}{chapter}{\bf  BIBLIOGRAPHY}
\chapter*{\bf BIBLIOGRAPHY}
\bibliography{J:/thesis_draft/bibtexf/strings,J:/thesis_draft/bibtexf/myrecbib}
\bibliographystyle{unsrt}

I am looking forward your replies about this problem
Last edited by Stefan Kottwitz on Tue Dec 27, 2011 5:59 pm, edited 1 time in total.
huunal
Posts: 2
Joined: Tue Dec 27, 2011 5:39 pm

Re: Wrong page numbers in Table of Contents

Post by huunal »

I solved the problems by inserting \newpage after \tableofcontents, \listoffigures
and \listoftables , etc
:)
Post Reply