I want open only the first button of tree

enter image description here

to create the levels i used this


To close the others levels i use this


but i get this result:

enter image description here

How open just the first button?

\usepackage[pdftex, bookmarksnumbered,  pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen]{hyperref}
\makeindex[columns=3, title=Alphabetical Index, intoc]




   to all my family



   hello world

In this example several keywords\index{keywords} will be
used which are important and deserve to appear in the
Terms like generate\index{generate} and some\index{others}
will also show up. Terms in the index can also be
nested \index{Index!nested}


\section{Second section}
This second section\index{section} may include some special
word, and expand the ones already used\index{keywords!used}.

  • Do you have more content at the same level as Start? Can you also just create a minimal document that compiles to your current output? Keep it minimal. – Werner Feb 26 '19 at 16:47
  • Have you seen this: tex.stackexchange.com/a/380706/29873 – DG' Feb 26 '19 at 19:54
  • @Werner i edited my question see please – x-rw Feb 26 '19 at 23:22

As I understand your request it was to have only the first level bookmarks open. Using your MWE, you can add bookmarksopenlevel=0 as an option to hyperref. (If you want deeper levels open, you can change 0 to 1 or some other value.)

With this modification of your current MWE:

\usepackage[pdftex, bookmarksnumbered,  pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen,bookmarksopenlevel=0]{hyperref}

I get the display shown: enter image description here

If I increase the depth by to 1, as follows

\usepackage[pdftex, bookmarksnumbered,  pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen,bookmarksopenlevel=1]{hyperref}

then I get:

enter image description here

| improve this answer | |
  • I get this error: ! LaTeX Error: Option clash for package hyperref. See the LaTeX manual or LaTeX Companion for exp – x-rw Mar 1 '19 at 15:47
  • I don't get this option clash with your MWE. Are you running the same code as your MWE above, plus only the bookmarkopenlevel=0 option as shown? If you have other packages/options that you have added, they may cause this. – John Mar 1 '19 at 16:31
  • 1
    Confirmed that this DOES address the difference on opening first time in SumatraPDF (which remembers last bookmark status thus will change on next run to whatever you last expanded) thus after user interference bookmarks may in some viewers not behave as author expected, however that is to be expected as normal. – user170109 Mar 3 '19 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.