[latexrefman] bitmap file bounding box through PS style cookie

Karl Berry karl at freefriends.org
Sun Oct 31 23:49:23 CET 2021


        Thus you may specify the size of bitmap files in a file with a
        PostScript style @code{%%BoundingBox} line if no other format is
        available.

    > I must admit that I cannot understand this. Do it mean that you
    > convert the bitmap file to a postscript file with, say, imagemagick,
    > and then you can edit manually the %BoundingBox line. 
    > anything-else meant ?

No, that's not what's meant. I didn't write this, but as I understand it
the idea (not stated, and not worth going into detail about, seems to
me) is to suppose there is some unknown image format, say, a ".foo"
file. The (La)TeX drivers know nothing about the foo format. But you can
put a line like
%%BoundingBox: 1 2 3 4
at the top of your x.foo image file, and the drivers will find it.

That is, the LaTeX graphics package falls back to EPS parsing as a
default, and the only thing it cares about is finding a %%BoundingBox
line. So the rest of the file doesn't actually have to be .eps.

I haven't tested any of this. Just my understanding.

    Is the kind of trick documented here desirable, futureproof,
    portable, etc… ?

Certainly. It's just a line of text. -k


More information about the latexrefman mailing list.