Include latex shape files

I am trying to include jpeg files in latex

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

Given a width and height and compiled with pdflatex, it causes an error:

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

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

In any case, to use the default setting, without having to specify the width and height? If I do not specify them in the latex file,

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

I still get the same BoundingBox error.

Thank you and welcome!


Change

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

to

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

BoundingBox error still missing.


I use

 \usepackage[dvips]{graphicx} 

What is the difference between him and

 \usepackage{graphicx} 

It seems that with the former, eps shape files can work, but jpeg files cannot, and everything becomes inverse?


Can I include both eps and jpg shape files in the same latex file?

+4
source share
3 answers

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

EDIT (as a result of editing in question): you should not use the dvips option when using pdflatex . This option creates information useful for postprocessing latex dvi output (for example, via dvips). In your case, since you are using pdflatex , you simply do not have to give any option to the graphics package (the correct driver is automatically selected). Pdflatex, on the other hand, only supports external graphics in PNG, JPG or PDF format, but as others have said, it is easy to convert EPS to PDF: my preferred way is to use epstopdf , which is provided in texlive-extra-utils package in Ubuntu.

For example, when processing using pdflatex, the following example works if you have an image.png or image.jpg or image.pdf file in the current directory:

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

You need to add the pdftex package to the graphicx package:

 \usepackage[pdftex]{graphicx} 
+4
source

try \ includegraphics {myfig.jpg}

when you say [width = 57.6 mm, height = 43.2 mm], box size in millimeters (mm). latex scales your image to this size.

larger options: http://amath.colorado.edu/documentation/LaTeX/reference/figures.html

For error without restriction:

What is a BoundingBox?

A BoundingBox is an entry that resides in PostScript files that tells the reader about the size of the file. Latex uses this entry to determine how to place an image in a document. How to fix my latek problem

It is very easy to fix this problem. The ImageMagick software package is used in this case to convert images from one form to another. ImageMagick is capable of converting many image formats to many other types. To convert, simply enter this in the console:

 root@Pingu ~ # convert image.jpg image.eps 

http://www.tuxpages.com/helppages/latex-convert.shtml

+2
source

Source: https://habr.com/ru/post/1304645/


All Articles