General ⇒ Table of contents cannot compile with hypperref
Table of contents cannot compile with hypperref
I have a problem with my thesis document in LaTeX. I have written some chapters and included the hyperref package to get easy clickable links between sections and citations (This works). However, when I want to compile the table of contents (\tableofcontents) it wont create the pdf output.
If I then remove hypperref (%\usepackage{hyperref}) then it will compile with the ToC. But then I of course have no links.
Any suggestions on how to get both to play nicely together? OR why this happens?
Thanks!
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
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
it would be good if you would post the error message here, or the complete .log file as attachment to a post.
Stefan
Re: Table of contents cannot compile with hypperref
I stress that if dont use either hyperrref or ToC, then it works fine. Only the combination of the two that mess it up
- Attachments
-
- Thesis_Main.log
- Log file
- (18.67 KiB) Downloaded 210 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
Code: Select all
(E:\Dropbox\Thesis\Thesis\Thesis_Main.toc! Argument of \contentsline has an extra }.<inserted text>\parl.2 \contentsline{chapter}{\numberline {1}Growth \& Properties of Gold Nano...?! Emergency stop.<inserted text>\par
Stefan
Table of contents cannot compile with hypperref
Code: Select all
(E:\Dropbox\Thesis\Thesis\Thesis_Main.toc! Argument of \contentsline has an extra }.<inserted text>\parl.2 \contentsline{part}{I\hspace {1em}Background \& Self-Assembly}{1}{part.1}?! Emergency stop.<inserted text>\parl.2 \contentsline{part}{I\hspace {1em}Background \& Self-Assembly}{1}{part.1}End of file on the terminal!
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
Stefan
Re: Table of contents cannot compile with hypperref
- Attachments
-
- mygrthesis.sty
- Style file
- (4.38 KiB) Downloaded 244 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
Stefan
Re: Table of contents cannot compile with hypperref
- Attachments
-
- macros.tex
- (7.86 KiB) Downloaded 233 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
So the problem could still be in the main document. I guess we need to check that, even though I thought it could be sufficient to test your customized files together with a small document containing part and chapter, which are relevant for the problem here. But that's not enough.
So, we need a code which produces the error. Once the problem can be verified, I'm sure that can be fixed. But we need to verify it. For this, please post a minimal example which brings that error when compiled. This could be a hacked down copy of your original document, a very reduced copy. Just follow the link to know why and how.
Once we have a test file here, we could run that together with the already posted customized files. Just if there are further non-standard files, we might need them too, if they are related to the problem.
Well, I'm really sure it can be fixed easily, I just don't have your files here.

Stefan