fancyhdr to place the page number, section title, date, or document title where you want it.
Quick answer:Use built-in page styles for simple cases and
example.tex
fancyhdr when you need custom header and footer content.Related topics: Page numbering | Multiple columns | Document classesWhen To Use Page Numbering vs Headers and Footers
Use Page numbering when your main question is:- how to switch between roman and arabic numbers
- how to restart numbering
- how to hide numbers on selected pages
- how to show
Page X of Y
- how to put the page number in a specific place
- how to show chapter or section titles in the header
- how to create different header/footer styles for different pages
- how to control header and footer rules with
fancyhdr
Understanding Page Styles
Default Page Styles
LaTeX provides four built-in page styles:basic-styles.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
The fancyhdr Package
Thefancyhdr package provides complete control over headers and footers.
Basic Setup
fancyhdr-basic.tex
Position Specifiers
position-specifiers.tex
Advanced Header Customization
Dynamic Content
dynamic-headers.tex
Conditional Headers
conditional-headers.tex
Multi-line Headers
multiline-headers.tex
Graphics in Headers
graphics-headers.tex
Chapter and Section Information
Automatic Section Headers
section-headers.tex
Custom Section Marking
custom-marking.tex
Special Page Styles
Title Page Style
title-page-style.tex
Bibliography Style
bibliography-style.tex
Headers with Boxes and Borders
boxed-headers.tex
Troubleshooting Common Issues
Header Height Problems
header-height.tex
Page Break Issues
page-break-issues.tex
Best Practices
Professional Formatting
professional-example.tex
Quick Reference
Essential fancyhdr Commands
Position Codes
Common Variables
Next: Learn about Page numbering for advanced numbering schemes, or explore Multiple columns for overall layout principles.
