# [XeTeX] XeTeX equivalent to \pdfpagewidth ?

enrico.gregorio at univr.it enrico.gregorio at univr.it
Fri Jul 2 14:48:54 CEST 2010

> Dear Colleagues --
>
> Studying
>
> http://xml.web.cern.ch/XML/lgc2/xetexmain.pdf
>
> I can see no mention of "page width".  What is the XeTeX method
> for setting the page width, analogous to PdfTeX's \pdfpagewidth,
> please ?  (Of course, I will also want to set the page
> height !).
>
> Philip Taylor

After looking at what geometry does, it seems that it works like in dvips,
i.e., by writing a \special in the xdv file. Line 1016 of geometry.sty says

\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}

and, of course, you can set as you prefer the two parameters. If you
compile

\documentclass{amsart}
\usepackage{lipsum}
\paperwidth=10cm \paperheight=20cm
\textwidth=.8\paperwidth \textheight=.8\paperheight
\calclayout
\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
\begin{document}
\lipsum[1-50]
\end{document}

(which exploits the \calclayout macro of amsart, just to avoid computing
parameters), you'll see that everything is OK. With amsart one can also
use geometry, of course. With this package, \pdfpaperwidth and \pdfpaperheight
are defined to be the same as \paperwidth and \paperheight.

(Xe)LaTeX users would take care of non standard page sizes with geometry,
anyway. Plain TeX addicts should simply say

\special{papersize=<width>,<height>}

Ciao
Enrico

--
Enrico Gregorio          + Dipartimento di Informatica          + Tel: +39 045 8027937
Enrico.Gregorio at univr.it + Università degli Studi di Verona     +
(gregorio at math.unipd.it) + Strada le Grazie 15 / I-37134 Verona + Fax: +39 045 8027928