The XeTeX reference manual says that this engine understands \pdfpageheight and \pdfpagewidth. However, is seems to ignore the requests to change paper size in the middle of the document. Consider this example (from https://www.tug.org/members/TUGboat/tb32-3/tb102veytsman-ebooks.pdf)

\advance\pdfpageheight by 2in
\advance\pdfpageheight by 2\topmargin
\advance\pdfpageheight by \footskip
\advance\pdfpageheight by \textheight
\advance\pdfpageheight by -\pagegoal}


This line has a footnote\footnote{\lipsum[6-8]}.

And this line too\footnote{\lipsum[12]}.

  1. pdflatex produces two pages with different page heights as intended.

  2. lualatex also works fine

  3. xelatex (XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011), xdvipdfmx-0.7.8) produces two pages of the same height (letter), which is not what I wanted.

My questions:

  1. Is this a bug in xetex or, possibly, in xdvipdfmx, or maybe I do something wrong?

  2. Are there any workarounds - for example, using PostScript \specials instead of \pdfpageheight?

1 Answer 1


What a complicated example ;-).

As default the both lengths have the value 0pt in xetex. If you change only one xetex will ignore it and fall back to the default. So you should also set \pdfpagewidth then it will work:

  • 1
    Thanks! I would consider this a bug: XeTeX manual says about compatibility with pdftex, and this behavior is not compatible. Still, your solution works great. By the way, the example was not contrived: people asked for this feature for e-book formatting - please see our paper.
    – Boris
    Jan 13, 2012 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .