Rules / Build

TeX capacity exceeded, sorry — TeX ran out of capacity

Usually infinite recursion (a command that calls itself); otherwise a very large figure.

Fix

Check recent \newcommand/\renewcommand definitions; for big figures use LuaLaTeX or externalize them.

Example

Reproduced on TeX Live 2026 by CI · pdflatex · corpus/infinite-recursion

Macro that calls itself

Fails: main.tex
\documentclass{article}
\newcommand{\model}{\textsc{\model}}
\begin{document}
We call our approach \model.
\end{document}
What TeX prints in main.log
! TeX capacity exceeded, sorry [grouping levels=255].
\maybe@load@fontshape ->\begingroup 
                                    \let \typeout \@font@info \try@load@font...
l.4 We call our approach \model
                               .
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

!  ==> Fatal error occurred, no output PDF file produced!