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

GoalRecommended approach
Use a better default serif/sans/mono font with pdfLaTeXLoad a font package such as lmodern, newtxtext, or mathpazo
Use fonts installed on your computerCompile with XeLaTeX or LuaLaTeX and load fontspec
Keep math fonts consistent with text fontsChoose a matching text + math package pair
Improve spacing and justificationAdd microtype

Font Basics

The Three Font Attributes

LaTeX fonts have three independent attributes:
\documentclass{article}
\begin{document}

% Family (shape of letters)
\textrm{Roman family (serif)}
\textsf{Sans serif family}
\texttt{Typewriter family (monospace)}

% Series (weight/width)
\textmd{Medium series (normal)}
\textbf{Bold series}

% Shape (slant/style)
\textup{Upright shape}
\textit{Italic shape}
\textsl{Slanted shape}
\textsc{Small Caps Shape}

\end{document}

Combining Font Attributes

% All combinations work
\textsf{\textbf{Sans serif bold}}
\texttt{\textit{Typewriter italic}}
\textrm{\textbf{\textit{Roman bold italic}}}
\textsc{\textbf{Bold Small Caps}}

% Using declarations
{\sffamily\bfseries\itshape Sans serif bold italic}

Font Packages (pdfLaTeX)

\documentclass{article}

% Times-like fonts
\usepackage{mathptmx}  % Times with math support
% or
\usepackage{newtxtext,newtxmath}  % New TX fonts

% Palatino-like fonts
\usepackage{mathpazo}  % Palatino with math
% or
\usepackage{newpxtext,newpxmath}  % New PX fonts

% Computer Modern variants
\usepackage{lmodern}   % Latin Modern
\usepackage{cm-super}  % CM Super

% Sans serif as default
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}

% Other popular choices
\usepackage{fourier}   % Utopia
\usepackage{libertine} % Linux Libertine
\usepackage{kpfonts}   % KP Fonts

\begin{document}
Your text here...
\end{document}

Font Package Comparison

PackageStyleMath SupportUse Case
lmodernModernYesDefault improvement
mathptmxTimesYesTraditional papers
helvetHelveticaNoModern look
mathpazoPalatinoYesBooks, elegant
libertineLibertineYesProfessional
fourierUtopiaYesTechnical docs

System Fonts (XeLaTeX/LuaLaTeX)

Using System Fonts

\documentclass{article}
\usepackage{fontspec}

% Set main font
\setmainfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Consolas}

% With options
\setmainfont{Georgia}[
  BoldFont = Georgia Bold,
  ItalicFont = Georgia Italic,
  BoldItalicFont = Georgia Bold Italic
]

% Alternative syntax
\setmainfont[
  Ligatures=TeX,
  Numbers=OldStyle,
  Scale=1.0
]{Minion Pro}

\begin{document}
This document uses system fonts directly!
\end{document}

Font Selection by Name

\documentclass{article}
\usepackage{fontspec}

% Define custom font commands
\newfontfamily\headingfont{Helvetica Neue}
\newfontfamily\specialfont{Zapfino}
\newfontfamily\codefont{Source Code Pro}

\begin{document}

{\headingfont\Large This is a heading in Helvetica Neue}

Regular text in the main font.

{\specialfont Special decorative text}

{\codefont\small Code examples in Source Code Pro}

\end{document}

Font Features

OpenType Features (XeLaTeX/LuaLaTeX)

\documentclass{article}
\usepackage{fontspec}

\setmainfont{EB Garamond}[
  Ligatures={Common, Rare},
  Numbers=OldStyle,
  Contextuals=Alternate,
  Style=Historic
]

% Specific features
\newfontfamily\displayfont{Adobe Garamond Pro}[
  Numbers={Proportional,OldStyle},
  Letters=SmallCaps,
  Ligatures={Common,Discretionary}
]

\begin{document}

% Ligatures
Office, shelf, affiliate (fi, fl, ffi ligatures)

% Old style numbers
Regular: 0123456789 vs {\addfontfeatures{Numbers=OldStyle}0123456789}

% Small caps
{\scshape Small Capitals Text}

% Stylistic sets
{\addfontfeatures{StylisticSet=1}Stylistic Variant}

\end{document}

Microtype Package

\documentclass{article}
\usepackage{microtype}

% Full features (pdfLaTeX)
\usepackage[
  protrusion=true,
  expansion=true,
  tracking=true,
  kerning=true,
  spacing=true
]{microtype}

% Fine-tuning
\microtypesetup{
  protrusion={true,alltext},
  expansion={true,alltext,compat}
}

