LaTeX Page Layout Mastering Page Layout with geometry

Mastering Page Layout with geometry

AS
Aman Saurav
| Jan 21, 2025 |
4 min read
#layout #formatting

The geometry package makes changing margins and page size trivially easy, saving you from calculating esoteric TeX dimensions manually.

Basic Usage

To set standard 1-inch margins around the entire page:

\usepackage[margin=1in]{geometry}

Custom Margins

You can specify different margins for each side:

  1. Top: top=2cm
  2. Bottom: bottom=2cm
  3. Left: left=3cm
  4. Right: right=1cm
\usepackage[a4paper, total={6in, 8in}]{geometry}

Visualizing the Layout

Sometimes it helps to see the layout boundaries. Use the showframe option:

\usepackage[showframe]{geometry}

Geometry Page Layout Diagram
Geometry Page Layout Diagram

Learn More

Complete Geometry Package Guide