Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

include figure files in latex [closed]

I am trying to include jpeg files in latex

\includegraphics[width=57.6mm, height=43.2mm]{../../results2/html/zerooneloss_stumps.jpg}  

With specified the width and height and compiled with pdflatex, however, it produces the error:

! LaTeX Error: Cannot determine size of graphic in ../../results2/html/zerooneloss_stumps.jpg (no BoundingBox).  

The true size of the image is 576x432 in pixels. Have I specified the size correctly in the latex file?

Anyway to use the default setting without need to specify the width and height? If I don't specify the them in the latex file,

\includegraphics[]{../../results2/html/zerooneloss_stumps.jpg}

I still get the same no BoundingBox error.

Thanks and regards!


Change

\includegraphics[]{../../results2/html/zerooneloss_stumps.jpg}

to

\includegraphics{../../results2/html/zerooneloss_stumps.jpg}

still has the no BoundingBox error.


I am using

\usepackage[dvips]{graphicx}

What is the difference between it and

\usepackage{graphicx}

It seems with the former one, eps figure files can work while jpeg files cannot, with the latter, things become reverse?


Is it possiblt to include figure files of both eps and jpg in the same latex file?

like image 220
Tim Avatar asked Dec 28 '22 22:12

Tim


1 Answers

Do you have \usepackage{graphicx} in your preamble?

EDIT (consequent of an edit in the question): you should not use the dvips option when using pdflatex. The option produces informations useful for the postprocessing of the dvi output of the latex program (e.g. via dvips). In you case, since you are using pdflatex you should simply not give any option to the graphicx package (the right driver is choosen automatically). On the other hand pdflatex only supports external graphics in PNG, JPG or PDF format, but, as other have said, it's easy to convert EPS to PDF: my preferred way is to use epstopdf that in Ubuntu is provided by the texlive-extra-utils package.

For example, when processed with pdflatex, the following example works if you have a file image.png or image.jpg or image.pdf in the current directory:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{image}
\end{document}
like image 196
baol Avatar answered Dec 31 '22 14:12

baol