No bounding box latex ошибка

Although the question has been answered by @DavidCarlisle in the comment, I’ll try to complete the answer here.

This is not supposed to happen for valid eps files, as they should contain a BoundingBox comment and the graphicx package should be able to read it. The error message is typical when including bitmap graphics, e.g. jpg, as explained here.

In case you have a peculiar eps file which contains a BoundingBox comment but, for some reason, graphicx cannot read it, you can try searching your file. Do this either by opening the file in a text editor or by using something like the grep command:

grep BoundingBox figure.eps

You should normally see a line like:

%%BoundingBox: 0 0 30 30

Then, update your includegraphics by supplying that:

includegraphics[scale=1,bb=0 0 30 30]{figure}

In case you cannot find a bounding box (and your eps file is still usable, of course, which may not be the case), I’d suggest that you try guessing it. Start, e.g. with bb=0 0 100 100 and see what you get, then try increasing or decreasing the numbers. They are, in turn: lower-left-x (llx), lower-left-y (lly), upper-right-x (urx), and upper-right-y (ury). The width of the picture is urx-llx and the height is ury-lly.

I am getting the following error while compiling my Latex File :

! LaTeX Error: Cannot determine size of graphic in tree.jpg (no BoundingBox).

Why do I get this error ? What has this to do with an .eps file ?

In fact, I could compile it fine with MacTex on my machine. But when I submit it online to a scientific journal for publication, it compiles it on the server and sends me the resultant PDF which has all these errors that prevent it from compiling.

I am using the following syntax for including the images :

begin{figure}[!h]
    begin{center}
        scalebox{0.45}{
            includegraphics{tree.jpg}}
    end{center}
            caption{small A sample}
            label{tree}
end{figure}

What should I do ? Could it be that their server is using an old compiler ?

UPDATE : It finally worked. I converted the first image to PDF and the compilation happened perfectly. I guess it used the bounding box value from that PDF and applied it to all images.

Mr Lister's user avatar

Mr Lister

45.2k15 gold badges107 silver badges150 bronze badges

asked Apr 8, 2009 at 21:29

euphoria83's user avatar

8

To include png and jpg, you need to specify the Bounding Box explicitly.

includegraphics[bb=0 0 1280 960]{images/some_image.png}

Where 1280 and 960 are respectively width and height.

answered Aug 23, 2011 at 3:34

h3xStream's user avatar

h3xStreamh3xStream

6,2032 gold badges46 silver badges57 bronze badges

2

I’ve had the same problems including jpegs in LaTeX. The engine isn’t really built to gather all the necessary size and scale information from JPGs. It is often better to take the JPEG and convert it into a PDF (on a mac) or EPS (on a PC). GraphicsConvertor on a mac will do that for you easily. Whereas a PDF includes DPI and size, a JPEG has only a size in terms of pixels.

( I know this is not the answer you wanted, but it’s probably better to give them EPS/PDF that they can use than to worry about what happens when they try to scale your JPG).

answered Apr 8, 2009 at 21:31

Uri's user avatar

UriUri

88.2k50 gold badges221 silver badges321 bronze badges

11

Using .jpg files do not forget about compiling directly to .pdf (pdflatex) and use:
graphicx package with pdftex option (usepackage[pdftex]{graphicx}).

answered Jul 1, 2011 at 11:21

kuszi's user avatar

kuszikuszi

2,07929 silver badges36 bronze badges

3

If you have Gimp, I saw that exporting the image in .eps format would do the job.

answered Apr 25, 2010 at 0:09

balaur's user avatar

balaurbalaur

961 silver badge4 bronze badges

I use MacTex, and my editor is TexShop. It probably has to do with what compiler you are using. When I use pdftex, the command:

includegraphics[height=60mm, width=100mm]{number2.png}

works fine, but when I use «Tex and Ghostscript», I get the same error as you, about not being able to get the size information. Use pdftex.

Incidentally, you can change this in TexShop from the «Typeset» menu.

Hope this helps.

answered Apr 8, 2009 at 21:45

Tom's user avatar

TomTom

21.4k6 gold badges39 silver badges44 bronze badges

2

On a Mac (pdftex) I managed to include a png file simply with

includegraphics[width=1.2textwidth]{filename.png}

. But in order for that to work I had to comment out the following 2 packages:

%usepackage[dvips]{epsfig}

%usepackage[dvips]{graphicx}

…and simply use package graphicx:

usepackage{graphicx}

It seems [dvips] is problematic when used with pdftex.

Mattia Righetti's user avatar

answered Jun 15, 2013 at 17:22

blue scorpion's user avatar

1

I had the same problem, caused by a clash between the graphicx package and an inclusion of the epsfig package that survived the ages…

Please check that there is no inclusion of epsfig, it is deprecated.

answered Mar 20, 2013 at 13:01

Tommy's user avatar

TommyTommy

7398 silver badges24 bronze badges

 

Вставка рисунка

Сообщение12.05.2011, 15:59 


10/11/10
34

Работаю в TEX Live 2009

Не работает вставка рисунка

Код:

includegraphics[scale=0.8]{01.JPG}

Ошибка ! LaTeX Error: Cannot determine size of graphic in 01.JPG (no BoundingBox).

Профиль  

xni 

Re: Вставка рисунка

Сообщение12.05.2011, 16:22 


11/05/11
28
Обнинск

Привет!

Я давно этого не делал, но по-моему зависит от компилятора.
Для pdflatex подходит JPG, а для чего-то, возможно, требуется преобразование в EPS.

Профиль  

caxap 

 Re: Вставка рисунка

Сообщение12.05.2011, 16:45 

Заслуженный участник
Аватара пользователя


07/01/10
2015

(no BoundingBox).

Если латех ищет «BoundingBox», то по-любому считает ваш файл PS/EPS-ом. А так как вы даёте ему вовсе не PS/EPS, то он и ругается.

Профиль  

Astaroth 

 Re: Вставка рисунка

Сообщение12.05.2011, 17:04 


10/11/10
34

(no BoundingBox).

Если латех ищет «BoundingBox», то по-любому считает ваш файл PS/EPS-ом. А так как вы даёте ему вовсе не PS/EPS, то он и ругается.

Почему так происходит?
Если я подключаю

Код:

usepackage{graphicx}

тогда ошибка no BoundingBox
если

Код:

usepackage[pdftex]{graphicx}

то

Код:

! Package pdftex.def Error: PDF mode expected, but DVI mode detected!

не смотря на ошибку pdf файл создается

Профиль  

caxap 

Re: Вставка рисунка

Сообщение12.05.2011, 17:08 

Заслуженный участник
Аватара пользователя


07/01/10
2015

Вам уже сказали два решения: либо компилируете сразу в pdf (pdflatex), либо конвертируйте рисунки в eps. JPG и DVI вроде бы несовместимые вещи.

Профиль  

—mS— 

 Re: Вставка рисунка

Сообщение13.05.2011, 19:49 

Заслуженный участник
Аватара пользователя


23/11/06
4171

Не работает вставка рисунка

Код:

includegraphics[scale=0.8]{01.JPG}

Ошибка ! LaTeX Error: Cannot determine size of graphic in 01.JPG (no BoundingBox).

Ну так дайте ему BoundingBox: что-нибудь типа

Код:

includegraphics[scale=0.8, bb=5 10 383 530]{01.JPG}

Он же должен, бедолага, знать, какой прямоугольник отвести на странице под рисунок :)

Профиль  

KJhas 

Re: Вставка рисунка

Сообщение28.01.2012, 14:44 


28/01/12
1

в описании к миктеху graphicx.dvi написано
includegraphics[Ux,Uy][ux,uy]{pic}
где Ux,Uy — отступ, ux,uy — размер
и, ессно, никакого scale, поэтому и не работает.

