Figure Environment Validator
Learn about the figure environment validator and how to migrate from \begin{figure} to \illustration{}.
What It Does
The Figure Environment Validator checks your LaTeX file for any usage of \begin{figure}...\end{figure} environments. This environment is not supported — you should use the \illustration{} macro instead. The validator reports an error with the line numbers of every \begin{figure} it finds.
When This Error Occurs
You will see this error when your document contains one or more \begin{figure} environments:
Found \begin{figure} on line 8. Please use \illustration{} instead.
If multiple figure environments are present, all of their line numbers will be listed:
Found \begin{figure} on lines 8, 23. Please use \illustration{} instead.
Common Causes
This error typically appears when:
- Copy-pasting from other LaTeX projects — Standard LaTeX documents use
\begin{figure}, but this project expects\illustration{}. - Following generic LaTeX tutorials — Most guides teach the
figureenvironment by default. - Force of habit — If you are used to writing standard LaTeX, reaching for
\begin{figure}is natural.
How to Fix It
Replace every \begin{figure}...\end{figure} block with the \illustration{} macro. The macro takes three arguments:
\illustration{<width>}{<filename>}{<caption>}
<width>— The width of the image as a fraction (e.g..4for 40% of the text width).<filename>— The image file name (e.g.judging.png).<caption>— The caption text, which can include LaTeX commands like\href.
Before (incorrect):
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth]{overview.png}
\caption{An overview of the system architecture.}
\end{figure}
After (correct):
\illustration{.4}{overview.png}{An overview of the system architecture.}%
Tip
Note the trailing % after \illustration{}. This prevents unwanted whitespace from being introduced after the macro. It is good practice to include it.