1

I've been using TexnicCenter and \includegraphics to render EPS files as images for many years. My old laptop died, and I've had to start using a new laptop.

Everything was working well until I tried to include an image.

\begin{figure}
    \centering
        \includegraphics[width=0.50\textwidth]{C:/Documents and Settings/user/Desktop/LaTeX/Diagram.eps}
    \label{fig:Diagram}
\end{figure}

I did it in the usual way: I used the "Insert > Picture" options from the TexnicCenter tool bar. I had created my image independently and used the same website to convert it to an EPS. I had done everything the same way as I have always done. The only problem is that this time, it wouldn't compile. There are two errors with the compilation.

One of the errors is that it cannot determine the size of the graphic, (no bounding box). The other error is that the file 'C:/Documents and Settings/user/Desktop/LaTeX/Diagram.eps' is not found.

  • it can't find the bounding box if it can't find the file and it will not find C:/Documents and Settings/ because of the spaces. You can use " to quote filenames but do you really have to put the full path (which moght also be blocked depending on your security settings) – David Carlisle Oct 24 '14 at 20:49
  • Just use \includegraphics[width=0.50\textwidth]{Diagram} with no path and no extension and put the image in the same folder as your document. (there are other possibilities but that is most portable) – David Carlisle Oct 24 '14 at 20:51
  • @DavidCarlisle Your second suggestion worked perfectly, first time. Thank you so much! Let's say I have several files called Diagram, but with different extensions; which extension will it use first? – Fly by Night Oct 24 '14 at 20:55
  • It's customisable (see texdoc graphics) but the point is it is customised by default by each back end, so if you have that file in .eps and .pdf pdflatex (which can not read eps) will find the pdf and latex (which can not read pdf) will find the eps – David Carlisle Oct 24 '14 at 20:59
4

Just use

\includegraphics[width=0.50\textwidth]{Diagram}

with no path and no extension and put the image in the same folder as your document. (there are other possibilities but that is most portable)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.