9

I would like to import JPG file into my document in LaTeX. The code below works but only for EPS files, but I need JPG. How can I fix it?

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{image}
\end{document}

2 Answers2

5

You need to use pdflatex to compile it, which support jpg images. Check out here for more info.

enter image description here

Update: as commented by @daleif, MPS, i.e. metapost eps can also be included via pdflatex without the need of conversion.

  • 1
    You're forgetting MPS, metapost eps, that can be included via pdflatex without the need of conversion. – daleif Jan 26 '14 at 20:21
0

I generally convert the filename.eps or .jpg or .png or whatever to PDF, rename the filename.pdf to filename_converted_to.pdf and insert filename.eps in the \includegraphics command..

It's what's done during the pdflatex compilation process.

You'll have something like that:

\includegraphics{./imgs/filename.jpg}
  • 4
    I cannot make sense of this answer. You convert a jpg to pdf rename it and never use that name again, then you include the eps but in the example it's a jpg? I'm confused. Plus, is this really an answer for latex or rather for pdflatex? – Christian Jan 26 '14 at 20:50
  • @Christian yes like sneak around then pull it back right there. – caveman May 11 '16 at 12:09