### LaTeX Books

Limited discount 50%
coupon code tDRet6Y

### LaTeX users online

In total there are 11 users online :: 1 registered, 0 hidden and 10 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 10 guests

### LaTeX Friends

Sponsored by DANTE e.V.: The German speaking TeX Users Group

## "no bounding box"

### LaTeX Forum: General

Add tags LaTeX specific issues not fitting into one of the other forums of this category.
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!
timbrochier

Posts: 2
Joined: Fri Aug 1st, 2008

latex doesn't accept PNG files. You should go the other way and convert EPS files to PDF with epstopdf or "on the fly" with the epstopdf package. You then can compile your document source with pdflatex and include your PNG files as usual.

Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9218
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

but I'm very surprised with what you said: I'm a begginer in latex, but a single google search "latex png" gives a lot of results where we can see people explaining that they use png in their latex documents... but I must be confused between latex, pdflatex, texshop and others tex.

Then I will do as you suggest, but is there a way to make the final document not so heavy in terms of memory? I only did one chapter and it is already 8Mo!
timbrochier

Posts: 2
Joined: Fri Aug 1st, 2008

timbrochier wrote:[…] but a single google search "latex png" gives a lot of results where we can see people explaining that they use png in their latex documents... but I must be confused between latex, pdflatex, texshop and others tex. […]

Obviously, you are a little bit confused. LaTeX is the typesetting system, which has (amongst others) the two compilers latex and pdflatex. The first one produces DVI output, the second has PDF as output format. latex only accepts PS/EPS files for graphics inclusion. pdflatex accepts JPG, PNG and finally PDF format. Since you are running a Mac System, you even can include TIF files when compiling with pdflatex.
timbrochier wrote:[…] Then I will do as you suggest, but is there a way to make the final document not so heavy in terms of memory? I only did one chapter and it is already 8Mo!

The size of the final output should not reach this mark. The PNG files converted to EPS blow up the file. This should not happen when leaving them untouched and process the EPS files as described in my first reply.

The advantage of converting the EPS files is that the vector based character of the files is kept, whereas the pixel based PNG format must be converted to a vector format. This yields the large size of the resulting files.
LaTeX Community Moderator

¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9218
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany