We have this testcase which works fine with pdflatex

 pdfauthor={Silly testcase maker},



Hello folks
haha this is funny
lets do another page
now we have a working testcase for real huh
but rly
this is the label \pdfLabel{hahalulz} that was the label
but does it jump
that is the question folks


The purpose is to define a named destination within the PDF document called marker.hahalulz. This used to work with xetex when using debian squeeze, but now with debian Jessy it fails with xelatex (but still works with pdflatex) and we have no idea what the reason might be.

The failure-symptoms are that we are unable to jump to the named destination, for example with the command

$ evince -n "marker.hahalulz" testcase.pdf

Output of xelatex

This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/dev/Debian) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty

Package hyperref Warning: XeTeX driver only supports unicode.
(hyperref)                Enabling option `unicode'.


Package hyperref Message: Driver (autodetected): hxetex.


Package hyperref Warning: Height of page (\paperheight) is invalid (0.0pt),
(hyperref)                using 11in.

(./testcase.out) (./testcase.out) [1] [2] [3] [4] [5] [6] [7] (./testcase.aux) 
Output written on testcase.pdf (7 pages).
Transcript written on testcase.log.
  • 1
    You should never use the minimal class.
    – egreg
    Oct 30 '15 at 16:25
  • @egreg ah I was just trying to produce a minimal testcase. Since I've not worked with (latex|xetex)-from-scratch, I already forgot that. Thanks for noting this. I changed the class to article, but the problem remains. Oct 30 '15 at 16:42
  • I don't think that's the problem, though. Unfortunately the evince I installed on my machine with Homebrew refuses to open PDF files. :(
    – egreg
    Oct 30 '15 at 16:43
  • 2
    @JohannesSchaub-litb: I can confirm this with xelatex on my Vanilla TL 2015 -- it works with pdflatex, as you stated already
    – user31729
    Oct 30 '15 at 17:29

In dvipdfmx.cfg search for Dvipdfmx Compatibility Flags, and you can see:

%% Dvipdfmx Compatibility Flags
%%   0x0002  Use semi-transparent filling for tpic shading command,
%%           instead of opaque gray color. (requires PDF 1.4)
%%   0x0004  Treat all CIDFont as fixed-pitch font.
%%           This is only for backward compatibility. Don't use that.
%%   0x0008  Do not replace duplicate fontmap entries.
%%           Dvipdfm's (not 'x') behaviour.
%%   0x0010  Do not optimize PDF destinations. Use this if you want to
%%           refer from other files to destinations in the current file.

%C  0x0000

Add this line after %C 0x0000, and then named destinations will work as expected:

C  0x0010

Tested with MiKTeX 2.9 on Windows 7. For MiKTeX it's better to edit the user's configuration file dvipdfmx.cfg with:

initexmf --edit-config-file dvipdfmx

, and add the C 0x0010 line into this file.

  • Ah nice. Any idea why it worked in prior versions without modifications to that file? Dec 25 '15 at 10:16
  • Without digging into the source (too daunting for a newbie like me), I believe this is an optimization added later. As long as the named destinations don't have to be predictable, the driver (dvipdfmx) is free to assign short strings and get a smaller PDF. It's a quite fair tradeoff. In my laptop I just found a PDF generated in 2009 with xdvipdfmx 0.7.8, which used verbatim named destination strings. This must be the default behavior at that time and no other options were likely available.
    – wdscxsj
    Dec 25 '15 at 10:51
  • And these threads may be related: tug.org/mailman/htdig/xetex/2014-September/025563.html (complaint about the optimization), tug.org/mailman/htdig/xetex/2011-November/021870.html (encoding of non-ASCII characters).
    – wdscxsj
    Dec 25 '15 at 10:52
  • I had the same problem using \hypertarget{}{}and created a bug report on SourceForge.
    – Mik
    Sep 21 '16 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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