The pageparms package^{∗}

Andrew D. Lewis

1998/03/05

1 Using the pageparms macros

Do you find the standard L^{A}TEX page size too small? And do you hate having to figure out what the margins should be in order to make your new page size work? And besides, this process will only work for a specific paper type (e.g., letter or a4). Well, with this in mind, I wrote the pageparms package. It first of all increases the default page size immediately upon loading to a width of 6 inches and a height of 8.5 inches. And if you want to change these dimensions, you can use the

\settextwidth commands \settextwidth and \settextheight, giving each the argument you

\settextheight like (of course, it must be a legal TEX length). If you just know you want to make

\widenpage a page bigger, use the commands \widenpage and \heightenpage (use negative heightenpage dimensions to decrease size).

Warning!! \pageparms is no good if you want to make twosided pages with different margins for the odd and even pages. It always balances the margins.

The package also makes it possible to easily put two pages on a single page with the aid of Timothy Van Zandt’s 2up package. Simply use the option 2up with pageparms. The default option is 1up which is specified in the absence of any options.

2 Implementation

1 ⟨∗package⟩

The code is borrowed from the L^{A}TEX document classes where they have devised a way to set these dimensions in a manner which doesn’t depend on the paper type.

   First we have the user commands \settextwidth, \settextheight, \widenpage,
and \heightenpage.

2

 3 \DeclareOption{2up}{\def\@ADL@@twoup{\@ne}}
 4 \DeclareOption{1up}{\def\@ADL@@twoup{\z@}}
 5 \ExecuteOptions{1up}

∗This file has version number v1.0a, last revised 1998/03/05.

 6 \ProcessOptions

7

 8 \newcommand\settextwidth[1]{\textwidth#1\@settopoint\textwidth
 9 \@ADL@balancesidemargins}

10

11 \newcommand\settextheight[1]{\textheight#1\@ADL@balancetopmargin}

12

13 \newlength\@ADL@temptextwidth
14 \newcommand\widenpage[1]{\setlength{\@ADL@temptextwidth}{\textwidth}
15 \addtolength{\@ADL@temptextwidth}{#1}\@settopoint\@ADL@temptextwidth
16 \settextwidth{\@ADL@temptextwidth}}

17

18 \newlength\@ADL@temptextheight
19 \newcommand\heightenpage[1]{\setlength{\@ADL@temptextheight}{\textheight}
20 \addtolength{\@ADL@temptextheight}{#1}\@settopoint\@ADL@temptextwidth
21 \settextheight{\@ADL@temptextheight}}
\@ADL@balancesidemargins takes the current value of \textwidth and makes

the margins so they are correct. \@ADL@balancetopmargin does the same with

\textheight.

22

23 \newcommand\@ADL@balancesidemargins{%
24 \PackageWarning{pageparms}{Balancing Margins}
25 \setlength\@tempdima        {\paperwidth}
26 \addtolength\@tempdima      {-\textwidth}
27 \setlength\oddsidemargin    {.5\@tempdima}
28 \addtolength\oddsidemargin  {-1in}
29 \setlength\marginparwidth   {.5\@tempdima}
30 \addtolength\marginparwidth {-2\marginparsep}
31 \ifdim \marginparwidth >2in
32  \setlength\marginparwidth{2in}
33 \fi
34 \@settopoint\oddsidemargin
35 \@settopoint\marginparwidth
36 \setlength\evensidemargin  {\paperwidth}
37 \addtolength\evensidemargin{-2in}
38 \addtolength\evensidemargin{-\textwidth}
39 \addtolength\evensidemargin{-\oddsidemargin}
40 \@settopoint\evensidemargin}

41

42 \newcommand\@ADL@balancetopmargin{%
43 \addtolength\textheight{\topskip}
44 \setlength\topmargin{\paperheight}
45 \addtolength\topmargin{-2in}
46 \addtolength\topmargin{-\headheight}
47 \addtolength\topmargin{-\headsep}
48 \addtolength\topmargin{-\textheight}
49 \addtolength\topmargin{-\footskip}     % this might be wrong!
50 \addtolength\topmargin{-.5\topmargin}
51 \@settopoint\topmargin}

The defaults.

52

53 \settextwidth{6in}
54 \settextheight{8.5in}

55

56 \ifnum\@ADL@@twoup=\@ne
57 \RequirePackage{2up}
58 \twoupplain
59 \setlength\paperheight{12in}
60 \setlength\paperwidth{15.9in}
61 \fi

62

63 \newcommand\twouphack{\ifnum\@ADL@@twoup=\@ne
64 \ifodd\thepage\null\newpage\null\newpage\fi\fi}

65

66 ⟨/package⟩