On May 13, 3:03 am, Marc van Dongen <
don...@cs.ucc.ie> wrote:
> On Sunday, May 13, 2012 12:45:57 PM UTC+1, Ryo wrote:
[. . .]
> > I'm puzzled why tools like ps2eps and ps2epsi cannot compute the
> > bounding box of a latex page.
[ . . .]
> > I thought ps2epsi and friends render the page on ghostview at a high
> > resolution and determine the bounding box by looking at the pixels.
> > As far as I can see on the screen, there is no object other than the
> > letters in the PostScript output dvips generates. What is ps2epsi
> > seeing?
[. . .]
> It's probably because latex sets the bounding
> box to the bounding box of the page dimension,
> not what's in the page.
You are right! Thanks for correcting me.
It turns out that the problem is the BoundingBox setting in the
PostScript file generated by dvips. The boundingbox-calculating tools
I use were simply honoring the original boundingbox. Ugh.
I've found that ps2eps (
http://tm.uka.de/~bless/ps2eps) has an option
to ignore the original boundingbox (--ignoreBB).
However, the PostScript file from dvips still has the setting "%
%DocumentPaperSizes: a4", which still confuses the PostScript viewer I
use. So, having identified the problems, I've decided to filter the
offending lines out using "sed":
sed '/^%%BoundingBox:\|^%%DocumentPaperSizes:/d'
myfile.ps >
myfile2.ps
ps2eps
myfile2.ps
Cheers,
Ryo