# Option clash with hyperref

If anyone has come across this issue when dealing with uploading tex files on arxiv, their experience would be of immense help:

I am trying to upload a `.tex` document to arxiv. I upload my .tex file and my .eps figures and .bbl as requested.

When I process my files no pages of output are produced because of an

`! LaTeX Error: Option clash for package hyperref.`

Now, how do I deal with this? How exactly/with what package must I use `\PassOptionsToPackage{...}` or `\RequirePackage{...}` as done here?

My preamble is:

``````\documentclass[a4paper,12pt]{article}
\usepackage[margin=2.5cm,letterpaper]{geometry}
\usepackage{authblk}
\usepackage{setspace}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[super,comma,sort&compress]{natbib} % enhances bibtex citations
\usepackage{hypernat}
\usepackage[english]{babel}
\usepackage[T1]{fontenc} %Useful for file names with underscores in them
\usepackage{float}
\usepackage{grffile}
\newcommand{\hilight}[1]{\colorbox{yellow}{#1}} %To highlight text
\renewcommand{\thefootnote}{\alph{footnote}} %For footnotes
``````

Log file generated by arxiv is available here on pastebin

# EDIT:

I edited my latex file and removed `\usepackage{hyperref}`. This definitely got rid of the `! LaTeX Error: Option clash for package hyperref.` message but now the arXiv TeX compiler gives me a fatal error after several `package natbib warning`s for all the references.

Do I have a problem with `natbib` only?

-
your shown code can't produce this kind of error message. Create a complete example, which shows the error. – Herbert Jun 11 '13 at 15:26
@Herbert That is the problem. when I run latex on my .tex file: no errors, no grief! However when I upload my latex file to `arxiv`: all kinds of errors! Will try to put together a minimum working example but I daresay this might be an arxiv related issue. – drN Jun 11 '13 at 15:32
@drN: Then do not load hyperref. I suppose it is done by the documentclass or something else. – Herbert Jun 11 '13 at 15:34
@Herbert Yes. I am modifying my document to work without hyperref. Lets see what transpires! – drN Jun 11 '13 at 15:46
drN, if you have found an answer to your question then by all means post it as an answer! – Scott H. Jun 11 '13 at 19:24

## 3 Answers

I had to contact the folks at arXiv and they asked me to include ```authblk.sty setspace.sty, subfig.sty, caption.sty, caption2.sty, caption3.sty, babel.sty``` with my .tex document and eps figures and .bbl file.

Apparently these style files are the only packages that might be mixed versions from what we're running in our environment.

This sorted everything out and I have a submission on arXiv now!

-
Where do I find all these style files? – Erel Segal-Halevi Oct 12 '15 at 6:57
@ErelSegal-Halevi On Linux, you can use `locate caption.sty` to find `/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption.sty`. – Martin Thoma Nov 29 '15 at 14:25
setspace.sty did it for me. – Seppo Enarvi May 3 at 15:12

I got the same problem but the solution was entirely different.

Initially, the arXiv submission failed. I did a search for "error" and found the phrase "! LaTeX Error: Option clash for package hyperref." so I thought this was the cause.

But, it turned out that the submission failed because of an unrelated problem - I forgot to upload one of the graphic files. Once I uploaded that file, I got a message saying "Submission processed OK". I still see the error message "! LaTeX Error: Option clash for package hyperref.", but the PDF is created OK and I can proceed with the submission to arXiv.

-

I had this problem and after removing `natbib` got resolved. Clearly, this solution won't work for papers that need to use `natbib`.

-
What do mean with "resolved"? You have lost the functionality of `natbib` then. Are you sure that is wanted by the op? Because we have no MWE and no bib file we can only guess. But nevertheless: Welcome! – Kurt Feb 17 at 22:53
I realized that I did not need `natbib` in my article. I removed it and arXiv was able to process my files. As I say in the answer, this will not work for everyone, but since it resolved my problem, there is a chance that it may resolve others' too. – Taha Feb 18 at 2:32