Generalhyperref: PDF index levels

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
paul
Posts: 49
Joined: Thu Apr 08, 2010 5:56 am

hyperref: PDF index levels

Post by paul »

I have a document structured as

Code: Select all

\frontmatter
\chapter{C0}
\mainmatter
\part{P1}
\chapter{C1}
\chapter{C2}
\part{P2}
\chapter{C3}
\backmatter
\chapter{C4}
The PDF index created by hyperref is laid out as

Code: Select all

C0
P1
...C1
...C2
P2
...C3
...C4
What I want is for C4 to be back at the same level as C0:

Code: Select all

C0
P1
...C1
...C2
P2
...C3
C4
What do I have to do to make hyperref "forget" about P2?

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

hyperref: PDF index levels

Post by frabjous »

If you're just talking about the “PDF bookmarks” which shows on the side panel of many PDF viewers, you can load the bookmark package, and then use this command:

Code: Select all

\bookmarksetup{startatroot}
To make the next division not treated as a child of the previous one. (In this case, you can add that command right after \backmatter.)

But I think this hierarchy tends to follow the main Table of Contents which is actually put in the document, and you may have it off there too. How you’d fix that would depend on what documentclass you’re using, and what, if any TOC-related packages you’re using, which you didn’t tell us.
paul
Posts: 49
Joined: Thu Apr 08, 2010 5:56 am

Re: hyperref: PDF index levels

Post by paul »

Yes, thanks, that solves my problem. The toc wasn't affected.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref: PDF index levels

Post by localghost »

Marking a topic as solved means to edit the initial post, not the last one (see Board Rules).


Best regards and welcome to the board
Thorsten
Post Reply