Geometry Package: Margins and Page Orientation

Atith Adhikari Atith Adhikari ยท 1 month ago
Technical Writing
0

By default, LaTeX uses quite wide margins to optimize readability (the "golden line length"). However, for assignments, lab reports, and theses, you will often need to customize your page layout. The easiest and most powerful way to do this is using the geometry package.

 

To modify your margins and orientation, you must load the package in your preamble (the section of code before \begin{document}).

\usepackage[options]{geometry}

Margin Configurations

Standard Margin Configuration

If you want to set uniform margins across your entire document (e.g., 1 inch or 2.5 cm on all sides), use the following code:

\documentclass{article}

% Loading the geometry package with specific margins
\usepackage[margin=1in]{geometry}

\begin{document}
Your text goes here. The margins on all four sides are now exactly 1 inch.
\end{document}

Customizing Individual Sides

If your document features a wide table or a large chart, you can change the orientation of the entire document to landscape.

\usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry}