[Help] [LaTeX top]

Latex Margin Placing

The parameters guiding the placement of text on the page in LaTeX can be quite confusing. The following should give you some help.

LaTeX assumes that the origin is 1in down from the top of the paper and 1in in from the lefthand side of the paper. \hoffset and \voffset, which should be used for resetting the origin, will be ignored in the following.

Horizontal measurements

Three things guide the horizontal placement of text
\oddsidemargin
The lefthand margin on odd numbered pages
\evensidemargin
The lefthand margin on even numbered pages
\textwidth
The width of the text
Note that unless the twoside option is chosen the \evensidemargin affects nothing. In 10pt article style the oddsidemargin is 63pt. Remember that this is from the origin so the actual lefthand margin is 1in+63pt or about 1.9in. The \textwidth for the same style is 345pt (~4.8in) so the righthand margin would be ~1.8in (8.5in - \textwidth - \oddsidemargin - 1in).

Vertical measurements

Vertical measurements are more complicated. The parameters guiding it are
\topmargin
The top margin of the page (to the header)
\headheight
height of the running head box
\headsep
Distance from head to body of the text
\textheight
Height of actual text
The following two parameters only affect the placing of the foot
\footskip
The distance from the bottom of the last line of text to the bottom of the running foot
\footheight
Height of the foot box.
In 10pt article the \topmargin is 27pt which means the actual distance from the top of the page to the top of the running head is 1in+27pt (~1.4in). The \headheight is 12pt and the \headsep is 25pt making the actual distance from the top of the page to the top of the text to be ~1.9in.

\textheight is given in the standard documentstyle in terms of the number of lines of text. So in 10pt article

\textheight = 43\baselineskip
\advance\textheight by \topskip
i.e., a page of solid text with no sections, figures, ... should be 43 lines. This method lowers the number of underfull vbox error that will appear. To calculate the actual values you need to know the baselineskip (12pt for 10pt styles) and topskip (also 12pt) so the actual \textheight is 528pt (~7.3in). That means the bottom margin (including foot) is 2.3in.

Other Points

See page 163 of the LaTeX manual which gives a short description of the various parameters

Printers sometimes don't place the origin correctly and sometimes what the printer thinks is 1in isn't. You can use the \advance commands to do some minor fixing.

\advance\oddsidemargin by -.1in
decreases the leftmargin .1in (i.e., moves the text .1in to the left on the page, no change in textwidth). Actually one should use \hoffset and \voffset to do this to ensure that (0,0) is 1 inch from the leftside and top of the paper. If one was intent upon using proper LaTeX, the command should be
\addtolength{\oddsidemargin}{-.1in}
instead of
\advance\oddsidemargin by -.1in
The two forms are equivalent.

For a visual demonstration of the margin parameters,

latex latex-margins.tex
and print the output.

Couple of rules of thumb

  1. If you want to increase the textwidth by X but keep the same relative placing, (pseudo latex code follows)
    \advance\textwidth by X
    \advance\oddsidemargin by -X/2
    \advance\evensidemargin by -X/2
  2. If you want to decrease the margins by X,
    \advance\textwidth by 2X
    \advance\oddsidemargin by -X
    \advance\evensidemargin by -X

Changing Margins Within A Document

If you want to change the margins within a document, you can use the list environment (something like the \begin{quote} \end{quote} command). Quote is defined as follows (from report.sty)
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist
My first pass is the definition
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
Where
\begin{changemargin}{1in}{.5in}
Changes the left and right margins to 1in and .5in. Reading report.doc code for quotation and quote environments and the description of the list parameters in the manual will allow you to fine tune (for instance the above does not have paragraph indentation but does have space between paragraphs).
\end{changemargin}
ends the changed margin area.
[CSLI] [Help] [Stanford] [Search CSLI help pages] [Search CSLI pages] [Search Stanford]
Emma Pease
Last modified: Fri Nov 12 15:14:43 PST 1999 by emma@csli.Stanford.EDU