[XeTeX] hyperref 6.79n breaks xetex's (xdvipdfmx) ability to set proper page dimensions (and overrides page dimensions on pdftex)

Heiko Oberdiek oberdiek at uni-freiburg.de
Mon Dec 14 13:36:29 CET 2009


On Mon, Dec 14, 2009 at 01:28:55PM +0300, Vladimir Volovich wrote:

> Hi Ulrike,
> 
> "UF" == Ulrike Fischer writes:
> 
>  UF> I don't think that the "unicode" option should be used with xetex.
>  UF> As far as I know it is similar to inputenc and tries to translate
>  UF> 8-bit-input.
> 
> option "unicode" tells hyperref to use UTF16-encoded PDF strings
> (which are used e.g. in bookmarks or in pdf title, etc), instead of the
> default PD1 encoding (since PD1 is an 8-bit encoding which is not
> capable of storing anything beyond some accented latin characters).
> 
> OTOH, as far as i know, hyperref relies on active characters
> (i.e. inputenc) to convert strings to unicode, so i'm not sure how it
> is supposed to work with xetex, where inputenc is usually not used.

Since 2009/11/20 v6.79g hyperref supports Unicode characters with more
than 8 bits.

> Does hyperref (with unicode bookmarks) work with xetex?

AFAIK yes (regardless the mysterious conversion warning).

> BTW, a couple of other observations:
> 
> 1) When i use xetex and xdvipdfmx binaries from TeX Live 2009, but with
> old version of hyperref (6.75r), the test file works just fine with
> xetex, i.e. the page dimensions are 300x300 pts.

But \paperwidth and \paperheight are wrong.

> same as if i generate the test.xdv file (using -no-pdf
> option passed to xelatex) on TeX Live 2007, then running "xdvipdfmx
> test.xdv" gives correct page size in test.pdf on both TL2007 and TL2009.
> i.e. the bug seems to be triggered by a new version of hyperref.

The bug is in the user input by not setting \paperwidth and
\paperheight correctly.

> ok, that would explain why hyperref is resetting the page dimensions
> with pdftex (though i'm not sure why hyperref goes into business of
> setting page dimensions).

It should be done by LaTeX a long time ago. But LaTeX2e is frozen
and nothing will change. :-((
Thus other packages like hyperref, geometry, ... has to do it.

> But why is it not resetting them with xetex?

It does. LaTeX's concept of paper size is \paperwidth and \paperheight.
The task of the output drivers is to read these registers and
set page size parameters of the output device
(\pdfpagewidth, \pdfpageheight or \special{pagesize=...} or ...).

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the XeTeX mailing list