Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\documentclass{article}
\usepackage[pdftex,hidelinks]{hyperref}
\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?

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.