# Option clash for package hyperref

I am trying to use hyperref in my tex file.. here is a minimal working example.. which gives me the option clash error

\documentclass[12pt]{report}

\usepackage{hyperref}
\hypersetup{
citecolor=black,
filecolor=black,
urlcolor=black,
}
\begin{document}

\end{document}


Everything was working fine earlier, but I had to reinstall my Ubuntu and now when I compile I get the error Option clash for package hyperref I am NOT explicitly calling hyperref twice. I only want to call it once. The thing is I had fixed the problem many months back, and now I just do not remember how I did it :( and this is driving me crazy.

UPDATE:

This is my precise output from command line pdflatex.exe with the above MWE. I get the same error for the MWE. The line 102 mentioned below is from hyperref.sty .. i found out by grepping in the folder.. what does that mean?

! LaTeX Error: Option clash for package hyperref.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.102 \usepackage
[numbered]{hypdoc}
? H
[]
There has now been an attempt to load it with options
to your \documentclass declaration may fix this.
Try typing  <return>  to proceed.

• Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jarauh Nov 25 '15 at 15:27
• the code you show loads hyperref once, so the code you don't show is also loading it once, I don't know what help we can give other than that given no information in the question. – David Carlisle Nov 25 '15 at 16:42
• also if you type h to the error prompt it describes how to avoid the error. – David Carlisle Nov 25 '15 at 16:42
• @jarauh I have added the MWE .. thank you for your response – physicist Nov 25 '15 at 19:36
• Hmmm... If I copy your MWE to a file and run pdflatex on it, I don't get any error. – jarauh Nov 25 '15 at 20:12

I guess you have an outdated system or you have an local tree, which containes an outdated package hyperref, calling hypdoc as you can see in the error message, you cited.

With the current MiKTeX, version pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2015.7.19) I added a command \listfiles (before \documentclass{}) to get a ist of used packages and versions on my system. You will found this list at the end of your .log file:

 *File List*
report.cls    2014/09/29 v1.4h Standard LaTeX document class
size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
hobsub.sty    2012/04/25 v1.12 Construct package bundles (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
hopatch.sty    2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
color.sty    2014/10/28 v1.1a Standard LaTeX Color (DPC)
color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
supp-pdf.mkii
nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)


Please compare with you system. I guess you will find some differences ...

• you are genius may I say, I figured out there was a stray hyperref.sty file in my directory. As you say it was old, and i just deleted it and it worked. Perils of having a cluttered directory. I saw your answer after fixing and you are bang ON. thank you :) – physicist Nov 25 '15 at 23:00
• Now I feel like a idiot for asking this question lol.. – physicist Nov 25 '15 at 23:03
• @physicist there is no need to feel like an idiot. To recognize such errors is not easy! And your qusetion can help other users having the same problem! – Mensch Nov 26 '15 at 0:07