[XeTeX] xelatex, hyperref, and new TeXLive

David Carlisle d.p.carlisle at gmail.com
Thu Jun 16 01:45:08 CEST 2016


On 16 June 2016 at 00:25, Ross Moore <ross.moore at mq.edu.au> wrote:

> Hi Mike, David, Herb,
>
> I’m seeing the same behaviour, but for me the packages are as follows:
>
> (/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
>
> /usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/hyperref.sty:4322:
> Packag
> e hyperref Error: Wrong DVI mode driver option `dvipdfmx',
> (hyperref)                because XeTeX is running.
>
>
>
>


Yes that's with the file with an explicit [dvipdfmx] option, as far as I
can see
hyperref has always (or at least for some years) given that error on xetex
it insists on xetex option (which would be the default if the correct cfg
is loaded)


>
> Here is the relevant coding from  hyperref.sty  with annotations added by
> me.
>
> \newif\ifHy at DviMode
>
> This defines  \ifHy at DviMode and switches, leaves it as  \iffalse
>
> \let\Hy at DviErrMsg\ltx at empty
> \ifpdf
>   \def\Hy at DviErrMsg{pdfTeX or LuaTeX is running in PDF mode}%
> \else
>   \ifxetex
>
> This is already  \iftrue
>
>     \def\Hy at DviErrMsg{XeTeX is running}%
>
> … but surely we should be setting  \Hy at DviModetrue  here !!!
>



Hmm perhaps...
 although the end result is that it just turns the error into a warning and
ignores the specified option so you'd get

Package hyperref Warning: Wrong driver `hdvipdfm.def';
(hyperref)                XeTeX is running.
(hyperref)                Forcing driver `hxetex.def' for XeTeX.

probably giving an error and making the user fix the document is as clear,
and certainly what it's always done.


>   \else
>     \ifvtex
>       \ifvtexdvi
>         \Hy at DviModetrue
>       \else
>         \def\Hy at DviErrMsg{VTeX is running, but not in DVI mode}%
>       \fi
>     \else
>       \Hy at DviModetrue
>     \fi
>   \fi
> \fi
>
>
> The result is that when you subsequently request   [dvipdfmx]  or  any
> other driver,
> hyperref thinks that we are in non-dvi mode, so  *incorrectly* throws the
> error.
>
> So it’s surely an omission in  hyperref.sty .
>
> But you don’t actually need to specify a driver option,
> and everything works OK anyway.
>

It only works with no option if you are not using a hyperref.cfg that
specifies incompatible options:-)


>
>
>   Mike Maxwell
>
>
>
> Hope this helps,
>
> Ross
>
>
>
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20160616/738bf2e1/attachment-0001.html>


More information about the XeTeX mailing list