I'm just beginning with LaTeX, and I'm trying to understand how to include images in my documents. I'm working under TeXnicCenter.
In the book I've bought they say that I should use the command \includegraphics
. I've used the packages calc
and graphicx
, but the message pdftex.def error
appears when I try to open an image and apparently LaTeX can't find my file.
LaTeX writes:
! package pdftex.def Error: File 'The name of the file' not found.
I don't have files under the eps
format, but .jpg or .png. I've tried to use the package epstopdf
, as recommended on this website, but I can't understand where I'm supposed to enter the option -shell-escape
. And as this package is supposed to convert eps
files to pdf
, I don't see how it could help me anyway, as I'm trying to use JPEG and PNG files. So as you can see, little problem here …
My code is basically this (I hope the problem doesn't come from other packages I would have used and were not compatible, but I don't think so):
\documentclass{report}
\usepackage{calc, graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics{C:/Users/Pictures/Lord of the Rings/Dimholt.jpg}
\end{document}
Best Answer
Well, if I compile your given code with MiKTeX 2.9 (and using TeXnicCenter with compiling option
LaTeX->PDF
) I get the same error you showed us.This error simply tells you that the file
thefile.jpg
is not found and can therefore not be included to your document.If I compile with added option
demo
to packagegraphicx
the code compiles without error---of course, because LaTeX has not to search and clude a non existing file.BTW, if I compile with
pdflatex
(that means the TeXnicCenter optionLaTeX->PDF
I do not need the other packages you added to your code.Please see the following MWE, compiling without error:
If I now add a file
thefile.jpg
into the same directory the tex code is and delete option[demo]
, the image is included with no error.If you want to include an
*.eps
file compiling withpdflatex
, you need to uncomment packageepstopdf
. Then an filethefile.eps
(you see the different extention.eps
?) is converted tothefile.pdf
and can be included. But then you need to call it in your TeX code with\includegraphics{thefile.eps}
.Please see this image and check the red marked parts:
For me it seems you do missmatch some things, I'm right?