\begin{document}
Microtype improves typography through:
\begin{itemize}
\item Character protrusion (margin kerning)
\item Font expansion (better justification)
\item Tracking (letter spacing)
\item Additional kerning
\end{itemize}

The improvements are subtle but create more professional results.
\end{document}

Font Sizes

Changing Font Size

\documentclass[12pt]{article}  % Base size: 10pt, 11pt, or 12pt

% Exact sizes
\fontsize{14}{17}\selectfont  % 14pt font, 17pt baseline
This text is exactly 14 points.

% Relative sizes
{\tiny Tiny text (5pt at 10pt base)}
{\small Small text (9pt at 10pt base)}
{\large Large text (12pt at 10pt base)}
{\Huge Huge text (25pt at 10pt base)}

% Custom size commands
\newcommand{\customsize}{\fontsize{13}{16}\selectfont}
{\customsize Custom 13pt text}

Size Commands Reference

Command10pt Article11pt Article12pt Article
\tiny5pt6pt6pt
\scriptsize7pt8pt8pt
\footnotesize8pt9pt10pt
\small9pt10pt10.95pt
\normalsize10pt10.95pt12pt
\large12pt12pt14.4pt
\Large14.4pt14.4pt17.28pt
\LARGE17.28pt17.28pt20.74pt
\huge20.74pt20.74pt24.88pt
\Huge24.88pt24.88pt24.88pt

Mathematical Fonts

Math Font Packages

% Matching text and math fonts
\usepackage{mathptmx}     % Times
\usepackage{mathpazo}     % Palatino
\usepackage{fourier}      % Utopia
\usepackage{newtxmath}    % Times (modern)
\usepackage{newpxmath}    % Palatino (modern)
\usepackage{eulervm}      % Euler math
\usepackage{stix2}        % STIX fonts

% Math alphabets
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}     % \mathscr
\usepackage{bbm}          % \mathbbm

% Usage
$\mathbb{R}$, $\mathcal{A}$, $\mathscr{L}$, $\mathfrak{g}$

Unicode Math (XeLaTeX/LuaLaTeX)

\documentclass{article}
\usepackage{unicode-math}

% Set math font
\setmathfont{XITS Math}
% or
\setmathfont{Latin Modern Math}
% or
\setmathfont{TeX Gyre Termes Math}

% With options
\setmathfont{Cambria Math}[
  Scale=MatchLowercase,
  math-style=ISO,
  bold-style=ISO
]

\begin{document}
Unicode math allows: $Ξ± + Ξ² = Ξ³$ and $∫_0^∞ e^{-xΒ²} dx = \frac{βˆšΟ€}{2}$
\end{document}

Special Typography

Drop Caps

\documentclass{article}
\usepackage{lettrine}
\begin{document}

\lettrine[lines=3]{O}{nce upon a time}, in a land far away, 
there lived a typographer who loved beautiful drop caps. 
This elegant initial letter adds a classic touch to the 
beginning of chapters or sections.

\lettrine[lines=2,loversize=0.1]{T}{his} is a smaller drop cap.

\end{document}

Custom Fonts for Special Text

\documentclass{article}
\usepackage{fontspec}  % XeLaTeX/LuaLaTeX

% Define special purpose fonts
\newfontfamily\chapterfont{Bebas Neue}
\newfontfamily\quotefont{Crimson Text}[Scale=1.1]
\newfontfamily\emojifont{Apple Color Emoji}  % or Noto Color Emoji

\begin{document}

{\chapterfont\Huge Chapter One}

{\quotefont\itshape "Beautiful typography is invisible, 
yet it shapes how we perceive the written word."}

{\emojifont 😊 πŸ“š ✨}  % Emoji support!

\end{document}

Font Troubleshooting

Common Issues and Solutions

% Font not found (XeLaTeX/LuaLaTeX)
\setmainfont{Arial}[
  Extension = .ttf,
  Path = /path/to/fonts/,
  UprightFont = *-Regular,
  BoldFont = *-Bold,
  ItalicFont = *-Italic
]

% Missing characters
\usepackage{textcomp}  % Additional symbols
\usepackage[T1]{fontenc}  % Better encoding

% Font substitution warnings
\usepackage{silence}
\WarningFilter{latexfont}{Font shape}

% Check available fonts (XeLaTeX/LuaLaTeX)
% Run in terminal: fc-list : family

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

TaskpdfLaTeXXeLaTeX/LuaLaTeX
Times font\usepackage{mathptmx}\setmainfont{Times New Roman}
Sans default\renewcommand{\familydefault}{\sfdefault}\setmainfont{Arial}
Math fonts\usepackage{newtxmath}\usepackage{unicode-math}
Custom fontUse packages\newfontfamily\myfont{FontName}

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