[Tex/LaTex] Whats the appropriate paper size command with xelatex these days

paper-sizexetex

i am trying to use xelatex from the mactex 2012 package to build a paper at DIN A4 paper size.
using any of the following commands does not do the trick, it keeps set at 21,59 × 27,94 cm which is us-letter format i guess. those are the commands i found by researching on the internet to change the paper size:

\documentclass[paper=a4]{report}

throws the error LaTeX Warning: Unused global option(s): [paper=a4]. same thing using just [a4]

\documentclass[a4paper]{report}

does not throw the error, but its not changing the paper size either. it simply does nothing.
so my question is: how do i set the paper size to A4 = 21 × 29,7 cm correctly?

Best Answer

To set the paper with for LaTeX use the option "a4paper" or "a5paper". But this option only set an internal LaTeX length. To change also the size of "pdf background" you must issue some special commands. Which ones depends on the engine. If you load a package like hyperref, geometry, graphics they will do the work for you. Without such a package you can use with xelatex this:

\documentclass[a5paper]{report}
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight
\begin{document}
blub

\end{document}

(I'm using a5 paper to avoid that some default paper settings hide the effect.)