26

I'm trying to run the code below but I receive this error: "Option clash for hyperref" Please guide me what should I do. Any help appreciated. Here is the code:enter image description here

30

hyperref is loaded twice:

\usepackage{hyperref}
\usepackage[...]{hyperref}

Just remove the first loading without options.

A package can be given several times in LaTeX, however, the options of the calls after the first \usepackage must be a subset of the options present in the first \usepackage call, because LaTeX does not actually input the .sty file more than one. (Otherwise each \newcommand, ... would cause errors, if called more than once.)

  • 9
    As an aside to this, I had an issue submitting to arXiv and repaired it by moving my call to hyperref above all other package calls. – Andrew D. King Apr 26 '16 at 0:23
  • 1
    @AndrewD.King \PassOptionsToPackage can be used to set additional options before the package is actually loaded. – Heiko Oberdiek Apr 26 '16 at 5:01
  • Seconding @AndrewD.King's comment: I just had the same problem and was very confused about what to do. A quick Google search led me here and his comment proved to be the solution! – Brendan W. Sullivan Jun 27 '16 at 20:59
  • It worked for me. Just be sure to search for the package which gives you the Option Clash error all over your files and see that it is loaded only once. – kalmanIsAGameChanger Sep 21 '17 at 17:21
  • I am currently having this issue, but I am using a template which contains hyperref twice, in the following format: \ifpdf \usepackage[ pdftex, other packages ]{hyperref} \DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf, .gif} \usepackage[pdftex]{graphicx} \pdfcompresslevel=9 \graphicspath{{0_frontmatter/figures/PNG/}{0_frontmatter/figures/PDF/}{0_frontmatter/figures/}} \else \usepackage[ dvips, other packages ]{hyperref} \fi – supercoolphysicist Mar 29 at 7:54

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.