Rules / Output

LaTeX Warning: Reference `…' undefined — Undefined reference

A \ref points to a label that does not exist, so the PDF shows ??.

Fix

Add the \label or fix the spelling in \ref.

Example

Reproduced on TeX Live 2026 by CI · pdflatex · corpus/undefined-reference

\ref to a label that does not exist

Fails: main.tex
\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
As shown in Figure~\ref{fig:results}, the method converges.
\end{document}
Fixed
\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
As discussed in Section~\ref{sec:intro}, the method converges.
\end{document}
What TeX prints in main.log
LaTeX Warning: Reference `fig:results' on page 1 undefined on input line 4.