TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The hyperref documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors.

However, there are exceptions, for instance the amsrefs user's guide notes that amsrefs has to be loaded after hyperref.

To avoid problems when adding hypertext functionality: do you know further such exceptions?

share|improve this question
Someone should write a package that takes a set of package names and loads them in the best order. Not me, though. – Jim Hefferon Feb 9 '12 at 1:02
My template (foundry.supelec.fr/gf/project/latextemplate) tries to do exactly this. It is full of \ExecuteAfterPackagesequences. Although I have to check with all the packages meantioned here! – Matthias Pospiech Apr 25 '12 at 18:25
Indeed, I changed the repository. It is now available for download at code.google.com/p/latexthesistemplate/downloads/list – Matthias Pospiech Aug 24 '13 at 15:04
@JimHefferon: Done by mhelvens: tex.stackexchange.com/q/123174/4918 – Tobi Mar 7 '14 at 1:38
@JimHefferon there’s the pkgloader package: i’ve only speed-read the docs, but it looks a good step towards automation for the job. (i assume it’s a never-ending process, keeping it up-to-date, but it's looking good.) – wasteofspace Sep 3 '14 at 20:46

11 Answers 11

up vote 79 down vote accepted
  • cleveref

Many others are documented in section 6 of the hyperref README. Some are more complex than simply loading after hyperref. Here are some more common ones...

  • amsrefs
  • float before hyperref before algorithm
  • chappg
  • sidecap
  • linguex
share|improve this answer
Thanks, also for pointing to the README. hyperref has an extensive README. Though, some packages like cleveref, breakurl and others mentioned here weren't listed there. I'll check and perhaps send a note to the author, perhaps he would like to add them. – Stefan Kottwitz Aug 17 '10 at 10:56
Good idea to contact the author. Heiko is generally very responsive about this things. – Lev Bishop Aug 17 '10 at 16:56
Thanks for improving my answer by adding the packages with options! (I already gave +1 to your answer, thus I cannot "more-upvote" here.) – Stephen Feb 9 '12 at 18:50
As a note, sidecap no longer has to be loaded after hyperref (as of 2002/05/24 v1.5h according to the linked document.) – Canageek Mar 28 '12 at 22:41
I really think that this is an example of one of the weaknesses of LaTex. Very frustrating behavior. – Nicholas Hamilton Dec 9 '12 at 5:31


From the minitoc documentation (section 2.17 Using the hyperref package with minitoc; emphasis added):

Since version #31, minitoc works correctly with the powerful hyperref package [...] If you add the loading of the hyperref package to a document yet using minitoc, you will get error message about spurious closing braces. Just let finish the LaTeX run, then re-LaTeX the document. There will be no problem if you remove the loading of hyperref and add it again: the problem occurs only when upgrading from minitoc #30 to minitoc #31 (or higher) with a document already processed and adding hyperref at the same time! It seems better to process the document with minitoc #31 (or higher) without hyperref, then with hyperref, because some internal commands written into the auxiliary files have been modified. If used, the hyperref package must be loaded before minitoc.

share|improve this answer

and probably also further packages with \RequirePackage{hyperref}. A quick search in TeX Live 2011 resulted in this list:

Packages with \RequirePackage[<some option(s)>]{hyperref}:

share|improve this answer
According to texdoc geometry, it should read: With mag <> 1000... I have edited the reply. – krlmlr Mar 21 '12 at 13:19
@user946850: Yes, there is a "not equal" sign in the pdf which died during copy & paste. Thanks for the correction! – Stephen Mar 22 '12 at 19:11
This may not be necessary any more for showkeys, as hyperref now has support for showkeys. See pages 207-208 of hyperref.pdf. – Ari Brodsky Feb 26 '14 at 21:02
Well, I'm partly wrong. \bibitem doesn't show its key if showkeys is loaded before hyperref. On the other hand, \autopageref gets broken if showkeys comes after hyperref. What to do? Maybe a bug report. – Ari Brodsky Feb 26 '14 at 21:42

Although not mentioned in its manual,

  • footnotebackref

loads hyperref without options before beginning its work. On that account, it might make better sense in documents to load footnotebackref second of the two.

share|improve this answer

I experienced problem with the package ellipsis when loaded before hyperref.

In addition, as Joseph Wright writes here, http://tex.stackexchange.com/a/64605/9632, cmap has to be loaded after hyperref.

share|improve this answer

The tabularx package is definitely one of the candidates. Otherwise links to footnotes are prevented.

share|improve this answer
tabularx should be loaded after or before hyperref? I'm loading it before and doesn't seem to give me any errors, and both documentations say nothing about it... – Mario S. E. Apr 24 '13 at 8:37
I doubt this is valid. Could you provide proof? – Werner Jul 25 '15 at 1:02

One more is

To quote its README:

Allows hyperref package and the natbib package with options numbers and sort&compress to work together. This means that multiple sequential citations (e.g [3,2,1]) will be compressed to [1-3], where the '1' and the '3' are (color-)linked to the bibliography.

share|improve this answer
As far as I can tell, hypernat is obsolete. You shouldn't load it either after or before hyperref. With modern versions of natbib and hyperref the sort&compress works and is linked without loading any other packages. – Lev Bishop Aug 23 '10 at 9:03
You're right... that's one less package I can load now. – Simon Sep 1 '10 at 4:47

I had some funny behaviour with pgfpages until I moved it after hyperref, but I'm not sure exactly what the issue was. I'm trying to replicate it, but I can't seem to get it to work at all now!

share|improve this answer

Other common ones include

  • bookmark
  • glossaries
share|improve this answer
Thanks! glossaries isn't even mentioned in manual or README. bookmark is recommended in the manual though without telling the loading order. – Stefan Kottwitz Aug 17 '10 at 11:02
Hi Stefan, although glossaries can be loaded before hyperref, you have to jump through extra hoops to make it work quite as well. Nicola isn't terribly explicit about this in her glossaries manual, although in her only coded snippet involving hyperref she loads glossaries 2nd of all (see p. 69). For me, I've achieved much better results with glossary autohyperlinks loading the two packages in this order too. – Geoffrey Jones Aug 17 '10 at 11:34
@Stefan: Actually, the glossaries manual has this to say: “If you load the hyperref or html packages prior to loading the glossaries package, commands such as \glslink and \gls […] will automatically have hyperlinks …” – Konrad Rudolph Aug 17 '10 at 12:02
So it's been made clear by Nicola, thanks! – Stefan Kottwitz Aug 17 '10 at 16:57

cleveref is one.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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