John,

> I sent this a while ago but I think it got lost in the moderation
> process as I sent it before signing up to the list...
> 
> If using "latex mode" the final latex-rendered string can be
> considerably shorter than the space it takes up in the diagram. If the
> latex string extends beyond the drawn part of a diagram there can often
> be too much white space if the bounding box is created automatically.
> 
> Instead, I have set a manual bounding box
> (options->elements->border->bounding box) in order to constrain the EPS
> bounding box to the area I know that the diagram occupies. The manual
> bounding box does not seem to work quite as I expect it to.
> The manual bounding box works in either dimension where it is larger than the
> automatically calculated bounding box. If I make the manual bounding box
> smaller than the automatic one, the eps ends up with a larger bounding
> box including all the white space I am trying to get rid of.
> 
> I could edit the ps bounding box by hand, but then I have to go through
> and edit the co-ordinates of the tex file too, which is very time
> consuming.
> 
> I have had a brief grep through the source code to try to work out how
> the bounding boxes are calculated but am not entirely
> sure where the manual bounding box is handled. Is it feasible to force
> the use of the manual bounding box if it exists? After all, if I wanted
> the automatic bounding box in this case I wouldn't have put in the
> manual one! Alternatively, is the behaviour that I am experiencing by
> design or is it a bug?

I would call it a bug.  I think that the bounding box works correctly
for full page mode;  the problem seems to be that programs that use
EPS output (i.e., to put a figure into a larger document, like you're
doing) pick up the bounding box from the PostScript file header, which
is not related to the bounding box.

The code at files.c line 6292 makes a call to routine "checkforbbox"
that returns a bounding box record if a bounding box rectangle exists
on the page.  This sets the scale and position of everything on the
page, but it doesn't affect the "PageBoundingBox" dimensions (output
a few dozen lines below it).  It should be simple enough to pass the
framebox dimensions to the output for PageBoundingBox.

However, I'm not sure if that works or not.  Some programs honor the
PageBoundingBox, and some appear to go with whatever BoundingBox
dimensions are at the top of the file.  If so, then a separate call
to checkforbbox needs to be made at files.c:5066 and printed as the
output of BoundingBox at the top of the file.

If you can do one file by hand to figure out what works best, I can
code it into the source.
                                                ---Tim

+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim)   | email: [email protected]    |
| Open Circuit Design, Inc.      | web:   http://opencircuitdesign.com |
| 22815 Timber Creek Lane        | phone: (301) 528-5030               |
| Clarksburg, MD 20871-4001      | cell:  (240) 401-0616               |
+--------------------------------+-------------------------------------+
_______________________________________________
Xcircuit-dev mailing list
[email protected]
http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev

Reply via email to