[tex-live] hyperref trouble with color and graphicx

Zdenek Wagner zdenek.wagner at gmail.com
Fri Jun 26 16:21:58 CEST 2015


Have you tried to switch the order of paxckages? The documentation
says that hyperref should be loaded as the last one.
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz


2015-06-26 7:48 GMT+02:00 Hironobu YAMASHITA <h.y.acetaminophen at gmail.com>:
> Hello,
>
> I have some trouble with hyperref.sty when used at the same time with
> graphicx.sty. The following LaTeX source can cause an error.
> Please typeset using LaTeX + dvipdfmx.
> (tiger.pdf can be obtained by converting tiger.eps with Ghostscript.)
>
> ----- test.tex -----
> %#!latex -> dvipdfmx
> \documentclass{article}
> \usepackage[dvipdfmx,colorlinks=true,linkcolor=blue]{hyperref}
> \usepackage[dvipdfmx]{graphicx}
> \begin{document}
> I will introduce an example of mathematical beauty.
> \begin{equation}
>   e^{i \pi} + 1 = 0 \label{eq1}
> \end{equation}
> Equation (\ref{eq1}) is called ``Euler's identity.''
>
> Sample image here:
> \includegraphics[width=3ex]{tiger} % tiger.pdf (extension implicit)
> %\includegraphics[width=3ex]{tiger.pdf} % tiger.pdf
> Tiger!
> \end{document}
> ----- End of test.tex -----
>
> The error message is:
> ----------
> ./test.tex:12: LaTeX Error: File `tiger' not found.
>
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H <return>  for immediate help.
>  ...
>
> l.12 \includegraphics[width=3ex]{tiger}
>                                         % tiger.pdf
> ?
> ----------
>
> However,
> * When "colorlinks" option is removed, test.tex causes no error.
> * When .pdf extension is given explicitly, test.tex causes no error.
>
> I think this is because "dvips.def" is loaded internally by color.sty
> without driver option, and overloads "dvipdfmx.def" which has been
> already loaded by graphicx.sty. This problem can be fixed:
>
> l.2974 in "hyperref.sty" (2012/11/06 v6.83m)
> ----------
> \DeclareVoidOption{dvipdfmx}{%
>   \HyOpt at CheckDvi{dvipdfmx}{%
>     \def\Hy at driver{hdvipdfm}%
>     \PassOptionsToPackage{dvipdfmx}{color}% <- Add this line!
>   }%
> }
> ----------
>
> This will solve all the unexpected results coming from conflict
> between two drivers.
> I hope this information helps improve hyperref package.
> Regards,
>
> Hironobu Y
> AMASHITA
>
> h.y.acetaminophen at gmail.com



More information about the tex-live mailing list