# Which package should I load first: hyperref or bookmark?

I came to this question after looking for a way to explicitly end a `\part` (as described in this question: https://stackoverflow.com/questions/1483396/how-to-explicitly-end-a-part-in-latex-with-hyperref)

Using `\bookmarksetup{startatroot}` worked perfectly, but now I'm not sure if there is a reason for loading `hyperref` or `bookmark` first.

According to this post: Which packages should be loaded after hyperref instead of before? `bookmark` should be loaded after `hyperref`. However, is this always the case?

Any ideas how it should really be?

• Probably it doesn't matter in such example. However, it is known that `hyperref` shall be one of latest to be load. However, others explicitly depend on `hyperref` and therefore shall be loaded after. May 7 '13 at 15:51
• May 7 '13 at 15:51

`bookmark` loads `hyperref` since it uses some of the code contained within it. As such, it is sufficient to only load `bookmark`. Since loading of `hyperref` is included in `bookmark`, load order doesn't matter.

• At least in some cases, this breaks down if you want to pass extra options to the "base" package (here, `hyperref`). Is this an exception? Oct 8 '13 at 21:58
• @Blaisorblade: Then one should use `\PassOptionsToPackage{<options>}{hyperref}`. See Option clash for package. Oct 8 '13 at 22:10
• Isn't reordering packages often (though not always) an easier solution? Oct 8 '13 at 22:31
• @Blaisorblade: Sometimes, but the same things holds in that instance. As an example, what happens when `bookmark` loads `hyperref` with some options/ Oct 8 '13 at 22:35

Next to the answer of Werner I want to point to the example of the documentation. There the package `bookmark` is loaded after `hyperref`. So you can setup options for hyperref separat. However related to the documentation it's important to load hyperref without disabling the bookmarks.

Although `bookmarks` loads `hyperref` I prefer the loading of hyperref separat. The preamble is much clearer and you know what is loaded and why.

from the documentation:

``````2\documentclass{article}
3 \usepackage{xcolor}[2007/01/21]
4 \usepackage{hyperref}
5 \usepackage[
6   open,
7   openlevel=2,
8   atend
9 ]{bookmark}[2011/12/02]
10
11 \bookmarksetup{color=blue}
....
``````