Generalhyperref - Only partially open bookmarks

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

hyperref - Only partially open bookmarks

Post by Montag »

Hello,

I'd like to only open the first section's bookmarks to level 2. The bookmarks of section 2 should be closed, so it says only "2 The Last Section" in the navigator.
Is that possible?

I prepared a MWE:
hyperref-partially-open.tex
(456 Bytes) Downloaded 364 times
Last edited by Montag on Thu Jan 20, 2011 12:58 pm, edited 2 times in total.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1

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 - Only partially open bookmarks

Post by frabjous »

Do want the bookmarks for subsections 2.1 and 2.2 not to be created at all, or do you just want them hidden at first, so you have to click on section 2 to expand the tree that contains them?

If the latter, then I think you could use

Code: Select all

\hypersetup{bookmarksopenlevel=1}
right at the start of section 2.

If the former, then you can do the same, except with the command

Code: Select all

\hypersetup{bookmarksdepth=1}
The bookmark package provides even more commands for advanced bookmarks features if you want 'em.
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

hyperref - Only partially open bookmarks

Post by Montag »

frabjous wrote:Do want the bookmarks for subsections 2.1 and 2.2 not to be created at all, or do you just want them hidden at first, so you have to click on section 2 to expand the tree that contains them?

If the latter, then I think you could use

Code: Select all

\hypersetup{bookmarksopenlevel=1}
right at the start of section 2.
That is exactly what I wanted. Thank you. :)

Just to make sure for any other interested visitor, if this command is used for a section which comes before the "fully expanded" section, there has to be another

Code: Select all

\hypersetup{bookmarksopenlevel=2}
later on. Otherwise, the relevant section wouldn't have expanded bookmarks.
The bookmark package provides even more commands for advanced bookmarks features if you want 'em.
Thank you, I'll kep that in mind.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref - Only partially open bookmarks

Post by localghost »

Montag wrote:That is exactly what I wanted. Thank you. […]
Then, in the spirit of housekeeping, please mark the topic accordingly.
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Re: hyperref - Only partially open bookmarks

Post by Montag »

I swear I did! I guess I closed the tab too early. :/

But now it's how it should have been. :)
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Post Reply