Skip to main content
Headers and footers control the information that appears at the top and bottom of each page. In LaTeX, the usual workflow is simple: keep page numbering separate, then use page styles or 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 fancyhdr when you need custom header and footer content.Related topics: Page numbering | Multiple columns | Document classes

When 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
Use this page when your main question is:
  • 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:

The fancyhdr Package

The fancyhdr package provides complete control over headers and footers.

Basic Setup

Position Specifiers

Advanced Header Customization

Dynamic Content

Conditional Headers

Multi-line Headers

Graphics in Headers

Chapter and Section Information

Automatic Section Headers

Custom Section Marking

Special Page Styles

Title Page Style

Bibliography Style

Headers with Boxes and Borders

Troubleshooting Common Issues

Header Height Problems

Page Break Issues

Best Practices

Header and footer guidelines:
  1. Keep it simple - Too much information clutters the page
  2. Be consistent - Use the same style throughout similar documents
  3. Consider your audience - Academic vs. business documents have different conventions
  4. Test thoroughly - Check headers on all page types (first, last, odd, even)
  5. Mind the margins - Ensure headers don’t overlap with main content
  6. Use semantic marking - Let LaTeX generate section names automatically when possible

Professional Formatting

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.