tex_logos_04.gif (2422 bytes)
Adjusting page size and text placement in TeX and in AMS-TeX

If you just want some ready to use sample AMSTeX (with preprint style) documents and want to skip the explanations, see amstex.html

TeX is much faster than LaTeX and if you use AMS-TeX you have almost as many conveniences as in LaTeX. However you may have problems with the text body size on the page and with the margins. Problems are especially prevalent if you use the AMS preprint style amsppt.sty and global magnification. Fortunately TeX provides a solution.

The important thing to remember is that TeX refers all locations to an anchor, 1 inch in from the left edge of the paper and 1 inch down from the top of the paper. This anchor is independent of the actual paper size, magnification, etc. Normally the top left corner of the text body falls at the anchor.

The command \hoffset may be used to adjust the starting position of the text body relative to the anchor horizontally, while \voffset may be used to make vertical adjustments.

The length of the text line is set by \hsize and the height of the text body on the page (exclusive of space for page numbers) is set by \vsize.

If you run TeX on the simple file

%% test01.tex
%% use tex to process

horizontal size \the\hsize

vertical size \the\vsize

\bye

(test01.pdf) you will find the TeX defaults are


hsize: 469.75 points = 39.15 picas = 6.50 in = 16.50 cm

vsize: 643.20 points = 53.60 picas = 8.90 in = 22.61 cm

On 8.5 by 11 inch paper you will get 1 inch margins all around.

If you run the same file through AMS-TeX you will get the same numbers unless the amsppt.sty preprint style has been loaded into the amstex format file, or you specify the preprint style be used.

Here is a test file:

%% test02.tex
%% use tex or amstex to process

\input amstex  % in case the tex command rather
               % than the amstex command is given.

\documentstyle{amsppt}

horizontal size \the\hsize

vertical size \the\vsize

\bye

(test02.pdf) This time the results are

hsize: 360.00 points = 30.00 picas = 4.98 in = 12.65 cm

vsize: 587.00 points = 48.92 picas = 8.12 in = 20.63 cm

If you were actually tex-ing a document here you would have a small page that is offset too far to the left and perhaps too high up. The page is the default size for AMS journals (that's why it's called a preprint style), but not suitable for letter size paper.

Now let's consider what happens if you use \magnification to get a document in which all the page elements are larger.

%% test03.tex
%% use tex to process

\magnification\magstep 5

horizontal size \the\hsize

vertical size \the\vsize

\bye

(test03.pdf) This time the hsize is reported as 188.8078 points and the vertical size as 258.5216 points. Thus TeX has adjusted the text body size so you will still get a nice result. Note TeX achieves the magnification in a sense by diminishing the (virtual) page! That is why \magnification resizes all page elements, not just font sizes.

You can think of \magnification as working by typesetting a small page and then magnifying the page image for the actual output. Dimensions in TeX refer to the small page. To refer to sizes on the actual output page one has to use the "true" keyword  (see below).

Try adding some text to the file test03.tex to see that everything works.

Now try

%% test04.tex
%% use tex or amstex to process

\magnification\magstep 5
\input amstex  % in case the tex command rather
               % than the amstex command is given.

\documentstyle{amsppt}

horizontal size \the\hsize

vertical size \the\vsize

\bye

(test04.pdf) Whoops! This time the text body is set to 360 pt by 587 pt. If you add some text it will spill off the right side of the paper. The problem here is that amsppt.sty sets the dimensions of the page with no regard for your magnification.

Simply changing the order of the commands does not fix the problem. The solution is the keyword "true" which tells TeX the actual size that you want for your (magnified) output.

%% test05.tex
%% use tex or amstex to process

\magnification\magstep 5

\input amstex  % in case the tex command rather
               % than the amstex command is given.

\documentstyle{amsppt}
\hsize=470 true pt
\vsize=643 true pt

horizontal size \the\hsize

vertical size \the\vsize

\bye

(test05.pdf) Note that the size specifications must come after the \documentstyle{amsppt} command and must include the keyword "true."

If you are using an AMS-TeX format which includes amsppt.sty, so you do not have to specify it, then put the size commands anywhere after the \magnification command. It does not hurt however to include the \documentstyle{amsppt} command followed by the size commands as above. Then you don't have to worry about the format file you are using.

Now suppose you want to produce an amsppt document with 1/2 inch margins all around and with a bit of magnification. Here is one way to do it:

%% test06.tex - 0.5 in margins
%% use tex or amstex to process

\magnification\magstep 1

\input amstex  % in case the tex command rather
               % than the amstex command is given.

\documentstyle{amsppt}
\hsize=7.5 true in
\vsize=9.9 true in
\hoffset=-0.5 in
\voffset=-0.5 in

This file is an exciting test file.
This file is an exciting test file.
This file is an exciting test file.
This file is an exciting test file. (etc.)

\bye

(test06.pdf) At larger magnification you may find the margins are not quite as you expected. You can fine-tune them by adjusting \hoffset and \voffset a bit. If you look at the sample file (test06.pdf) you will see that even at \magstep 1 some fine-tuning is needed to make reasonable room for the page numbers and to adjust the vertical position on the page to be more pleasing.

Here are the sample files indicated above. I have included some (mundane and unexciting) text in the files so you can see what is happening.

test01.tex test01.dvi test01.ps test01.pdf
test02.tex test02.dvi test02.ps test02.pdf
test03.tex test03.dvi test03.ps test03.pdf
test04.tex test04.dvi test04.ps test04.pdf
test05.tex test05.dvi test05.ps test05.pdf
test06.tex test06.dvi test06.ps test06.pdf

Last updated Thursday, April 10, 2003
Bent E. Petersen

petersen@math.oregonstate.edu

Back to the TeX index page

HOME