Rules / Build

Package xcolor Error: Undefined color `…' — Undefined color

A color name is used that xcolor does not know.

Fix

Define it with \definecolor, or load xcolor with dvipsnames/svgnames.

Example

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

Misspelled color name

Fails: main.tex
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\textcolor{darkred}{Warning:} the results are preliminary.
\end{document}
What TeX prints in main.log
! Package xcolor Error: Undefined color `darkred'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.4 \textcolor{darkred}{Warning:}
                                  the results are preliminary.
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.