Researa LogoReseara
Start free
Learn Hub/GUIDE 03 / 13Formatting & Layout
Quick syntax:\usepackage[a4paper, margin=2.5cm]{geometry}

Page Size and Margins in LaTeX

One package, geometry, sets the paper size and the margins. This guide gives you the lines to copy for A4, thesis binding margins, headers and landscape pages.

The short answer

\usepackage[a4paper, margin=2.5cm]{geometry}

Put it in the preamble. That gives A4 paper with 2.5 cm on every side. Without it, LaTeX may default to US Letter, depending on the installation, and its own margins are wide because they are tuned for short lines of text, not for a report.

You can also list the options on separate lines, which is easier to read and edit:

\usepackage{geometry}
\geometry{
  a4paper,
  left=3cm,
  right=2.5cm,
  top=2.5cm,
  bottom=2.5cm
}

Paper size

OptionSizeUsed for
a4paper210 × 297 mmReports and theses outside North America
letterpaper8.5 × 11 inUS and Canada
a5paper148 × 210 mmBooklets
b5paper176 × 250 mmBooks
a3paper297 × 420 mmPosters, large tables

For any other size, give the dimensions:

\usepackage[paperwidth=16cm, paperheight=24cm, margin=2cm]{geometry}

Margins

Set all four with margin, each one with left, right, top and bottom, or pairs with hmargin (left and right) and vmargin (top and bottom). Units can be mm, cm, in or pt.

\geometry{a4paper, hmargin=2.5cm, vmargin=3cm}

Binding margin for a printed report

A bound report loses a few millimetres to the binding, so the margin on that side should be wider. For single-sided printing, make left wider. For double-sided printing, use the twoside class option and set inner (the binding side) and outer:

\documentclass[12pt, twoside]{report}
\usepackage{geometry}
\geometry{
  a4paper,
  inner=3.5cm,   % binding side
  outer=2.5cm,
  top=2.5cm,
  bottom=3cm
}

Check your school's guidelines first: many give exact margins for the PFE report, and the jury notices.

Headers and footers

If you add running headers with fancyhdr, it may warn that \headheight is too small and print the value it needs. Give geometry that value, and adjust the gaps around the header and footer if you want:

\geometry{
  a4paper,
  margin=2.5cm,
  headheight=15pt,   % room for the header text
  headsep=8mm,       % gap between header and text
  footskip=12mm      % from the last line of text to the footer
}

By default the header and footer sit in the top and bottom margins. Add includeheadfoot if your guidelines measure the margins from the header and footer instead of from the text.

Landscape pages

For a whole document in landscape, add the option to geometry:

\usepackage[a4paper, landscape, margin=2cm]{geometry}

More often you need one landscape page for a wide table inside a portrait report. Use pdflscape: it rotates the page in the PDF viewer too, so readers do not have to turn their heads.

\usepackage{pdflscape}   % preamble

\begin{landscape}
  \begin{table}[htbp]
    \centering
    \caption{Monthly results}
    \begin{tabular}{lcccccccc}
      Item & Jan & Feb & Mar & Apr & May & Jun & Jul & Aug \\
      Sales & 120 & 135 & 150 & 142 & 160 & 175 & 180 & 190 \\
    \end{tabular}
  \end{table}
\end{landscape}

Different margins for part of the document

\newgeometry changes the layout from the next page on, and \restoregeometry goes back to the preamble settings. Both start a new page, so use them at natural breaks such as a title page or an appendix.

\newgeometry{margin=1.5cm}
% title page, or a wide appendix
\restoregeometry

Quick reference

OptionSets
marginAll four margins
left, right, top, bottomOne margin each
hmargin, vmarginLeft and right, top and bottom
inner, outerBinding and outside margins (with twoside)
headheight, headsep, footskipHeader and footer spacing
includeheadfootCounts header and footer inside the margins
landscapeTurns the whole document sideways
paperwidth, paperheightA custom paper size
textwidth, textheightThe text block directly, margins follow

Where to go next

READY TO WRITE YOUR REPORT OR THESIS?

Write in Researa. Present in Researa Slides.

Draft your LaTeX manuscript with AI assistance and verified citations, then turn your finished PDF into a defense slide deck in minutes.