General ⇒ Table of contents cannot compile with hypperref
Table of contents cannot compile with hypperref
Hi all,
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!
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.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
Hi Tissie,
it would be good if you would post the error message here, or the complete .log file as attachment to a post.
Stefan
it would be good if you would post the error message here, or the complete .log file as attachment to a post.
Stefan
LaTeX.org admin
Re: Table of contents cannot compile with hypperref
I have attached the log. Thanks for the fast reply.
I stress that if dont use either hyperrref or ToC, then it works fine. Only the combination of the two that mess it up
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 209 times
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
This is the relevant part of the log:
Since hyperref changes the way the ToC works, I recommend to delete the old .toc file and then compile again, twice: one time for generating the new .toc file, and another time for reading that in.
Stefan
Code: Select all
(E:\Dropbox\Thesis\Thesis\Thesis_Main.toc
! Argument of \contentsline has an extra }.
<inserted text>
\par
l.2 \contentsline
{chapter}{\numberline {1}Growth \& Properties of Gold Nano...
?
! Emergency stop.
<inserted text>
\par
Stefan
LaTeX.org admin
Table of contents cannot compile with hypperref
Thanks for your suggestion, however, it did not work. I get a similar error as before, but not identical
Code: Select all
(E:\Dropbox\Thesis\Thesis\Thesis_Main.toc
! Argument of \contentsline has an extra }.
<inserted text>
\par
l.2 \contentsline
{part}{I\hspace {1em}Background \& Self-Assembly}{1}{part.1}
?
! Emergency stop.
<inserted text>
\par
l.2 \contentsline
{part}{I\hspace {1em}Background \& Self-Assembly}{1}{part.1}
End of file on the terminal!
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
Perhaps your thesis style file is not compatible with hyperref. Perhaps it can be fixed. I see you use mygrthesis.sty, could you post this as attachment? I would check it.
Stefan
Stefan
LaTeX.org admin
Re: Table of contents cannot compile with hypperref
Thanks Stefan, see attachment
- Attachments
-
- mygrthesis.sty
- Style file
- (4.38 KiB) Downloaded 243 times
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table of contents cannot compile with hypperref
No problem with this file - could you also attach your file macros.tex? It's also possible that the cause is there.
Stefan
Stefan
LaTeX.org admin
Re: Table of contents cannot compile with hypperref
Here you go
- Attachments
-
- macros.tex
- (7.86 KiB) Downloaded 232 times
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents cannot compile with hypperref
Also this file doesn't cause it. We had to check since those files are customized, not standard LaTeX.
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
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
LaTeX.org admin