FormaTeX
WarningFiles & Resources

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

Causes the error
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Nonexistent Font Name}  % Font not on system
\begin{document}
Hello
\end{document}
Fixed
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}  % Standard TeX font, always available
\begin{document}
Hello
\end{document}

Related errors

Test the fix live

Paste your LaTeX into the playground and compile instantly.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy