Generalhyperref package and table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
santo
Posts: 5
Joined: Thu Aug 05, 2010 3:50 am

hyperref package and table of contents

Post by santo »

Hi all,
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

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: hyperref package and table of contents

Post by localghost »

Delete all files that you didn't create yourself (which means everything except the *.tex source file). Start a new compiler run and see what happens.


Best regards and welcome to the board
Thorsten
santo
Posts: 5
Joined: Thu Aug 05, 2010 3:50 am

Re: hyperref package and table of contents

Post by santo »

Hi Thorston,
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
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

hyperref package and table of contents

Post by frabjous »

Try processing some minimal sample document, e.g.:

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}
Do you get the problem even then?

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.
santo
Posts: 5
Joined: Thu Aug 05, 2010 3:50 am

Re: hyperref package and table of contents

Post by santo »

Thanks for that tip. The minimal example worked fine. So now I will build it towards my document and see where the problem is.
Will post once I have either succeeded or get to the point of the document not working.
Cheers,
Santosh
santo
Posts: 5
Joined: Thu Aug 05, 2010 3:50 am

Re: hyperref package and table of contents

Post by santo »

Problem solved!!
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
foadsf
Posts: 2
Joined: Thu Aug 22, 2019 10:10 am

hyperref package and table of contents

Post by foadsf »

You could try using the

Code: Select all

\input{}
command instead of

Code: Select all

\include{}
if that's really the problem.
Post Reply