Document Formatting
Page Layout and Margins in LaTeX
Journal templates and university thesis classes often set margins for you, but when you are on your own, the geometry package is the standard way to define page layout. This tutorial covers everyday margin setups, two-sided binding, and temporary layout changes for wide tables or landscape figures.
Set Uniform Page Margins
Add geometry in the preamble before \begin{document}:
\documentclass{article}
\usepackage[margin=1in]{geometry}
% US letter with 1-inch margins:
% \usepackage[letterpaper, margin=1in]{geometry}
% A4 with 2.5 cm margins (common in Europe):
% \usepackage[a4paper, margin=2.5cm]{geometry}
\begin{document}
Your text respects the new margins immediately.
\end{document}Different Margins on Each Side (Binding)
Theses and printed dissertations often need a wider inner margin:
\usepackage[
a4paper,
top=2.5cm,
bottom=2.5cm,
inner=3.5cm, % binding / gutter side
outer=2.5cm
]{geometry}
% Two-sided layout (inner/outer swap on verso pages):
\usepackage[
twoside,
inner=3cm,
outer=2cm,
top=2.5cm,
bottom=2.5cm
]{geometry}Visualize and Debug Layout
Use showframe to see the text block and margin boxes while tuning:
\usepackage[
margin=1in,
showframe
]{geometry}
% showframe draws the layout boxes in the PDF so you can
% verify headers, footers, and text area before final submission.Change Margins Mid-Document
Temporarily widen margins for a single wide table or landscape page:
\usepackage{geometry}
\geometry{margin=1in}
\begin{document}
Normal margins here.
\newgeometry{margin=0.75in, landscape}
% Wide content (landscape table, timeline figure, etc.)
\restoregeometry
Back to the original layout.
\end{document}💡 Tips
- •Load geometry once in the preamble — loading it twice with conflicting options causes option clashes
- •1 inch = 2.54 cm = 72 pt when converting university margin requirements
- •For thesis templates, check whether the class file already sets geometry before overriding
- •Pair margin changes with \usepackage{pdflscape} when only one page should be landscape
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing FreeNeed help with your bibliography or citations?
Book a Free Call