When preparing a thesis, research paper, or professional report, the page layout in LaTeX is just as important as the content. Unlike Word, LaTeX gives you precise control over margins, headers, footers, and page numbering.
This guide explains each feature with working examples so you can apply them directly to your documents.
( If you’re completely new, start with our LaTeX Basic Commands.)
1. Setting Margins in LaTeX
Use the geometry package to adjust margins:
\usepackage[a4paper, margin=1in]{geometry}
Example: Different margins on each side
\usepackage[top=3cm, bottom=2cm, left=2.5cm, right=2.5cm]{geometry}
This is especially useful for binding margins in theses.
2. Custom Headers and Footers
The fancyhdr package lets you customize headers/footers.
Example: Adding document title on left header and page numbers in the footer.
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear default
\fancyhead[L]{My Research Thesis}
\fancyhead[R]{\leftmark} % current chapter/section
\fancyfoot[C]{Page \thepage}
Result:
- Left header → Thesis title
- Right header → Chapter title
- Footer center → “Page X”
3. Page Numbering Styles
You can choose numbering styles with \pagenumbering{}
.
Example: Roman numerals for the table of contents, Arabic numbers for the main chapters.
\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}
\section{Introduction}
Output:
- TOC → i, ii, iii…
- Main text → 1, 2, 3…
4. Suppressing Page Numbers
For title pages, you may want no page number.
Example:
\begin{titlepage}
\centering
{\Huge My Thesis Title \par}
\vfill
\thispagestyle{empty}
\end{titlepage}
This removes the page number only from the title page.
5. Other Useful Layout Controls
- Line spacing with
setspace
:
\usepackage{setspace}
\doublespacing
- Paragraph indentation:
\setlength{\parindent}{0pt}
- Page size in the document class:
\documentclass[a4paper,12pt]{report}
( For structured layouts, check our LaTeX Table Commands).
Here’s a minimal working LaTeX file that only demonstrates the commands from the article
\documentclass[12pt,a4paper]{article}
% Margins
\usepackage[a4paper,margin=1in]{geometry}
% Headers & footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{Left Header}
\fancyhead[R]{Right Header}
\fancyfoot[C]{\thepage}
\begin{document}
% Page numbering styles
\pagenumbering{roman} % i, ii, iii...
This page uses roman numbering. \newpage
\pagenumbering{arabic} % 1, 2, 3...
Now switched to arabic numbering. \newpage
\thispagestyle{empty}
This page has no number. \newpage
% Change margins temporarily
\newgeometry{top=2cm,bottom=2cm,left=4cm,right=2cm}
This page has different margins. \newpage
\restoregeometry
Back to normal margins.
\end{document}
And the output should look something like this:

Conclusion
By mastering page layout in LaTeX, you can create professional documents with precise margins, headers, footers, and numbering styles. These small details make your work stand out and meet academic or corporate formatting standards.
( For advanced setups, see Overleaf’s guide on page size and margins).
FAQs on Page Layout in LaTeX
Q1. How do I change margins for only one page?
Use:
\newgeometry{top=1cm,bottom=2cm}
Some text here...
\restoregeometry
Q2. How do I completely remove page numbers?
Add \pagestyle{empty}
at the beginning of your document.
Q3. How do I insert the chapter title in the header?
Use \fancyhead[R]{\leftmark}
with the fancyhdr
package.
Q4. Can I add “Confidential” in the footer?
Yes:
\fancyfoot[C]{Confidential}
Q5. What’s the standard thesis margin size?
Most universities require 1-inch (2.54 cm) margins on all sides, but always check your guidelines.
For more content Visit Deadloq. Thank You!!!