[Tex/LaTex] Creating PDF bookmarks in custom order

bookmarkspdf

I use hyperref to create clickable PDF files. I have sections and subsections and they are all nicely in the PDF bookmarks.
Now there are certain items in my document that I want to appear in the bookmarks but not within the hierarchy of the sections, because this is rather like a short glossary. Like the most important theorems in alphabetical order. I know I can create custom bookmarks using \pdfbookmark. They appear and clicking them puts me to the right page but they appear right where their page number puts them in the order of sections.

  1. How can I decide where the bookmark
    appears? I would like to have them
    below the regular ones and ordered
    alphabetically (I can do the
    ordering myself once I know how to
    assign positions).
  2. Ideally even: create a dummy
    bookmark called "glossary" where
    clicking does nothing but which has
    all the ones mentioned above
    hierarchically below it, so one is
    not overwhelmed by the number of
    bookmarks when one first opens the
    document.
  3. And even further: I usually use
    hyperref with option
    bookmarksopen=true, is it possible
    in my new scenario, to have all the
    regular bookmarks open, but the
    glossary one closed? that would be
    the dream state for my document.

Best Answer

Adding bookmarks in "random" order is easy. But I don't know how to add a bookmark without action. Using a not-existing destinition doesn't look very clean to me.

\documentclass{article}
\usepackage{bookmark}
\begin{document}
 \bookmark[dest=None,open=true]{Open}
 \bookmarksetup{rellevel=1}
 \bookmark[dest=a]{A} %
 \bookmark[dest=b]{B}


 \bookmark[dest=None,startatroot,open=false]{Closed}
 \bookmarksetup{rellevel=1}
 \bookmark[dest=a]{A} %
 \bookmark[dest=b]{B}

b\hypertarget{b}{}%

\newpage
a\hypertarget{a}{}%
\end{document}

Edit: I asked Heiko about the "dummy" bookmark. His answer:

I do not know an official way (if there is any). Candidates: * named action with non-existing name * empty javascript action * an empty action object? * ...

And standards such as PDF/A might forbid much of the fun.

Related Question