А вот где у него (миктеха) отключить показывание рамки
рисунка и показывание самого рисунка в pdf, я так и не нашел.
Подскажите, пожалуйста.

Профиль  

Модераторы: Karan, Toucan, PAV, maxal, Супермодераторы

Hello,
I can include eps figures in my document, but I have most of my graphics in png format. When I want to include a png figure I get the following message:

! LaTeX Error: Cannot determine size of graphic in fig/BrochierCie_Maroc/fig2.png (no BoundingBox).

this is strange, because if I extract the bounding box with the «ebb» command I get something:

timbrochier$ ebb -v fig2.png
./fig2.png looks like a PNG file…okay
Writing to fig2.bb: Bounding box: 0 0 576 432

… then it looks like if there were a bounding box…?!

I can include this figure but I have to convert it to eps first (with the «convert» command), then there is no problem, but I’m afraid the final pdf will be too heavy if I convert all my graphics to eps… does someone knows how to fix this problem of bounding box, or tell me if i’m doing something wrong?

I’m on Mac OS 10.4, with Texshop.
here are the packages I use:

documentclass[phd, index, hyperref, prelimtm]{theseUL1_2} % Pour les Phd, remplacer «msc» par «phd»
usepackage[latin1]{inputenc} % Pour pouvoir taper les accent directement et non pas passer par ‘
usepackage[francais]{babel}
FrenchItemizeSpacingfalse
usepackage{epsfig} % Pour utiliser la commande epsfig
usepackage{graphicx} % Pour utiliser la commande includegraphics
usepackage{textcomp}

and I include my graphics this way:

begin{figure}[!h]
begin{center}
includegraphics[width=12cm]{fig/BrochierCie_Maroc/fig2.png}
caption{label{Fig2_BroMaroc}textsl{ legend of the figure }}
end{center}
end{figure}

Thanks for any help!

I’m authoring my thesis in LaTeX, a sort of scripting language similar to HTML that produces beautiful final results… that is, if you can get it to cooperate.

My current problem is with trying to use the graphicx package.  I can’t get a graphic to display correctly.  The code looks correct but it keeps throwing strange errors.  I copied the code verbatim (with changing the file i’m trying to insert) from a friend’s masters thesis.  It worked in his so I don’t see why it’s not working in mine.  We are using the same class files and whatnot and the same general format.

The problem comes (i think) in the width variable.  That textwidth doesn’t seem to be working correctly.

The Code:

begin{figure}[h]
begin{center}
includegraphics[width=0.6textwidth, keepaspectratio=true ]{figures/hofstede_onion.png}
caption{Hofstede's Onion Model of Culture: Cultural Values are located at the core and are surrounded by Rituals, Heros, and Symbols with Practices drilling down from the outside to the Values center. Reproduced from cite{Hofstede01}.}
label{fig:hofstede_onion}
end{center}
end{figure}

The Error Message:

! LaTeX Error: Cannot determine size of graphic in figures/hofstede_onion.png (no BoundingBox).
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...
1.18 ... ctratio=true ]{figures/hofstede_onion.png}
) [5]

Thoughts, insights, ideas?

UPDATE:

With the help of Alex (recommended by Anne), I was able to get the graphics files to pop out.  The key was switching from outputting into a DVI file or a PS file to outputting directly into a PDF file.  To do this in TeXnic Center, I went to Build -> Select Output File.  I then chose the PDF option.

Other problems still exist with my output, but at least some of the big ones are now addressed.  No doubt, there will be further whining for help as I progress with my thesis.

Понравилась статья? Поделить с друзьями:
  • No api calls possible inpa ошибка
  • No android device connected unity ошибка
  • No adl load ошибка xwz
  • Nn gs597m panasonic ошибка h97
  • Nmm a problem occurred during install ошибка