Numbering Pages in LaTeX

Numbering pages in LaTeX is automatic: the standard classes print an arabic number at the bottom center of every page. Change the style with \pagenumbering{roman}, hide it with \thispagestyle{empty} or \pagestyle{empty}, and move it with the fancyhdr package.

How do you change the page number style?

\pagenumbering{…} takes arabic (1, 2, 3), roman (i, ii, iii), Roman (I, II, III), alph (a, b, c) or Alph (A, B, C). It also restarts the count at 1. Theses often number the front matter in roman numerals, then switch to arabic at the first chapter after a \clearpage.

example.tex
\documentclass{article}
\begin{document}
\pagenumbering{roman}
This is the preface. Its pages are numbered i, ii, iii.

% at the first page of the main text:
% \clearpage
% \pagenumbering{arabic}
\end{document}
Page 1A small page with the preface text and the page number i at the bottom center.

How do you remove the page number?

For one page, put \thispagestyle{empty} on it. For the whole document, put \pagestyle{empty} in the preamble. A title page made with \maketitle sets its own style, so add \thispagestyle{empty} right after \maketitle to hide its number.

How do you start at a different number?

Set the counter: \setcounter{page}{5} makes the current page number 5, and the following pages count on from there. This helps when a chapter is printed separately but must keep its place in a larger book.

How do you show "Page 1 of 10"?

Load lastpage for the total and fancyhdr to write the footer. \fancyhf{} clears the default header and footer; \fancyfoot[C]{…} fills the center of the footer. Compile twice, because the total is only known after the first run.

example.tex
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Page \thepage\ of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\begin{document}
The first page of a two-page report.
\newpage
The second page.
\end{document}
Pages 1 and 2The first page with the footer Page 1 of 2 at the bottom center.The second page with the footer Page 2 of 2.

How do you put the page number in the top corner?

With fancyhdr, place \thepage where you want it: [L], [C] or [R] in \fancyhead or \fancyfoot. Without a package, \pagestyle{headings} moves the number to the header, but it also adds the section title there. The header text can use any font size.

example.tex
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{Lab report}
\fancyhead[R]{\thepage}
\begin{document}
\setcounter{page}{5}
This page is numbered 5 in the top right corner.
\end{document}
Page 1A small page with Lab report at the top left, the page number 5 at the top right, and a rule under the header.

Why does a page break change the numbering?

It doesn't; the counter steps up with every new page. But \pagenumbering restarts at 1, so call it right after \clearpage to avoid two pages with the same number. Page breaks themselves are in the new page guide. When a journal limits words rather than pages, check the count with the LaTeX word counter.

Text drafted with AI from the cited documentation; every example compiled with TeX Live 2026; checked by Cem Demir. See the editorial policy.