[tex-live] texlive under ubuntu cannot find proper .bb file for png image file

Zdenek Wagner zdenek.wagner at gmail.com
Fri Jul 31 09:50:11 CEST 2009

2009/7/31 Jin Huang <hj at cad.zju.edu.cn>:
> Dear all,
>
> I just switched from WinXP+MikTeX to ubuntu+TexLive. I have a latex document
> which can be correctly compiled into dvi previously.  However, it doesn't
> work now.
>
Please, remember that neither TeX nor LaTeX itself can include any
graphics. TeX was not programmed to do it. you can only use a macro
\special with appropriate parameters so that some device driver can
understand it and include in the output. Pdftex was extended so that
it can directly include PDF, JPG and PNG. It can read the dimensions
directly from the file, it is not necessary to use other tools to get
the bounding box. If you wish to use something else than pdftex, you
have to select dvi driver that is capable of inserting PNG and a macro
package that can write an appropriate \special. I do not know about
such a driver (maybe dvipdfm but I do not know it well). Or you have
to convert the image to a format known by the driver that you wish to
use.

> I have minimized the document to highlight problem as follows:
>
> ================= begin of a.tex ===============
> \documentclass{article}
> \usepackage{graphicx}
> \DeclareGraphicsExtensions{.png}
> \begin{document}
> \begin{figure}
>  \includegraphics{img.png}
> \end{figure}
>
> \end{document}
> ================= end of a.tex ===============
>
> The img.png is a image file put in the same directory with a.tex, and img.bb
> is generated from ImageMagick with the following content:
>
> %%BoundingBox: 0 0 210 592
>
> It seems that when latex reads \includegraphics{img.png}, it doesn't go to
> find the corresponding bb file, or cannot find it.
>
> I have also tried to remove the suffix of img.png in the tex document. It
> doesn't work still.
>
> The document can be compiled use pdflatex correctly. Adding the option
> [pdftex] to the package graphicx also works.  But I want to dvi format
> output.
>
> Any ideas?
>
> Best regards,
>
> Jin
>
>
>

--
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz