General ⇒ Table of contents cannot compile with hypperref
Re: Table of contents cannot compile with hypperref
If you pdftexify it should work now. But if you remove the % in front of \tableofcontents on line 128 in Thesis_Main_Error.tex I get the error again.
I appreciate the help.
- Attachments
-
- Minimalexample.rar
- (30.99 KiB) Downloaded 228 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref

The .toc file originally contains:
Code: Select all
\contentsline {chapter}{Introduction}{{\pageref {chap:Introduction}}}
\contentsline {part}{I\hspace {1em}Testpart}{1}{part.1}
\contentsline {chapter}{\numberline {1}TestChapter}{3}{chapter.1}
\contentsline {section}{\numberline {1.1}Introduction}{3}{section.1.1}
\contentsline {subsection}{\numberline {1.1.1}blabla}{3}{subsection.1.1.1}
Perhaps check your document for that. Or, modify the minimal example in a way that it brings the error also when the .toc file has been deleted, i.e. would be generated again.
Stefan
Re: Table of contents cannot compile with hypperref
- Attachments
-
- Minimalexample.rar
- (57.34 KiB) Downloaded 285 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
\contentsline
without the argument which is added by hyperref:Code: Select all
\addtocontents{toc}{\protect \contentsline
{chapter}{List of Publications}{{\protect \pageref{mypubs}}}}
\contentsline
, such as simply {}
:Code: Select all
\addtocontents{toc}{\protect \contentsline
{chapter}{List of Publications}{{\protect \pageref{mypubs}}}{}}
Stefan
Table of contents cannot compile with hypperref
My code for this is:
Code: Select all
\bibliographystyle{bibgen}
\footnotesize{\bibliography{library}}
\addcontentsline{toc}{chapter}{Bibliography}
Can I get it to read it correctly?
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
\cleardoublepage
or \clearpage
also before to ensure that you don't make the entry too early.Code: Select all
\cleardoublepage
\addcontentsline{toc}{chapter}{Bibliography}
{
\footnotesize
\bibliography{library}
}
\footnotesize
and similar font size commands are declarations and don't have arguments. They work like switches. The effect can be limited by an environment, or a group or braces, respectively, as I did here.Stefan
Re: Table of contents cannot compile with hypperref
Thank you very much for your help, Stefan - I really appreciate it

Now with this solved I can focus on the actual writing.. hehe
Kind regards,
Tissie