0

I use the following code to generate the "Contents" section of my thesis:

\include{ch_abstract}\newpage\cleardoublepage
\clearpage
\tableofcontents
\markboth{}{}
\addcontentsline{toc}{chapter}{List of Tables}\listoftables\newpage
\addcontentsline{toc}{chapter}{List of Figures}\listoffigures\newpage
\markboth{LIST OF ABBREVIATIONS}{LIST OF ABBREVIATIONS}
\include{ch_abbreviations}\newpage
\thispagestyle{empty}
\mainmatter
\setcounter{page}{1} 

The abstracts starts at iii and ends at vi. Then 4 pages of content follow. The List of Tables starts on page xi. Unfortunately, in the table of content it is listed on page vii. That is right where the 4 pages of content starts, which are not included in the content overview.

Abstract ....................iii

List of Tables.............vii

List of Figures............x

List of Abbreviations..xii

Everything is shifted by the 4 pages of content that are not included. The numbering in the main part of the thesis is totally fine. How can I make the List of Tables start at xi, List of Figures at xiii and List of Abbreviations at xxi (including the correct linking of all of them).

Based on the suggestions below ("\cleardoublepage") I adjusted my code. I furthermore included two calls of "\phantomsection" (trial and error) and now the numbering and the links to the "List of Figures" and "List of Abbreviations" are correct. The numbering of the "List of Tables" is correct as well. However, the link points to ix instead of xi. This is the last problem that needs to be solved.

  \include{ch_abstract}\newpage\cleardoublepage
  \phantomsection
  \tableofcontents
  \markboth{}{}
  \phantomsection
  \cleardoublepage
  \addcontentsline{toc}{chapter}{List of Tables}\listoftables\newpage
  \phantomsection
  \cleardoublepage
  \addcontentsline{toc}{chapter}{List of Figures}\listoffigures\newpage
  \markboth{LIST OF ABBREVIATIONS}{LIST OF ABBREVIATIONS}
  \include{ch_abbreviations}\newpage
  \thispagestyle{empty}
  \mainmatter
  \setcounter{page}{1}
green
  • 9
  • 1
    Welcome to TeX.SE! Real quick: Did you run LaTeX (at least) twice to fully update the contents of the Table of Contents (pun intended)? – Mico Feb 17 '19 at 19:24
  • I run the following commands in this exact order: latex thesis.tex, bibtex thesis.aux, latex thesis.tex, dvips thesis.dvi, ps2pdf thesis.ps – green Feb 17 '19 at 19:31
  • 1
    Running bibtex thesis.aux is an error. (Actually, it's mainly painfully pedantic.) Please switch to bibtex thesis -- no need for a filename extension. A separate question: Is there a reason for not running pdflatex? – Mico Feb 17 '19 at 19:36
  • i changed the bibtex call. Regarding the "latex" vs "pdflatex" issue: I use "latex" as I include "eps" files and I thought this does not work with "pdflatex". – green Feb 17 '19 at 19:40
  • try to add \cleardoublepage before each \addcontentsline{toc}{chapter}... – touhami Feb 17 '19 at 19:45
  • This fixed the issue with "List of Tables" (page ix) and "List of Figures" (page xi). "List of Abbreviations" is still on page xii. If I add the \cleardoublepage before the \include it is moved to page xiii. However, it is supposed to be on page xv. Furthermore, the links to all the "List of ..." are now of and dont fit anymore (List of Tables still points to vii, and List of Figures points to ix). They were not adjusted. – green Feb 17 '19 at 19:56
  • 1
    The numbering shouldn't be off by the entire Contents page count... just one or two pages. You either didn't compile enough times, or you're not showing all the code. We can't replicate your issue with the current code. – Werner Feb 17 '19 at 19:56
  • I have no idea how to create a short working example as the TOC is four pages long. How to recreate this without posting multiple pages of my thesis. And yes it is exactly off by 4 pages. I assume this is linked to the length of the content list that is 4 pages long. – green Feb 17 '19 at 20:01
  • I added a \cleardoublepage at the beginning of the tex file with the abbreviations. Furthermore, I call latex thesis.tex now 3 times in total. The page numbers are now correct in the content list. The only problem left now is that the links in the pdf for the three list chapters (Tables, Figures, Abbreviations) point to the wrong pages. – green Feb 17 '19 at 20:09
  • @green: For links, you need \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{...} \listof... – Werner Feb 17 '19 at 20:32
  • Thank you very much Mico, touhami and Werner! I missed the third call to latex, cleardoublepages were missing and eventually I had the wrong order of the phantomsection and cleardoublepage calls. Thank you all three for your combined support. – green Feb 17 '19 at 20:37
  • I think,this is a xy-problem and a better question would be, e.g., Insert list of figures in the table of contents. – cabohah Jun 28 '23 at 16:30

1 Answers1

0

To solve the problem I had to add a third call to latex (Mico), I had to add calls to \cleardoublepage (touhami) and I had to add \phantomsection calls after the \cleardoublepage calls (Werner).

...
\include{ch_abstract}\newpage\cleardoublepage
\phantomsection
\tableofcontents
\markboth{}{}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Tables}\listoftables\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}\listoffigures\newpage
\markboth{LIST OF ABBREVIATIONS}{LIST OF ABBREVIATIONS}
\include{ch_abbreviations}\newpage
\thispagestyle{empty}
\mainmatter
\setcounter{page}{1}

Thank you very much for the combined support!

green
  • 9
  • 3
    you considered reading an introduction to LaTeX? Right now, your code is quite strange. There are ways to add those lists automatically to the toc, without you having to do all of this stuff. – Johannes_B Feb 18 '19 at 06:26