Change paper size in the middle of a latex document?
Solution 1
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.
Solution 2
Here is an example which uses the typearea
package (KOMA-Script bundle) to insert an A3 page in the middle of the document:
\documentclass{article}
\usepackage{typearea} % loaded automatically if using KOMA-Script class
\begin{document}
\null
\KOMAoptions{paper=a3}
\recalctypearea
\null
\KOMAoptions{paper=a4}
\recalctypearea
\null
\end{document}
\recalctypearea
enforces the reevaluation of options. Some options trigger this themselves, but paper
does not. It also starts a new page if used mid-document.
Usagi
Updated on June 05, 2022Comments
-
Usagi about 2 years
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.
-
Usagi about 14 yearsThe problem with assembling the document separately is that links and counters will be broken. Unfortunately I need captions, figure numbering, and hyperref to be functional.
-
Joseph Wright about 14 yearsI'm intrigued by the nature of the document. How are the "odd" pages going to physically fit in with everything else?