Use this file to discover all available pages before exploring further.
LaTeX adds page numbers automatically, but you can change the numbering style, restart the counter, hide numbers on selected pages, or show Page X of Y when you need a more formal layout.
Quick answer:
\pagenumbering{roman} % i, ii, iii\pagenumbering{arabic} % 1, 2, 3\setcounter{page}{1} % restart from page 1
Use \pagenumbering{...} to change style and \setcounter{page}{...} to restart numbering.Most common jobs: switch front matter to roman numerals, restart page 1 for the main document, hide numbers on title pages, and show Page X of Y with fancyhdr and lastpage.Related topics: Headers and footers | Document classes | Cross-referencing
LaTeX automatically numbers pages starting from 1. The page number appears in different locations depending on the document class and page style.
\documentclass{article}\begin{document}% Page numbers appear automatically\section{Introduction}This is page 1.\newpage\section{Methods}This is page 2.\newpage\section{Results}This is page 3.\end{document}
\documentclass{article}\begin{document}% Arabic numerals (default)\pagenumbering{arabic}Page numbering: 1, 2, 3, 4...\newpage% Roman numerals (lowercase)\pagenumbering{roman}Page numbering: i, ii, iii, iv...\newpage% Roman numerals (uppercase) \pagenumbering{Roman}Page numbering: I, II, III, IV...\newpage% Alphabetic (lowercase)\pagenumbering{alph}Page numbering: a, b, c, d...\newpage% Alphabetic (uppercase)\pagenumbering{Alph}Page numbering: A, B, C, D...\end{document}
\documentclass{article}\begin{document}% Start numbering from a specific number\setcounter{page}{5}This page is numbered 5.\newpageThis page is numbered 6.% Reset counter\setcounter{page}{1}\newpageBack to page 1.\end{document}
If you only want to move the page number, keep the numbering logic simple here and move to Headers and footers when you need a custom header/footer layout.
\documentclass{article}\begin{document}% Plain style: number at bottom center\pagestyle{plain}\section{Section with Plain Style}Page number appears at bottom center.\newpage% Empty style: no page numbers\pagestyle{empty} \section{Section with No Numbers}This page has no page number.\newpage% Headings style: number in header\pagestyle{headings}\section{Section with Header Numbers}Page number appears in header with section name.\end{document}
\documentclass{article}\usepackage{fancyhdr}% Set up custom page numbering\pagestyle{fancy}\fancyhf{} % Clear all headers and footers% Page number in different positions\fancyfoot[L]{Page \thepage} % Bottom left% \fancyfoot[C]{\thepage} % Bottom center % \fancyfoot[R]{\thepage} % Bottom right% \fancyhead[L]{\thepage} % Top left% \fancyhead[C]{\thepage} % Top center% \fancyhead[R]{\thepage} % Top right\begin{document}\section{Custom Page Positioning}Page numbers can appear anywhere you specify.\newpage\section{Continued Content}Consistent positioning across pages.\end{document}
\documentclass{report}\usepackage{fancyhdr}\begin{document}% Front matter with roman numerals\pagenumbering{roman}\pagestyle{plain}\tableofcontents\newpage\listoffigures\newpage% Main content with arabic numerals\pagenumbering{arabic}\setcounter{page}{1}\pagestyle{fancy}\fancyhf{}\fancyhead[R]{\thepage}\fancyfoot[C]{Main Document}\chapter{Introduction}Main content starts with page 1.\chapter{Methods}Continues with normal numbering.% Appendix with different style\appendix\pagenumbering{Alph}\setcounter{page}{1}\chapter{Additional Data}Appendix uses alphabetic numbering: A, B, C...\end{document}
\documentclass[twoside]{article}\usepackage{fancyhdr}\pagestyle{fancy}\fancyhf{}% Different positions for odd and even pages\fancyfoot[LE]{\thepage} % Left on even pages\fancyfoot[RO]{\thepage} % Right on odd pages% Alternative: outside corners% \fancyhead[LE,RO]{\thepage}% Content in headers\fancyhead[LE]{\leftmark} % Section name on left of even pages\fancyhead[RO]{\rightmark} % Subsection name on right of odd pages\begin{document}\section{First Section}Content that demonstrates two-sided numbering.\newpage\subsection{Subsection}More content to show header differences.\newpage\section{Second Section}Even more content.\end{document}
\documentclass{article}% Include section number in page numbering\renewcommand{\thepage}{\thesection.\arabic{page}}% Reset page counter for each section\usepackage{chngcntr}\counterwithin{page}{section}\begin{document}\section{Introduction}Pages: 1.1, 1.2, 1.3...\section{Literature Review}Pages: 2.1, 2.2, 2.3...\section{Methodology}Pages: 3.1, 3.2, 3.3...\end{document}
\documentclass{article}\usepackage{fancyhdr}\usepackage{lastpage}\pagestyle{fancy}\fancyhf{}% Show current page of total pages\fancyfoot[C]{Page \thepage\ of \pageref{LastPage}}% Alternative with different formatting% \fancyfoot[C]{\thepage\ / \pageref{LastPage}}% \fancyfoot[C]{[\thepage\ | \pageref{LastPage}]}\begin{document}\section{Introduction}This shows page X of Y format.\newpage\section{Content}More content to demonstrate numbering.\newpage\section{Conclusion}Final page shows total count.\end{document}
\documentclass{article}\usepackage{fancyhdr}\usepackage{ifthen}\pagestyle{fancy}\fancyhf{}% Conditional page numbering\fancyfoot[C]{% \ifthenelse{\value{page}=1} {} % No number on first page {\thepage} % Number on other pages}% Alternative: hide on chapter pages\fancyfoot[C]{% \ifthenelse{\boolean{@mainmatter}} {\thepage} {} % No numbers in front matter}\begin{document}\title{Document Title}\maketitle\newpage\section{Introduction}This page has a number.\newpage\section{Methods}This page also has a number.\end{document}
\documentclass{book}% Define volume number\newcounter{volume}\setcounter{volume}{1}% Include volume in page numbering\renewcommand{\thepage}{Vol.\Roman{volume}-\arabic{page}}% Alternative format% \renewcommand{\thepage}{\Roman{volume}:\arabic{page}}\begin{document}\frontmatter% Front matter pages: Vol.I-i, Vol.I-ii, etc.\mainmatter% Main content: Vol.I-1, Vol.I-2, etc.\chapter{First Chapter}Content for volume 1...% Start new volume (in practice, this would be a new document)\setcounter{volume}{2}\setcounter{page}{1}\chapter{Volume Two Content}Pages now numbered: Vol.II-1, Vol.II-2, etc.\end{document}
\documentclass{article}\usepackage{fancyhdr}\begin{document}% Issue: Page numbers not showing% Solution: Make sure page style is set\pagestyle{fancy}\fancyhf{}\fancyfoot[C]{\thepage}% Issue: Numbers in wrong position% Solution: Clear and reset headers/footers\fancyhf{} % Clear everything first\fancyfoot[C]{\thepage} % Then set what you want% Issue: Numbers not updating% Solution: Use \thepage, not literal numbers\fancyfoot[C]{\thepage} % Correct% \fancyfoot[C]{1} % Wrong - always shows 1% Issue: Numbering resets unexpectedly% Solution: Check for \pagenumbering commands% Remove unwanted \setcounter{page}{1} commandsContent to demonstrate solutions...\end{document}