LaTeX error · Packages, files and fonts
Package pdftex.def Error: File `figures/results.png' not found: using draft setting.
Quick answer
graphicx could not find the file named in \includegraphics, so it stops (or, if you continue, draws an empty frame: the "draft setting"). The path is relative to the main .tex file, not to the chapter file that contains the command, and it must match the real name exactly, including folder, case and extension. Correct the path, upload the image to the project, or tell LaTeX where to look with \graphicspath{{figures/}}.
The error in the log
This is how the message appears in the .log file (and in the compile output). The line starting with l. is the line number where TeX noticed the problem; the real mistake is there or just before it.
! Package pdftex.def Error: File `figures/results.png' not found: using draft setting.
See the pdftex.def package documentation for explanation.
Type H <return> for immediate help.
...
l.6 ...s[width=0.6\textwidth]{figures/results.png}Why it happens
- The image is in a different folder from the one in the path, or the path is written relative to a chapter file in a subfolder; LaTeX always resolves it from the folder of the main document.
- The name differs in case or extension:
Results.PNGon disk versusresults.pngin the source works on macOS and Windows but fails on Linux and on online compilers. - The image was never uploaded to the online project, or the file name contains spaces or extra dots that the driver misreads.
- With XeLaTeX the same problem is reported as
Unable to load picture or PDF file 'figures/results.png', and an unsupported format (such as.epswith pdfLaTeX on an old TeX Live) gives "Unknown graphics extension" instead.
How to fix it
Check the exact path and name of the file next to your main .tex file and copy it into \includegraphics. You can leave out the extension and let graphicx try .pdf, .png and .jpg in turn. If all figures live in one folder, add \graphicspath{{figures/}} to the preamble and refer to them by file name only.
The fixed example uses example-image-a, a placeholder image that ships with TeX Live (package mwe), so it compiles anywhere; in your document use the path of your own file.
Broken: reproduces the error
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\includegraphics[width=0.6\textwidth]{figures/results.png}
\caption{Training loss.}
\end{figure}
\end{document}Try this in Octree — free LaTeX editor with AI, compiles in your browser
Fixed: compiles cleanly
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\centering
% The file must exist at this path, relative to the main .tex file
\includegraphics[width=0.6\textwidth]{example-image-a}
\caption{Training loss.}
\end{figure}
\end{document}Related errors
- File not found – A package or class named in
\usepackageor\documentclassis misspelled or not installed. - I can't find file – A file read with
\input(or the main file) does not exist under that name or path. - Too many unprocessed floats – Figures or tables pile up behind one that LaTeX cannot place, until it runs out of float slots.
- All LaTeX errors and warnings – The full list, grouped by cause
Frequently Asked Questions
What does "using draft setting" mean?
If you tell LaTeX to continue after the error, graphicx behaves as if the draft option were on for that image: it leaves a box of the right size with the file name in it instead of the picture. The PDF is produced, but the figure is missing.
Why does the image work on my computer but not online?
Usually because of case: macOS and Windows treat Figure.PNG and figure.png as the same file, Linux servers do not. Make the name in the source match the file exactly, and make sure the image was uploaded into the same folder structure.
Is the path relative to the chapter file or the main file?
To the main file. When chapters/intro.tex is included with \input or \include, an image next to it must still be referenced as chapters/image.png, or added to \graphicspath.
Do I need to write the file extension?
No. \includegraphics{results} tries the supported extensions in order (.pdf, .png, .jpg and others for pdfLaTeX). Leaving it out also lets you swap a PNG for a vector PDF later without editing the source.
Paste your document into Octree — compile errors get a Fix with AI button
When a compile fails, Octree shows the error next to the line that caused it and offers a one-click fix that you can review before applying. Free, nothing to install.
Fix it in Octree →