19

I would like to set the page size to the European A5. I wrote the following:

\documentclass[a5paper]{article}
\usepackage{fontspec}
\begin{document}
...

And process it with:

xelatex main.tex

The PDF that comes out doesn't look right. The actual printed area appears to be A5 but the size of the physical page is the US letter page.

Any ideas on what I'm doing wrong?

Thanks

lockstep
  • 250,273

2 Answers2

26

Use geometry:

\usepackage[pass]{geometry}

In this way the package will not make any modification to the standard settings, and will only tell the compiler the physical page size.

For nonstandard paper size, usage of geometry (without the pass option) is the best choice anyway.

egreg
  • 1,121,712
  • Do these settings \documentclass{article}\usepackage[a4paper]{geometry} produce the same effect as your answer does? – Display Name Jul 13 '11 at 03:10
  • @xport: no; geometry applies its own settings. – egreg Jul 13 '11 at 07:21
  • @egreg: Without using geometry package, we can use \special{papersize=...,...} right? – Display Name Jul 13 '11 at 07:36
  • 1
    @xport: the \special trick works with "(la)tex+dvips" or "xe(la)tex", but not with "pdf(la)tex" or "lua(la)tex". – egreg Jul 13 '11 at 07:43
  • 1
    Without knowing the dimensions, you can set \pdfpagewidth=\paperwidth \pdfpageheight=\paperheight (http://tex.stackexchange.com/a/65032/1340). Setting the PDF dimensions to different values won't work well - not without updating LaTeX margins and the rest of the layout. – Blaisorblade Mar 16 '13 at 18:26
  • 1
    @cabohah I just removed that part. If one wants nonstandard paper size, using geometry is needed anyway. – egreg Aug 30 '23 at 08:01
2

Since you are using xelatex, you can use \special{papersize=<width>,<height>} instead of using \usepackage[pass]{geometry} as follows.

\documentclass[a5paper]{article}
\special{papersize=148mm,210mm}% it is A5 paper size, I got from Wikipedia.
\usepackage{fontspec}
\begin{document}
Hi, I am xport !
\end{document}
Display Name
  • 46,933