Generalhyperref | Extra Entry in ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
fselley
Posts: 2
Joined: Thu Jul 28, 2011 8:53 pm

hyperref | Extra Entry in ToC

Post by fselley »

Hi,

I have the following problem: I need to have extra entries in my table of contents, which don't refer to any part of the document. For example, before the appendixes, a line saying "APPENDIXES". I'm using the following command to do this:

Code: Select all

\addtocontents {toc}{\protect \contentsline {chapter}{APPENDIXES}{}}
However, this confuses the hyperref package, it messes up the next line in the toc. Do you have any suggestions, how can I make the hyperref package ignore this line in the toc?

Fanni

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref | Extra Entry in ToC

Post by localghost »

You can try the appendix package for a possible remedy. For the details refer to the package manual. If already installed on your system, you can access it via command line.

Code: Select all

texdoc appendix
More specific help only possible with true minimal example.


Best regards and welcome to the board
Thorsten
fselley
Posts: 2
Joined: Thu Jul 28, 2011 8:53 pm

Re: hyperref | Extra Entry in ToC

Post by fselley »

hm, I have a feeling, I haven't made myself too clear... so everything is going fine, before I include the hyperref package... but when I do, hyperref wants to assign a point in the document to these extra lines, which is impossible, and I think this is what causes my problem. I am trying to get hyperref to ignore these lines in the toc.
paul
Posts: 49
Joined: Thu Apr 08, 2010 5:56 am

hyperref | Extra Entry in ToC

Post by paul »

fselley wrote:Hi,

I have the following problem: I need to have extra entries in my table of contents, which don't refer to any part of the document. For example, before the appendixes, a line saying "APPENDIXES". I'm using the following command to do this:

Code: Select all

\addtocontents {toc}{\protect \contentsline {chapter}{APPENDIXES}{}}
However, this confuses the hyperref package, it messes up the next line in the toc. Do you have any suggestions, how can I make the hyperref package ignore this line in the toc?
Add another set of braces:

Code: Select all

\addtocontents{toc}{\protect\contentsline{chapter}{APPENDIXES}{}{}}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref | Extra Entry in ToC

Post by localghost »

fselley wrote:hm, I have a feeling, I haven't made myself too clear... so everything is going fine, before I include the hyperref package... but when I do, hyperref wants to assign a point in the document to these extra lines, which is impossible, and I think this is what causes my problem. I am trying to get hyperref to ignore these lines in the toc.
I just wanted to say that the suggested package can help you to get the appendix into the ToC without side effects. But paul already proposed a possible solution.
Post Reply