[texhax] Tight boundingbox and a colour background

Heiko Oberdiek heiko.oberdiek at googlemail.com
Thu Jan 13 13:11:22 CET 2011

On Thu, Jan 13, 2011 at 02:24:07AM -0800, Mike B. wrote:

> I have a latex document with text over a colour (non-white) background
> (say gray). I'm trying to obtain an EPS file whose bounding box (BB)
> encloses the text area only.
> However, using ps2eps doesn't produce a smaller BB  since the script
> apparently seeks a whitespace but here the background is non-white.
> Would appreciate suggestions how to crack this. I'm looking for a way to
> automate the process as much as possible and not having to manually
> examine each PS file and extract the BB.

You can process the file twice, first without coloured background
for calculation of the bounding box, then with coloured background
and using the bounding box of the previous run.

Yours sincerely
  Heiko Oberdiek

More information about the texhax mailing list