\
pdfpagewidth
and
\
pdfpageheight
, that are written into the output PDF file.
Unfortunately, most of the core software predates PDFTeX, so not even
PDFLaTeX sets the correct values into those variables, to match the
paper size specified in a \
documentclass
option.
The DVI drivers dvips, dvipdfm and its
extensions (dvipdfmx and xdvipdfmx) define
\
special
commands for the document to specify its own paper size;
so in those cases, as when PDFTeX or VTeX is being used, the
paper size can be programmed by the document. Users who wish to, may
of course consult the manuals of the various programs to write the
necessary code.
The geometry and zwpagelayout packages (whose main
business includes defining
typeset page areas), also takes notice the size of the paper that the
document is going to be printed on, and can issue the commands
necessary to ensure the correct size of paper is used. If
geometry is used when a document is being processed by
PDFLaTeX, it can set the necessary dimensions “in the output”.
If the document is being processed by LaTeX on a TeX or e-TeX
engine, there are package options which instruct geometry
which \
special
commands to use. (Note that the options are
ignored if you are using either PDFLaTeX or VTeX.)
So, one resolution of the problem, when you are using LaTeX, is to add
Where\usepackage[processor-option,...]{geometry}
processor-option
tells the package what will produce
your (PostScript or PDF output — geometry knows about
dvips
and dvipdfm
(dvipdfm
also
serves for the extension dvipdfmx and
xdvipdfmx).
If you’re using PDFLaTeX, XeTeX or VTeX, load with
where\usepackage[program-option,...]{geometry}
program-option
is pdftex
,
xetex
or vtex
.
The alternative, zwpagelayout requires a driver
option:
(permissible <values> are\usepackage[driver=value,...]{zwpagelayout}
pdftex
, xetex
and dvips
; the default value is unknown
).
Needless to say, both the “big” classes (koma-script and
memoir) provide their own ways to get the paper size
“right”.
The typearea package is the Koma-script
distribution’s way of providing page layout functionality. Load it
with the pagesize
option and it will ensure the correct
paper is selected, for PDF output from PDFLaTeX, and for
PostScript output from LaTeX via dvips.
Memoir has the standard classes’ paper-size selections
(a4paper
, letterpaper
and so on), but also
permits the user to choose an arbitrary paper size, by setting the
length registers \
stockheight
and \
stockwidth
. The commands
\
fixdvipslayout
(for LaTeX processing), and \
fixpdflayout
(for PDFLaTeX processing) then instruct the processor to produce
output that specifies the necessary paper size.
This answer last edited: 2011-12-12
This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=papergeom