General\tableofcontents is a blank page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Hwarang3001
Posts: 5
Joined: Sat Dec 23, 2023 11:55 pm

\tableofcontents is a blank page

Post by Hwarang3001 »

Hey all,

I am currently writing my thesis and my table of contents suddenly disappeared. I can still see the header on the page "Contents", but no sections, subsection or pages are shown - the contents page is blank...

Thank you in advance :)


Main.tex:

Code: Select all

\documentclass[a4paper]{report} %openright
\input{Setup/Statics.tex}
\input{Setup/Preamble.tex}
\input{Setup/Settings.tex}

% change number for line spacing
\renewcommand{\baselinestretch}{1.25}

\begin{document}

\pagenumbering{roman}
\input{Frontmatter/Frontpage.tex}
\pagecolor{white}
\newgeometry{top=2.75cm, bottom=2.75cm, outer=2.5cm, inner=2.5cm}
\pagestyle{empty}
\cleardoublepage
\input{Frontmatter/Copyright.tex}
\clearpage 
\pagestyle{main}
\input{Frontmatter/Approval.tex}
\clearpage 
\input{Frontmatter/Abstract.tex}
\clearpage 
\input{Frontmatter/Sammenfatning.tex}
\clearpage
\input{Frontmatter/Acknowledgements.tex}
\clearpage
\tableofcontents
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% PAGE HEADING
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\fancyhead[R]{National Department Aquatic Resources}
\fancyhead[L]{\chaptername\ \thechapter\ --\ \leftmark}
\renewcommand{\headrulewidth}{0.4pt}

\pagenumbering{arabic}
\input{Chapters/00_Abbreviation}
\cleardoublepage
\input{Chapters/01_Introduction}
\cleardoublepage 
\input{Chapters/02_Theory}
\cleardoublepage 
\input{Chapters/03_Method}
\cleardoublepage
\input{Chapters/04_Results}
\cleardoublepage
\input{Chapters/05_Discussion}
\cleardoublepage
\input{Chapters/06_Conclusion}
\cleardoublepage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\printbibliography[heading=bibintoc,title={Bibliography}]
\cleardoublepage 
\appendix
\input{Backmatter/Appendix.tex}
\cleartoleftpage
\input{Backmatter/Backpage.tex}

\end{document}
Last edited by Stefan Kottwitz on Sun Dec 24, 2023 1:04 am, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

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

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

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

\tableofcontents is a blank page

Post by Stefan Kottwitz »

Welcome to the forum!

Make sure that there's a file that ends with .toc; there are the table of content entries stored. And ensure no script or editor is deleting such auxiliary files.

Stefan
LaTeX.org admin
Hwarang3001
Posts: 5
Joined: Sat Dec 23, 2023 11:55 pm

\tableofcontents is a blank page

Post by Hwarang3001 »

Many thanks Stefan,

Where would such file be put? i can not see one as of now.

I have this toc in my setup .tex section:


% Table of contents (TOC) and numbering of headings
\setcounter{tocdepth}{2} % Depth of table of content: sub sections will be included in table of contents 1 if only section
\setcounter{secnumdepth}{2} % Depth of section numbering: sub sub sections are not numbered

\makeatletter % Reset chapter numbering for each part
\@addtoreset{chapter}{part}
\makeatother
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

\tableofcontents is a blank page

Post by Stefan Kottwitz »

That should be a file in your document folder. LaTeX generates it. Some more information is here.
Stefan
LaTeX.org admin
Post Reply