# [OS X TeX] Weird page size problem using XeLaTeX

Jonathan Kew jonathan_kew at sil.org
Tue Dec 20 06:37:59 EST 2005

On 20 Dec 2005, at 10:57 am, Martin Buchmann wrote:

> Hi all,
>
> i've just discovered XeLaTeX and the fontspec package for
> typesetting christmas cards, that's wonderfull :-)
>
> But there is kind of a problem if i want to use the eso-pic package
> and a landscape a5paper. It's working fine using pdfelatex or if i
> use xelatex without the eso-pic package but if i compile the
> minimal example given below, TeXniscope and Acroread show a whole
> a4 page with just the upper half used instead of a a5 page.
>
> Any ideas what i can do you get it done correctly?
>
> Best regards
>   Martin
>
> \documentclass[12pt,a5paper,landscape,pagesize]{scrartcl}
>
> \usepackage[colorgrid,texcoord]{eso-pic}
>
> \pagestyle{empty}
>
> \begin{document}
>
> Test
>
> \end{document}

To get a landscape a5 page, you need to tell xelatex that this is the
paper size you want, and apparently this isn't happening. Remember
that the paper (media) size of the PDF file is distinct from the size
used by LaTeX in formatting your text. When you run pdfelatex, one or
other of the packages you're using no doubt knows how to issue the
appropriate \pdf.... commands that set the media size, but these
won't work with other TeX engines.

One way to do it would be to run xelatex with the -papersize option:

xelatex -papersize=a5:landscape myfile.tex

The other option is to set the paper size from within the document,
which can be done with a \special command:

\special{papersize=a5:landscape}

should do it. This needs to occur at the beginning of the output, if
it's to take effect from the first page; LaTeX's \AtBeginDvi may be
one way to achieve this.

The ideal is for this to be done automatically by packages that want
to configure the paper size (such as the "pagesize" option in your
sample, I assume!). If the package supports drivers such as dvips or
dvipdfm, which also use \special{papersize=...}, then it might work
to give an option such as [dvips], to convince it to use the \special
command. But I haven't tried this, and don't know anything about the
specific packages you're using.

HTH,  JK

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/