I am trying to include math pictures in my document.

I have added


These two packages inside the header and then the following code


However, I keep on getting error: picture.eps is missing

Q: Do I need to create a directory where to store these pictures? Q: What should be the location of this directory? Q: What kind of file extensions do I need to have for these files?

  • 2
    This looks like a more detailed version of your first question. If this is so, please delete one of the two questions (perhaps the older one). – lockstep Feb 14 '13 at 17:21
  • The easiest route is to put your .eps files in the same folder than your tex file. This answer, however can be elaborated if you want the figures in a different folder, or if your "main document" is indeed a bunch of tex files in different folders. – JLDiaz Feb 14 '13 at 17:33
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Tobi Mar 31 '13 at 11:54

What I typically do is to create a folder, say figures, to organize all images. The folder hierarchy would be:


Then add the command \graphicspath{./figures/} in the preamble of the document to point to the folder.

Using the package epstopdf allows us to incorporate .eps figures.

A MWE followed by the output is below:


\graphicspath{ {./figures/} }

\noindent The quick brown fox jumps over the lazy dog. See Figure~\ref{fig:figurelbl}.

      \caption{\label{fig:figurelbl} An illustration of the quick brown fox \emph{jumping} over the lazy dog.}



  • I want to thank you for answering my question. It is clear that now I can add pictures where I want. – Rakesh Sharma Feb 14 '13 at 19:32
  • My pleasure @RakeshSharma. If you think you have the right answer, you may choose to accept my answer. – Umar Kalim Feb 14 '13 at 19:48
  • +1 for the epstopdf package – guillem Feb 15 '13 at 6:24

For the sake of completeness...

Q: Do I need to create a directory where to store these pictures?

Q: What should be the location of this directory?

It is not necessary to put the figures (or other files required for the typesetting of the document, as tex files, bib files, etc...) into specific directories. This means that you can organize your files in a way that suits to you, and latex and friends can be persuaded to adapt to your structure. It is just a matter of specifiyng the path unambiguously. Defining a relative path as Umar Kalim does in his answer is a good practice, minimizing both keystrokes and errors.

Q: What kind of file extensions do I need to have for these files?

If you want to include figures, you will probably want to use the includegraphics command from the graphicx package. If you specify the filename without extension, as in \includegraphics{path/to/file}, the eps extension will be added when compiling with latex, and the pdf extension will be added when compiling with pdflatex (for this to work the two versions of the file should be present in the same directory).

The file types supported natively are:

  • latex: can include EPS files with graphicx package (some dvi viewers may fail to show the image though)

  • pdflatex: according to the manual page,

    In PDF mode, pdfTeX can natively handle the PDF, JPG, JBIG2, and PNG graphics formats.

    As stated in Umar's answer, with the epstopdf package it is possible to include eps graphics into pdf files (the package automatically converts the file to pdf format, so the tool epstopdf needs to be present in your system)

If your file is not in any of these formats, it has to be converted to one of the above mentioned. Automatic conversions (i.e., performed by (pdf)latex at compilation time) can be forced using the \DeclareGraphicsRule command: take a look at Using macros in \DeclareGraphicsRule statement using shell command, Add tif image to LaTeX and related questions.

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.