Package loading order with hyperref
The hyperref package 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. Many others are documented in section 6 of the hyperref README.
To avoid problems when adding hypertext functionality, here is a list of exceptions, that is, a list of packages which have to be loaded after hyperref, instead of before hyperref:
cleverefamsrefsfloatbeforehyperrefbeforealgorithmchappgsidecaplinguexminitocgeometry: From the User manual: Withmag <> 1000, notruedimenandhyperref,hyperrefshould be loaded beforegeometry. Otherwise the resulted PDF size will become wrong.robustindexhypdestopt,hypcap,hypbmsechypernatattachfileshowframe,showidx(which disables the\hrefs in the index but in this loading order at least documents compile at all)uri,pageslts,regstatsrefcheckbookmarkglossariesapacite
Probably also further packages with \RequirePackage{hyperref}. A quick search in TeX Live 2011 resulted in this list:
amsrefsattachfile2bugtracker(part ofpgfplots)classicthesisdoidtx-style(part ofthuthesis)eformsexerquizhypgotoeinsdljsltxdockitopcitprerexrec-thytdclocktoptesiydoc-codeandydoc-desc(both part ofydoc; note, thatydoc-doccontains\hypersetupwithout loadinghyperref) )
Packages with \RequirePackage[<some option(s)>]{hyperref}:
beamerbasearticlebidituftehyperrefchextrascmpjdtk-pdfeasy-todohephrefhideifmslidelstdococgtoolspdfcommentpdfscreenpdfxrvdtxstrukdocucshyper
This list was created on TeX.SE with the help of Lev Bishop, Stephen, Geoffrey Jones, Simon, Werner, and Stijn Hoop.


