views:

519

answers:

4

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.

A: 

Paper size is somewhat awkward, particularly in DVI mode (as things have to be controlled by specials). Paper size can also only change at a page break (for obvious reasons). The usual recommendation is to make the differently-sized parts as separate documents, and to use something like pdfpages or a stand-alone PDF tool to assemble the different parts into one file once the typesetting is done. If you have only a few "odd" pages, you could create them as PDFs and the just include those in your main file using pdfpages.

Joseph Wright
The 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.
Usagi
I'm intrigued by the nature of the document. How are the "odd" pages going to physically fit in with everything else?
Joseph Wright
+1  A: 

You can't do this in regular Tex: 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 Pdftex (and Xetex), you can change pdf dimensions; e.g.:

\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.

Charles Stewart
A: 

I have the same problem, in my case want to combine A3 pages (qith a bog figure on it) within the document. They fit well as they double the A4 size, which is good for printing tips as long as A3 pages are always odd pages. Then you need to leave a page blank after A3 qnd keep going on with the normal document...

joana
A: 

Here is an example which uses a KOMA-Script class to insert an A3 page in the middle of the document:

\documentclass[version=last, pagesize=auto, paper=a4]{scrartcl}

\begin{document}

\null
\clearpage

\KOMAoptions{paper=a3}
\recalctypearea

\null
\clearpage

\KOMAoptions{paper=a4}
\recalctypearea

\null

\end{document}
Philipp