General ⇒ hyperref package and table of contents
hyperref package and table of contents
I am having the following issue with hyperref package. As soon as I enable the package, my table of contents are not listed, I get the heading "Contents" but the rest of the page is blank. This is what is reported in the log file:
Package hyperref Warning: old toc file detected, not used; run LaTeX again.
\tf@toc=\write11
I have tried running latex number of times but I keep getting the same warning. My toc file has all the listings so it is definitely valid.
I have read the hyperref manual inside/out but to no avail.
Any help would be appreciated.
Thanks,
Santo
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: hyperref package and table of contents
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: hyperref package and table of contents
Thanks for your advise.
I deleted all files (except .tex and .sty) but it still didn't solve the problem when I recompiled it.
I have windows version of miktex running on my computer and I am using TeXnicCenter.
Any other options.
Thanks,
Santosh
hyperref package and table of contents
Code: Select all
\documentclass{report}\usepackage{hyperref}\begin{document}\tableofcontents\chapter{First One}What a great chapter.\chapter{Next One}Wow, this one is even better.\section{A section}It even has a section.\end{document}
If not, follow the instructions here for building a minimal working example and keep expanding it towards your document until the problem emerges. There's a good chance that this process will itself reveal the problem, but if not, post the MWE here.
If you do get a problem even with this minimal code, add \listfiles to the beginning and post the complete .log file here.
Re: hyperref package and table of contents
Will post once I have either succeeded or get to the point of the document not working.
Cheers,
Santosh
Re: hyperref package and table of contents
The problem was that I had my preamble (documentclass, etc commands) in a different file that I included in the main file using the \include command. Once I actually added the commands until \begin{document} to the main file, the problem disappeared and I got my table of contents.
Thanks everyone for the help.
Cheers,
Santosh
hyperref package and table of contents
Code: Select all
\input{}
Code: Select all
\include{}