Font Shape Not Found
LaTeX Font Warning: Font shape 'OT1/XXX/m/n' undefined.
What this error means
LaTeX requested a specific font shape (a combination of encoding, family, series, and shape) that isn't available in the current TeX installation. LaTeX substitutes the closest available font, which may change the document's appearance.
Common causes
- A custom font loaded with \setmainfont{} or \fontfamily{} that isn't installed
- Requesting bold-italic in a font that lacks that variant
- Loading a font package but missing the font files in the TeX installation
How to fix it
Install the missing font package via your TeX distribution (tlmgr install packagename for TeX Live). If using XeLaTeX/LuaLaTeX with fontspec, check that the system font name matches exactly.
Code examples
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Nonexistent Font Name} % Font not on system
\begin{document}
Hello
\end{document}\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman} % Standard TeX font, always available
\begin{document}
Hello
\end{document}Related errors
File Not Found
! LaTeX Error: File 'XXX' not found.
Unknown Graphics Extension
! LaTeX Error: Unknown graphics extension: .XXX.
Unicode Character Not Supported (pdfLaTeX)
! Package inputenc Error: Unicode char U+XXXX not set up for use with LaTeX.
Cannot Determine Size of Graphic (No BoundingBox)
! LaTeX Error: Cannot determine size of graphic (no BoundingBox).
Test the fix live
Paste your LaTeX into the playground and compile instantly.

