[XeTeX] landscape mode with XeLaTeX

Bruno Voisin bvoisin at mac.com
Mon May 12 11:43:19 CEST 2008


Le 12 mai 08 à 10:07, Daniel Greenhoe a écrit :

> How can I produce a pdf with landscape orientation using XeLaTeX.  
> Here is what I have tried so far
>  xelatex -papersize=landscape filename
>  xelatex -papersize="a4 -l" filename
>  xelatex -papersize=a4:landscape filename
>
> These give me the following error messages:
>  ** ERROR ** Unrecognized paper format: landscape
>  ** ERROR ** Unrecognized paper format: a4 -l
>  ** ERROR ** Unrecognized paper format: a4:landscape
>
> I am running Miktex 2.7 on a Windows XP platform.

Not sure how to make this work. "xetex -help" says

-papersize=STRING       set PDF media size to STRING

but gives no detail on the syntax or allowed values for STRING.

The syntax a4:landscape seems to be one for the Mac-specific XDVI-to- 
PDF driver xdv2pdf. For it, "xdv2pdf -h" returns

usage: xdv2pdf [-m mag] [-p papersize[:landscape]] [-v] [-o pdfFile]  
xdvFile
     papersize values: a0/a1/a2/a3/a4/a5/a6/a7/a8/a9/a10/b0/b1/b2/b3/ 
b4/b5/b6/b7/b8/b9/b10/c0/c1/c2/c3/c4/c5/c6/c7/c8/c9/c10/jb0/jb1/jb2/ 
jb3/jb4/jb5/jb6/jb7/jb8/jb9/jb10/letter/legal/tabloid/ledger/wd,ht [in  
'big' points or with explicit units]

But on other platforms, the XDVI-to-PDF driver is xdvipdfmx for which  
"xdvipdfmx -h" returns

-l 		Landscape mode
[...]
-p papersize	Set papersize [a4]

Hence you might try something like

xelatex -output-driver="xdvipdfmx -p a4 -l" filename

or even better (given the -q and -E options are also used by default,  
on the Mac at least)

xelatex -output-driver="xdvipdfmx -q -E -p a4 -l" filename

That said, there are also the primitives \pdfpageheight and  
\pdfpagewidth which can be used in the XeLaTeX input file. Hence,

\setlength{\pdfpageheight}{210mm}
\setlength{\pdfpagewidth} {297mm}

might do the trick as well, I've never tried.

Hope this helps,

Bruno Voisin




More information about the XeTeX mailing list