# Apparent conflict when using hyperref and pdfcomment together

There appears to be a conflict with using the hyperref package and pdfcomment. Take the following example:

\documentclass{article}
\usepackage{pdfcomment}
\begin{document}
\end{document}


I get a warning message from hyprerref related to pdftex being called twice and that it changes nothing. I don't really like to leave a document with warning messages on the compilation. If I change the order of the packages, then there is an outright error. The error relates the the hidelinks option, though I think it is probably a problem with other options too. If I remove the option, then the code will compile without error or warning (provided that pdfcomment is loaded first.)

Any ideas about a resolution for this: should I be passing a bug report onto either of these two parties?

-

I don't think you need to be worried about this: what you're getting is a Warning message, not an Error message:

Package hyperref Warning: Option pdftex' has already been used,
(hyperref)                setting the option has no effect on input line [xx].


This warning message is generated by LaTeX while it's setting up the pdfcomment package, which (among others) also loads the hyperref package.

Furthermore, because pdfcomment loads the hyperref package anyway, you needn't even load hyperref separately. After loading the pdfcomment package, just issue the command \hypersetup{hidelinks,<any other options>}.

Finally, it may be worth noting that hyperref checks which engine is compiling the document; if it's "pdftex", it automatically enables the pdftex option for you -- no need for you to specify it.

-
Thanks for this. I basically don't like warning messages... I'm a kind of neat freak. this was helpful, I didn't know about the \hypersetup command, so the solution is still kind of elegant. One should make sure that the pdfcomment package is loaded in the same place as hyperref` (relative to other packages) or else some odd warning messages can come up. –  aghsmith Jan 27 '12 at 22:12