Page X of Y when you need a more formal layout.
Quick answer:Use
example.tex
\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-referencingCommon Page Numbering Tasks
Most page-numbering questions fall into one of these patterns:- Start with arabic page numbers like
1, 2, 3 - Use roman numerals like
i, ii, iiifor front matter - Restart numbering after the title page or table of contents
- Hide the page number on one page with
\thispagestyle{empty} - Show
Page X of Yin the footer - Move the number into a custom header or footer with
fancyhdr
Basic Page Numbering
Default Numbering
LaTeX automatically numbers pages starting from 1. The page number appears in different locations depending on the document class and page style.basic-numbering.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
Changing Page Number Style
number-styles.tex
Setting Page Number
set-page-number.tex
Page Number Positioning
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.Using Page Styles
page-styles.tex
Custom Positioning with fancyhdr
custom-positioning.tex
Advanced Page Numbering
Different Styles for Different Sections
different-styles.tex
Page Ranges and Prefixes
page-ranges.tex
Two-Sided Documents
Different Numbering for Odd/Even Pages
two-sided-numbering.tex
Blank Pages in Two-Sided Documents
blank-pages.tex
Special Page Numbering Schemes
Chapter-Based Numbering
chapter-numbering.tex
Section-Based Numbering
section-numbering.tex
Total Page Count
total-pages.tex
Conditional Page Numbering
Hide Numbers on Specific Pages
conditional-numbering.tex
Different Formats by Page Range
format-by-range.tex
Multi-Volume Documents
Volume and Page Numbering
multi-volume.tex
Customizing Number Appearance
Styling Page Numbers
styling-numbers.tex
Custom Number Commands
custom-commands.tex
Troubleshooting Page Numbering
Common Issues and Solutions
troubleshooting.tex
Best Practices
Professional Examples
professional-example.tex
Quick Reference
Page Numbering Commands
Numbering Styles
Position Codes (with fancyhdr)
Next: Learn about Single-sided vs double-sided documents for layout considerations, or explore Headers and footers for complementary page design.
