LaTeX page numbers: roman front matter, arabic chapters
To set LaTeX page numbers for a thesis, put \pagenumbering{roman} after the title page and \clearpage followed by \pagenumbering{arabic} just before Chapter 1. The front matter then runs i, ii, iii, and Chapter 1 starts again at page 1. Each \pagenumbering changes the style and restarts the count.
- Before the title page, add
\pagenumbering{gobble}, so the title page has no number. - Straight after the title page, add
\pagenumbering{roman}. The abstract becomes page i. - Just before
\chapter{Introduction}, add\clearpageand then\pagenumbering{arabic}. Chapter 1 becomes page 1. - Compile twice, so the contents page picks up the new numbers. In Overleaf, click Recompile, or press Ctrl + Enter (Windows) or Cmd + Enter (Mac).
01Roman then arabic: the two commands
LaTeX keeps the current page number in a counter called page, and \pagenumbering{style} does two things at once: it sets how that number is printed and it resets the counter to the first value of the new style. The LaTeX2e reference manual adds that the change is global, so it is not undone at the end of a group or a file. That is why one command at the start of the front matter and one at Chapter 1 are all a thesis needs.
| Style | Prints | Used in a thesis for |
|---|---|---|
| arabic | 1, 2, 3 | Chapters, references, appendices |
| roman | i, ii, iii | Front matter (the usual choice) |
| Roman | I, II, III | Front matter, when the guide asks for capitals |
| alph, Alph | a, b, c / A, B, C | Rarely; they fail after page 26 |
| gobble | nothing | The title page |
\pagenumbering accepts, from the LaTeX2e reference manual and Overleaf's page numbering article. Every one of them restarts the count.Worked example: a thesis in the report class
This is the front of my fictional thesis, Brand trust and customer loyalty in subscription services, with the page numbering and nothing else. I compiled it with pdfLaTeX in TeX Live 2025: no warnings, and the contents lists the abstract as i and Chapter 1 as 1.
\documentclass[12pt,a4paper]{report}
\usepackage[nottoc]{tocbibind}
\usepackage{hyperref}
\begin{document}
\pagenumbering{gobble} % title page: no number
\begin{titlepage}
...
\end{titlepage}
\pagenumbering{roman} % i, ii, iii from the abstract
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
...
\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
...
\tableofcontents
\listoffigures
\clearpage % finish the last front page
\pagenumbering{arabic} % 1, 2, 3 from Chapter 1
\chapter{Introduction}
...
\appendix % numbering carries on
\chapter{Survey items}
...
\end{document}
\appendix changes chapter numbers to letters but leaves page numbers alone.The bottom-centre position comes from the standard plain page style, which the reference manual describes as an empty header and a footer with nothing but the page number, in the centre. Section 04 moves it. For the full thesis setup around these lines (chapter files, references, the class choice), see my guide to writing a thesis in LaTeX.
02A title page without a number (and hyperref)
Almost every thesis guide wants a title page with no visible number. In LaTeX that part is easy: the titlepage environment prints no number. The trap is underneath. The title page still counts as arabic page 1, Chapter 1 is also arabic page 1, and hyperref (which many theses load for clickable contents) gives both pages the same internal name. pdfLaTeX then warns destination with the same identifier (name{page.1}), and links that should go to Chapter 1 can open the title page.
I compiled the common ways of handling the title page and read the result back from the PDF. Only some are clean:
| Setup | Abstract | Result |
|---|---|---|
titlepage, then \pagenumbering{roman} | i | Warning: page.1 twice |
\pagenumbering{roman} before titlepage | i | Warning: page.i twice (titlepage resets the count) |
titlepage, then roman and \setcounter{page}{2} | ii | Warning: page.1 twice |
\pagenumbering{gobble} before titlepage, roman after | i | Clean |
The same, plus \setcounter{page}{2} after roman | ii | Clean |
\pagenumbering{roman} first, title on a normal page with \thispagestyle{empty} | ii | Clean (title page counts as i) |
titlepage environment resets the page counter to 1 when it ends in a one-sided document, which is why roman before it still clashes.Abstract on page i or page ii?
Guides differ. Some number the first page after the title page i; others count the title page as i without printing it, so the abstract is ii. For i, use the worked example as it stands. For ii, add \setcounter{page}{2} on the line after \pagenumbering{roman}. Read your guide's sample pages rather than the text alone: the sample usually settles it.
The LaTeX2e reference manual warns that gobble "does not work with hyperref" and suggests \pagestyle{empty} instead. In my tests with hyperref 7.01l, one gobble page before the title page compiled without a warning. Two gobble pages in a row (a title page and its blank back in a two-sided thesis) both got an empty name and produced a name{page.} warning. Section 05 has the setup that avoids it.
03Why the \clearpage matters
\pagenumbering resets the counter the moment LaTeX reads it, while the page that is still being filled has not been printed yet. If the last front-matter page is still open, it is printed with the new number. \chapter starts a new page itself, but only after \pagenumbering{arabic} has already run. In my test, leaving out the \clearpage numbered the contents page 1 and pushed Chapter 1 to page 2, and the contents listed it as page 2.
\clearpage before \pagenumbering{arabic}. Without it, the contents page, still open when the counter was reset, is printed as 1, and Chapter 1 starts on 2.Putting \pagenumbering{arabic} straight after \chapter{Introduction} also works, because the chapter has already started its page. The fancyhdr manual's general advice is the safer habit: give a \clearpage or \cleardoublepage before changing the page numbering. I prefer \clearpage before it: it reads clearly and also prints any figures still waiting from the front matter. In a two-sided thesis, use \cleardoublepage instead (section 05).
The same rule decides the numbers in the contents. LaTeX writes each entry with the number of the page it lands on, so a wrong number on a page means a wrong number in the contents. My guide to the LaTeX table of contents and lists covers adding the abstract and lists to the contents with their roman numbers.
04Move the page number: top right, bottom right
To move the page number in LaTeX, use the fancyhdr package, which sets the header and footer in six fields: left, centre and right, at the top and at the bottom. Clear them all with \fancyhf{}, then put \thepage where the guide wants it. \thepage prints the number in the current style, so the same line gives iii in the front matter and 12 in a chapter.
\usepackage{fancyhdr}
\setlength{\headheight}{14.5pt} % for 12pt text
\pagestyle{fancy}
\fancyhf{} % clear all six fields
\fancyhead[R]{\thepage} % top right
\renewcommand{\headrulewidth}{0pt} % no line under the header
% chapter pages use the plain style: make it the same
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyhead[R]{\thepage}%
\renewcommand{\headrulewidth}{0pt}%
}
- Bottom right:
\fancyfoot[R]{\thepage}in both places instead of\fancyhead[R]. - Bottom centre is the default in the report class; you only need fancyhdr for it if you also want a header or a different font size.
- Smaller number:
\fancyfoot[C]{\small\thepage}. Guides that set the number's size usually want it the same as the body text, which is the default.
The chapter-page trap
The first page of every chapter ignores \pagestyle{fancy}. The fancyhdr manual explains why: \chapter in the book and report classes switches the first page of each chapter to the plain style. The contents, the list of figures and the other front-matter chapters are set with \chapter*, so their first pages switch too. Without the \fancypagestyle{plain} block above, I got exactly what the manual predicts: the number at the top right on most pages and at the bottom centre on every chapter opening.
\fancyhead[R]{\thepage}. Left: only the fancy style is set, so the chapter's first page falls back to plain and prints its number at the bottom centre. Right: with \fancypagestyle{plain} set the same way, every page has the number at the top right.The \headheight line answers a warning fancyhdr gives at 12 pt: \headheight is too small (12.0pt): Make it at least 14.49998pt. Use the value the warning gives you; it depends on the font size. Where the number sits relative to the margins (inside the bottom margin or above it) is a geometry setting, footskip or includefoot, which my guide to LaTeX margins for a thesis measures. A paper in APA style puts the number at the top right too; my guide to APA style in LaTeX covers the class that does it for you.
Template puts the numbers somewhere your guide doesn't allow?I can set the page styles to your guide
05Two-sided printing
In a two-sided thesis (twoside, or the book class), Chapter 1 must start on a right-hand page, and right-hand pages carry odd numbers. LaTeX decides left or right from the page counter, not from the paper. \cleardoublepage, which the reference manual says makes the next page "a right-hand, odd-numbered page", checks whether the counter is odd. So if \pagenumbering{arabic} resets the counter to 1 first, LaTeX believes it is already on a right-hand page, even when the front matter has an odd number of physical pages.
That is what I got with \clearpage before \pagenumbering{arabic} in a two-sided report: Chapter 1, page 1, was the fourth physical page counting from the abstract, a left-hand page in print, and every page after it was on the wrong side. Swapping in \cleardoublepage fixed it: the counter is still roman when it runs, so it adds a blank page iv and Chapter 1 moves to the fifth physical page.
openright, compiled both ways and read back page by page. With \clearpage, Chapter 1 is printed on the back of the contents page. With \cleardoublepage, a blank page goes in first, and the emptypage package removes the number the blank pages would otherwise carry.The blank pages are the second issue. The reference manual notes that the blank page \cleardoublepage adds "will have the running headers and footers", so in my test it printed ii. Loading \usepackage{emptypage} removes the header and footer from pages that are completely empty. The two-sided version of the worked example, which compiled cleanly with hyperref:
\documentclass[12pt,a4paper,twoside,openright]{report}
\usepackage{emptypage}
\usepackage{hyperref}
\begin{document}
\pagenumbering{alph} % not gobble: see below
\begin{titlepage}
...
\end{titlepage}
\cleardoublepage % blank back of the title page
\pagenumbering{roman}
...
\cleardoublepage % not \clearpage
\pagenumbering{arabic}
\chapter{Introduction}
The title page uses alph here because two unnumbered pages in a row with gobble gave the hyperref warning described in section 02; with alph they are a and b internally, and neither letter is printed. To put the number on the outer edge of every page, use \fancyfoot[LE,RO]{\thepage}: left on even pages, right on odd pages.
06Pages without a number, and landscape pages
To remove the page number from one page, use \thispagestyle{empty} on that page; to remove it from every page, put \pagestyle{empty} in the preamble. The page still counts, so the next page carries on from it.
On the first page of a chapter, the order matters: \chapter sets the plain style for its own page, so \thispagestyle{empty} has to come after it. In my test, \thispagestyle{empty} placed before \chapter{Introduction} left the 1 at the foot of the page; placed after it, the number went.
Landscape pages
A wide table on a landscape page keeps its number where the portrait pages have it, at the foot of the portrait page, if you use the pdflscape package: \usepackage{pdflscape} and the table inside \begin{landscape}…\end{landscape}. The package rotates the content and turns the page in PDF viewers so the table reads the right way up; the number stays on the portrait page's foot, which on screen appears along the side edge. In my test, the landscape page was rotated 90 degrees in the PDF and its number sat on that edge, in the same place on the paper as on every portrait page. If your guide says how numbers on landscape pages should face, check its wording against this before you print.
07book, memoir and appendices
The book class (and memoir) has its own commands for this: \frontmatter before the title page switches to roman numbers and unnumbered chapters, and \mainmatter before Chapter 1 switches back to arabic, resets the count and turns chapter numbers on again, as the LaTeX2e reference manual and Overleaf's page numbering article describe. \backmatter before the references stops chapter numbering but leaves the page numbers running. Use these instead of \pagenumbering in book; report doesn't have them.
Appendices continue the arabic numbering in every standard class. Some guides want appendix pages numbered A-1, A-2 or restarted; check the guide's wording, and if it only asks for the appendices to be listed in the contents, leave the numbering alone. Universities set these rules, not LaTeX, so the order of the front pages and where numbering starts are in my thesis formatting checklist.
08Check the numbers in the PDF
Three quick checks before you submit, in this order:
- Contents against pages. Pick three entries in the contents (one roman, Chapter 1 and the last appendix) and open those pages. If they differ, compile twice more; in Overleaf, open the Recompile menu and choose Recompile from scratch.
- The log. Search the log for
same identifier. Any hit means two pages share a number in the same style (section 02). - The page box. hyperref writes PDF page labels by default (its
pdfpagelabelsoption is true), so a viewer that reads labels shows iii for the contents page instead of its position in the file. In my tests, a PDF compiled without hyperref had no labels at all, so the viewer's page box and the printed numbers disagree from the abstract onwards. If a graduate school asks for the PDF page numbers to match the printed ones, load hyperref.
09LaTeX page numbers wrong? Fixes
When LaTeX page numbers come out wrong, the cause is nearly always where a command sits, not the command itself. I reproduced the first seven below and checked each fix in the PDF.
The last front-matter page is numbered 1
\pagenumbering{arabic} runs while that page is still open. Put \clearpage (or \cleardoublepage in a two-sided thesis) on the line before it. See section 03.
"destination with the same identifier (name{page.1})"
Two pages have the same number in the same style, usually the title page and Chapter 1. Add \pagenumbering{gobble} before the title page, or alph in a two-sided thesis. With name{page.i}, the title page and the abstract are both i: move \pagenumbering{roman} to after the title page.
Chapter pages have the number at the bottom, other pages at the top
Chapter openings use the plain style. Redefine it with \fancypagestyle{plain}{…} to match your fancy style (section 04). If the contents or bibliography page alone is different, the cause is the same.
Blank pages before chapters show a number
The document is two-sided with openright, and the blank pages that \cleardoublepage adds carry the page style. Load the emptypage package. If the thesis is not printed on both sides, remove twoside or openright and the blank pages go too.
\thispagestyle{empty} does nothing on a chapter page
It is above \chapter, which then sets plain for the page. Move it to the line after \chapter{…}.
The contents shows old page numbers
The contents is written on one compile and read on the next, so after changing the numbering compile twice. If it still lags, delete the auxiliary files (Overleaf: Recompile from scratch; offline: latexmk -c) and compile again.
"\headheight is too small"
fancyhdr's header needs more room than the class gives it. Copy the length from the warning into \setlength{\headheight}{…} in the preamble, or give geometry the option headheight=… if you load it.
The front matter has arabic numbers in a template
The template's class or a file brought in with \input contains its own \pagenumbering or \mainmatter. Search every .tex and .cls file in the project for pagenumbering and mainmatter; the last one LaTeX reads before a page wins.
Template from three students ago, and the numbers won't behave?Send me the project and I'll fix the numbering
10Questions people ask
How do I start page numbering at a specific number in LaTeX?
Use \setcounter{page}{5} on the page that should be 5. It changes the count without changing the style, so put it after any \pagenumbering on that page, because \pagenumbering resets the count to 1.
How do I get capital roman numerals (I, II, III)?
Use \pagenumbering{Roman} with a capital R. Lowercase roman gives i, ii, iii, which is what most thesis guides ask for.
How do I write "Page 3 of 120" in LaTeX?
Load the lastpage and fancyhdr packages and set \fancyfoot[C]{Page \thepage\ of \pageref{LastPage}}; Overleaf's page numbering article gives the same example on the right of the footer. The total is the number printed on the last page, so with roman front matter it is the arabic count only, and the front matter reads "Page i of 120". In my test that is exactly what it printed; theses rarely use this format for that reason.
How do I remove page numbers from the whole document?
Put \pagestyle{empty} in the preamble, and \thispagestyle{empty} after each \chapter if you also want the chapter openings clear, since they switch to plain on their own.
Do I set page numbers differently in Overleaf?
No. Overleaf compiles standard LaTeX, so the commands on this page go in main.tex exactly as written. Recompile with Ctrl + Enter on Windows or Cmd + Enter on Mac, and compile twice after a change so the contents follows.
I compiled every setup on this page with pdfLaTeX in TeX Live 2025 (pdfTeX 1.40.27, hyperref 7.01l, fancyhdr 5.2, emptypage 1.2, lastpage 2.1e, pdflscape 0.13) on Windows 11, twice each, then read the printed numbers, the PDF page labels and the log warnings back from each PDF. Command behaviour was checked against the LaTeX2e reference manual, Overleaf's documentation and the fancyhdr manual, on .
Sources
- Page numbering Overleaf
- \pagenumbering LaTeX2e unofficial reference manual
- \pagestyle LaTeX2e unofficial reference manual
- \clearpage & \cleardoublepage LaTeX2e unofficial reference manual
- \frontmatter, \mainmatter, \backmatter LaTeX2e unofficial reference manual
- fancyhdr – Extensive control of page headers and footers (manual, v5.2) CTAN
- emptypage – Suppress page numbers and headings on empty pages CTAN
- hyperref (manual, v7.01l: pdfpagelabels) CTAN
- pdflscape – Make landscape pages display as landscape CTAN
- Keyboard shortcuts Overleaf
- Clearing the project cache Overleaf