Latex Page Format

 The geometry Package for LaTeX

Setting the {\small \LaTeX} page format or dimensions is not straightforward. You need to adjust several native dimensions to control the text area, and the four margins.  Fortunately, the geometry package greatly simplifies page formatting.

For example, it is easy to create a landscape document on a4papper with text dimensioned to be 8-inches width and 6-inches height:

The parameters passed to the command determine the layout. In this case a4paper establishes the paper size and the totalparameter sets the size of the text area (width and height). Default settings in the preamble can also be defined in an alternative way:

Changing the LaTeX Page Format Mid-Document

The command \newgeometry{option1, option2, …} changes the page layout mid-document. \newgeometry is almost similar to \geometry except that \newgeometry disables all the options specified in the preamble (other than papersize-related options). \restoregeometry restores the page layout specified in the preamble. This command has no arguments.

LaTeX Page Geometry

Page layout dimensions defined in the geometry package are illustrated below.

PageGeometry

The page has a total body (printable area) and margins, which can be split into a body (text area) with an optional header, footer and marginal notes (marginpar). There are four margins: left, right, top and bottom. For twosided documents, horizontal margins should be called inner (left) and outer (right).  

Fine-Tuning LaTeX Page Layout

Common options for fine-tuning the page layout defaults are listed below:

OptionDescription
papera0paper, a1paper, a2paper, a3paper, a4paper, a5paper, a6paper, b0paper, b1paper, b2paper, b3paper, b4paper, b5paper, b6paper, c0paper, c1paper, c2paper, c3paper, c4paper, c5paper, c6paper, b0j, b1j, b2j, b3j, b4j, b5j, b6j, ansiapaper, ansibpaper, ansicpaper, ansidpaper, ansiepaper, letterpaper, executivepaper, legalpaper
screenA special paper size with (W,H) = (225mm,180mm). For presentation with PC and video projector, “screen, centering” with the ‘slide’ documentclass is common.
paperwidthWidth of the paper. paperwidth=⟨length⟩.
paperheightHeight of the paper. paperheight=⟨length⟩.
papersizeWidth and height of the paper. papersize={⟨width⟩,⟨height⟩} or papersize=⟨length⟩.
landscapeSwitches the paper orientation to landscape mode.
portraitSwitches the paper orientation to portrait mode. This is equivalent to landscape=false.
hscaleRatio of width of total body to \paperwidth. hscale=⟨h-scale⟩, e.g., hscale=0.8 is
equivalent to width=0.8\paperwidth. (0.7 by default)
vscaleRatio of height of total body to \paperheight, e.g., vscale=⟨v-scale⟩. (0.7 by default) vscale=0.9 is equivalent to height=0.9\paperheight.
scaleRatio of total body to the paper. scale={⟨h-scale⟩,⟨v-scale⟩} or scale=⟨scale⟩. (0.7 by default)
width, totalwidthWidth of total body. width=⟨length⟩ or totalwidth=⟨length⟩. This dimension defaults to textwidth, but if includemp is set to true, width ≥ textwidth because idth includes the width of the marginal notes. If textwidth and width are specified at the same time, textwidth takes priority over width.
height, totalheightHeight of total body, excluding header and footer by default. If includehead or includefoot is set, height includes the head or foot of the page as well as textheight. height=⟨length⟩ or totalheight=⟨length⟩. If both textheight and height are specified, height will be ignored.
totalWidth and height of total body. total={⟨width⟩,⟨height⟩} or total=⟨length⟩.
textwidthSpecifies \textwidth, the width of body (the text area). textwidth=⟨length⟩.
textheightSpecifies \textheight, the height of body (the text area). textheight=⟨length⟩.
left, lmargin, innerLeft margin (for oneside) or inner margin (for twoside) of total body. In other words, the distance between the left (inner) edge of the paper and that of total body. left=⟨length⟩. inner has no special meaning, just an alias of left and lmargin.
right, rmargin, outerRight or outer margin of total body. right=⟨length⟩.
top, tmarginTop margin of the page. top=⟨length⟩. Note this option has nothing to do with the native dimension \topmargin.
hmarginleft and right margin. hmargin={⟨left margin ⟩,⟨right margin ⟩} or hmargin=⟨length ⟩.
vmarginTop and bottom margin. vmargin={⟨top margin⟩,⟨bottom margin⟩} or vmargin=⟨length ⟩
bottom, bmarginBottom margin of the page. bottom=⟨length⟩.
text, bodySpecifies both \textwidth and \textheight of the body of page. body={⟨width⟩,⟨height⟩} or text=⟨length⟩.
linesEnables users to specify \textheight by the number of lines. lines=⟨integer⟩.
includeheadIncludes the head of the page, \headheight and \headsep, into total body. It is set to false by default. It is opposite to ignorehead.
includefootIncludes the foot of the page, \footskip, into total body. It is opposite to ignorefoot. It is false by default.
includeheadfootSets both includehead and includefoot to true, which is opposite to ignoreheadfoot.
includempIncludes the margin notes, \marginparwidth and \marginparsep, into body when calculating horizontal calculation.
include allSets both includeheadfoot and includemp to true.
ignoreheadDisregards the head of the page, headheight and headsep, in determining vertical layout, but does not change those lengths. It is equivalent to includehead=false. It is set to true by default. See also includehead.
ignorefootDisregards the foot of page, footskip, in determining vertical layout, but does not change that length. This option defaults to true. See also includefoot.
ignoreheadfootSets both ignorehead and ignorefoot to true. See also includeheadfoot.
pdftextSets \pdfpagewidth and \pdfpageheight internally.
magSets magnification value (\mag) and automatically modifies \hoffset and \voffset
according to the magnification. mag=⟨value⟩. Note that ⟨value⟩ should be an integer value with 1000 as a normal size. For example, mag=1414 with a4paper provides an enlarged print fitting in a3paper, which is 1.414 (=√2) times larger than a4paper. Font enlargement needs extra disk space.
showframeShows visible frames for the text area and page, and the lines for the head and foot on the first page.
showcropPrints crop marks at each corner of user-specified layout area.

Options can also be declared using regular expressions, such as a[0-6]paper.  Meanwhile, options for paper names (a4paper) and orientation (landscape) can be set as document class options. For example, \documentclass[a4paper,landscape]{article}. This is also the case for twoside and twocolumn.

Additional options can be found in the geometry package documentation here.

LaTeX Page Numbering

\pagenumbering{num_style} specifies the style of page numbers. Possible values of num_style are:

  • arabic: Arabic numerals
  • roman: Lowercase roman numerals
  • Roman: Uppercase roman numerals
  • alpha: Lowercase letters
  • Alpha: Uppercase letters

Back | Next

Leave a Reply

Your email address will not be published. Required fields are marked *

12 + nine =