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

George N. White III gnwiii at gmail.com
Sat Aug 1 18:59:50 CEST 2009

On Fri, Jul 31, 2009 at 6:37 AM, Jin Huang<hj at cad.zju.edu.cn> wrote:
> Thank Zdenek and Robin :)
> According to the solution of this problem, the possible reason is that the
> latex in MikTeX as some default graphics rules which associates .bb file
> with bitmaps, but the latex in TexLive (texlive2008-20080822) not.

First, thanks for providing a good report with the minimal example.

For the record, "texdoc graphics" gives the documentation
for \includegraphics, which gives the information about how to
use .bb files and external commands to change formats.

Note that running commands from a tex document requires that
(restricted) \write18 be enabled.  This may not always be acceptable
due to the potential for some malicious .tex document running a nasty

It is not so easy to determine which formats beyond EPS are
supported directly by dvips.  The sources for dvipsk include emspecial.c,
which says:

/* em:graph routines */

/* The graphics routines currently decode 3 types of IBM-PC based graphics   */
/* files: .pcx, .bmp, .msp. The information on the formats has occasionally  */
/* been sketchy, and subject to interpretation. I have attempted to implement*/
/* these routines to correctly decode the graphics file types mentioned.     */
/* The compressed .bmp file type has not been tested fully due to a lack of  */
/* test files.                                                               */

With TeX Live latex+dvips you can use:

\DeclareGraphicsRule{.bmp}{bmp}{.bb}{}%      BMP


> Your comments give me much knowledge about tex, and thank you again!
> Best regards,
> Jin
> Robin Fairbairns written:
>> Zdenek Wagner <zdenek.wagner at gmail.com> wrote:
>>> 2009/7/31 Jin Huang <hj at cad.zju.edu.cn>:
>>>> 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
>>> package that gets somehow some information about your image and puts
>>> \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.
>> \exists a package that may be compiled into dvips to have it include
>> bitmaps, using an appropriate \special.  this package isn't present in
>> tex live, but obviously is in miktex (i _think_ i knew that).
>> thus, if jin huang wants to continue using bitmaps in his dvips output,
>> he needs either to revert to miktex, or to use one of the bitmap->eps
>> packages that exist (i don't recall which are available in tex live, if
>> any).
>> robin

George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

More information about the tex-live mailing list