Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX Margins: geometry Package Options and Examples

How to set LaTeX margins with geometry, including binding offset, mid-document changes and default margin computation.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

Researchers set LaTeX margins when a thesis, journal template or funder form specifies page dimensions. The standard tool is the geometry package: \usepackage[margin=2cm]{geometry} sets a 2 cm margin on every edge. This guide covers that line and the less-documented behaviour around it: how unspecified margins are computed, binding offsets, changing margins mid-document and inspecting the result.

What it is used for in research

Theses commonly require fixed margins and extra space for binding; manuscripts for journals are usually typeset with the publisher’s class file, which fixes the layout. For your own documents, preprints and reports, geometry lets you state the layout in one preamble line instead of adjusting low-level length parameters. See the LaTeX document structure guide for where preamble lines go.

Install or access (official source only)

The package is documented in the manual “The geometry package” by Hideo Umeki (version 6.0, 2026/03/07), published on CTAN at mirrors.ctan.org/macros/latex/contrib/geometry/geometry.pdf. Load it in the preamble with \usepackage{geometry}. If your LaTeX distribution or online editor does not already provide it, install it from CTAN through your distribution’s package manager.

Step-by-step: set margins with geometry

  1. Set one margin everywhere. Put \usepackage[margin=2cm]{geometry} in the preamble. The manual’s abstract gives this exact example for a 2 cm margin from each edge of the paper.
  2. Set horizontal and vertical margins separately. margin={A,B} is equivalent to hmargin=A and vmargin=B; margin=A expands to hmargin=A and vmargin=A. hmargin is left and right, vmargin is top and bottom.
  3. Set individual sides. Use left, right, top and bottom (aliases lmargin, rmargin, tmargin, bmargin; inner and outer for two-sided layouts). Example: \geometry{a4paper, total={170mm,257mm}, left=20mm, top=20mm}; the right and bottom margins are then computed automatically (Overleaf, “Page size and margins”).
  4. Choose the paper. Options such as a4paper, letterpaper and legalpaper select the size; landscape rotates it, and papersize={w,h} sets custom dimensions. Example: \geometry{legalpaper, landscape, margin=2in}.
  5. Allow for binding. bindingoffset removes the stated space from the left-hand side of the page (inner side in two-sided mode), which the manual describes as useful for glued, stitched or stapled binding.
  6. Two-sided printing. twoside swaps left and right margins on verso pages. asymmetric gives a two-sided layout without swapping margins.
  7. Change margins part-way. \newgeometry{options} starts a new layout, for example for a wide table; \restoregeometry returns to the preamble layout. The manual notes that \newgeometry disables all options from \usepackage and \geometry and skips paper-size options such as landscape. \savegeometry{name} and \loadgeometry{name} save and reuse a layout.

Output and how to read it

What happens to margins you did not set

Since version 5, if you give only one margin, the text body is sized with the default scale 0.7 (hscale/vscale) and the other margin is computed from that. Default ratios are 1:1 for hmarginratio in one-sided documents, 2:3 in two-sided ones, and 2:3 for vmarginratio. So left=3cm alone does not produce a matching right margin; set both, or use hmargin.

Check the result

  • showframe draws the page frames on every page; it needs the atbegshi package (since version 5.4).
  • verbose=true prints the computed dimensions to the log.
  • The layout package: \usepackage{layout} then \layout draws the page layout, and \layout* recalculates it.

Troubleshooting

  • One side changed, the other did not match. Unspecified margins are derived from the 0.7 scale and ratios above; state all sides or use total, width/height.
  • Landscape ignored after \newgeometry. The manual says paper-size related options, including landscape and portrait, are skipped there; set orientation in the preamble.
  • showframe errors. It requires atbegshi.
  • Wrong paper size. Overleaf uses A4 by default; add letterpaper if you need US Letter.
  • Submission class files. When a publisher’s class sets the layout, follow the journal’s instructions rather than overriding margins; see also the Elsevier LaTeX template guide.

Free alternatives

Approach What it does Source
\usepackage[margin=...]{geometry} Keyval interface for margins, paper size and body size geometry manual v6.0
\geometry{...} in the preamble Same options set after loading the package geometry manual v6.0
\newgeometry / \restoregeometry Temporary layout for part of a document geometry manual v6.0
layout package Draws the current page layout so you can inspect it Overleaf, Page size and margins

Related typesetting guides: line and paragraph spacing in LaTeX and indentation in LaTeX.

FAQ

How do I set 1-inch margins in LaTeX?

Add \usepackage[margin=1in]{geometry} to the preamble; it is the same form as the manual’s 2 cm example, with a different length.

How do I change margins for one page or section?

Use \newgeometry{...} where the change starts and \restoregeometry where the original layout should return.

Can I leave extra room for binding?

Yes, with the bindingoffset option.

Sources (official documentation)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about LaTeX Margins: geometry Package Options and Examples

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →