Page Layout ⇒ Wrong page numbers in Table of Contents
Wrong page numbers in Table of Contents
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
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
Wrong page numbers in Table of Contents
Re: Wrong page numbers in Table of Contents
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Wrong page numbers in Table of Contents
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.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. [...]
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Wrong page numbers in Table of Contents
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
Re: Wrong page numbers in Table of Contents
Re: Wrong page numbers in Table of Contents
Wrong page numbers in Table of Contents
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
Re: Wrong page numbers in Table of Contents
and \listoftables , etc
