Graphics, Figures & TablesBounding Box not found

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Bounding Box not found

Post by snowfrog »

Hi,

I have bought a new computer, I am running Ubuntu 11.10 and just installed latex on it with

Code: Select all

sudo apt-get install texlive-latex-base
I have a *tex file I have run many times in the past on 2 different machines. When I run

Code: Select all

latex file.tex
I get the error message

Code: Select all

! LaTeX Error: Cannot determine size of graphic in \unhbox\voidb@x \penalty \@M
 \ {}/img.eps (no BoundingBox).
However, when I look at the eps file I can see the line

Code: Select all

%%BoundingBox: 46 169 550 673
and I also know that the figure is fine because I the tex file has been compiled many times before.

Below is a MWE and I also attached the img file. I'm not sure how anyone can help as the MWE does work on another machine. Anyway, any advice welcome!

Code: Select all

\documentclass{article}
\usepackage{graphicx}   % for figures
\begin{document}
\graphicspath{{~/Mypath/}}

\begin{figure}[!H]
\includegraphics[scale=0.8, angle= -90]{img.eps}
\end{figure}

\end{document}
Attachments
img.eps
(62.83 KiB) Downloaded 547 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Bounding Box not found

Post by Stefan Kottwitz »

Hi,

you need to run LaTeX in DVI mode for eps support. If you run pdfLaTeX, you could use the epstopdf package which can do conversion on the fly.

Btw. installing LaTeX from the Ubuntu repositories is quick and easy, however be aware that you are using a version of 2009. I would install TeX Live 2011 from the TeX Live website and update to the most recent package versions. Actually, I'm currently using Ubuntu with TeX Live 2011.

Stefan
LaTeX.org admin
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Bounding Box not found

Post by snowfrog »

you need to run LaTeX in DVI mode for eps support
Aren't I running LaTeX in DVI mode if I compile my tex file with the command

Code: Select all

latex file.tex
?

The latex command should produce a dvi file and read the eps figures. I always ran this script with the

Code: Select all

latex
command before.

I've also added the epstopdf package, as you suggested, ran the tex file with pdflatex but I'm getting another error message

Code: Select all

! LaTeX Error: Unknown graphics extension: .eps.
so it doesn't appear to work either.

Any other suggestions...?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Bounding Box not found

Post by Stefan Kottwitz »

Perhaps post your .log files as attachments, for both cases, then we can know more about the situation.

Stefan
LaTeX.org admin
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Bounding Box not found

Post by snowfrog »

Perhaps post your .log files as attachments
Done. Hope this helps.
Attachments
latex.log
(9.33 KiB) Downloaded 545 times
pdflatex.log
(10.91 KiB) Downloaded 510 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Bounding Box not found

Post by Stefan Kottwitz »

Perhaps there's really no bounding box ... could you post BentShrub.eps as attachment?

Stefan
LaTeX.org admin
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Re: Bounding Box not found

Post by snowfrog »

Sorry, I should have sent the log file of the MWE, not my actual file, to keep things simple.
The log file of the MWE is now attached and the image used is the previous one that I have sent, img.eps.
Attachments
latex.log
(3.1 KiB) Downloaded 533 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Bounding Box not found

Post by Stefan Kottwitz »

Including this img.eps works for me with LaTeX, XeLaTeX and pdfLaTeX with epstopdf.

However, I think this is the problem in your case:

Code: Select all

\graphicspath{{~/Mypath/}}
That's because of the error message

Code: Select all

! LaTeX Error: Cannot determine size of graphic in \unhbox\voidb@x \penalty \@M
 \ {}/MyPath/img.eps (no BoundingBox).
There you can see, the tilde ~ as special character, which is used for an unbreakable space in LaTeX, appears translated as \ {}.

Make it without the tilde character, for example

Code: Select all

\graphicspath{{/home/username/Mypath/}}
Stefan
LaTeX.org admin
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Bounding Box not found

Post by snowfrog »

Make it without the tilde character, for example
Bingo! That was the problem! Little annoying things in life....

Thank you very much Stefan_K!
Post Reply