Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change paper size in the middle of a latex document?

Does anyone know how to change these length parameters in the middle of a latex document?

  • \paperwidth
  • \paperheight

I would like to define a page size for a single page (possibly two or three). I tried v5.3 of the geometry package, which just added some new features; like \newgeometry. Unfortunately \newgeometry cannot be used to redefine \paperheight and \paperwidth.

Any help would be very appreciated.

like image 727
Usagi Avatar asked May 11 '10 17:05

Usagi


1 Answers

You can't do this in DVI mode: the DVI format specifies the coordinate bounds in the preamble (maxv, maxh) and has no opcodes to change the values once set. DVI doesn't really have a notion of page dimension anyway; cf. my answer to the dvi generation: no bounding box question. You might be able to mess about with Postscript specials and do this that way: I don't know how.

In PDF mode (Pdftex, Xetex (and Luatex with pdf prefix removed from macro names)) you can change PDF dimensions:

\documentclass{article}
\begin{document}

Normal page
\eject

\pdfpagewidth=3in \pdfpageheight=10in
Tall page
\eject

\pdfpagewidth=10in \pdfpageheight=3in
Wide page

\end{document}

It's best to issue these dimension changes before anything has been typeset on the page, since these dimensions affect how Tex lays out content. Also note that your choice of margins, etc., should be guided by page dimensions and need to be reset accordingly.

like image 109
Charles Stewart Avatar answered Nov 07 '22 09:11

Charles Stewart