Skip to main content
If you want to change the font in LaTeX, the right method depends on your compiler. Use font packages such as lmodern or newtxtext with pdfLaTeX, and use fontspec with XeLaTeX or LuaLaTeX when you want system fonts such as Times New Roman, Arial, or EB Garamond.
Quick answer: use pdfLaTeX with font packages for traditional LaTeX workflows, and use XeLaTeX or LuaLaTeX with fontspec when you need system fonts or modern OpenType features.Related topics: Text formatting | Document classes | Choosing a compiler

How to Change the Font in LaTeX

Font Basics

The Three Font Attributes

LaTeX fonts have three independent attributes:

Combining Font Attributes

Font Packages (pdfLaTeX)

Font Package Comparison

System Fonts (XeLaTeX/LuaLaTeX)

Using System Fonts

Font Selection by Name

Font Features

OpenType Features (XeLaTeX/LuaLaTeX)

Microtype Package

Font Sizes

Changing Font Size

Size Commands Reference

Mathematical Fonts

Math Font Packages

Unicode Math (XeLaTeX/LuaLaTeX)

Special Typography

Drop Caps

Custom Fonts for Special Text

Font Troubleshooting

Common Issues and Solutions

Best Practices

Font guidelines:
  1. Consistency: Use maximum 2-3 font families per document
  2. Readability: Test fonts at actual reading size
  3. Purpose: Match font to document type (serif for print, sans for screen)
  4. Licensing: Ensure fonts are properly licensed
  5. Fallbacks: Provide alternatives for missing fonts
  6. Testing: Check output on different systems/viewers

Font Comparison

For Traditional Documents

  • Times (mathptmx)
  • Palatino (mathpazo)
  • Computer Modern (default)
  • Latin Modern (lmodern)

For Modern Documents

  • Helvetica (helvet)
  • Open Sans
  • Source Sans Pro
  • Roboto

For Technical Documents

  • Computer Modern
  • STIX Two
  • Libertinus
  • KP Fonts

For Books

  • Minion Pro
  • Sabon
  • Garamond
  • Baskerville

Quick Reference


Next: Learn about Mathematical equations to create complex mathematical expressions with proper formatting.