groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] EPS from PIC?


From: Ted Harding
Subject: RE: [Groff] EPS from PIC?
Date: Thu, 30 Oct 2003 12:20:04 -0000 (GMT)

On 30-Oct-03 Christian Lindig wrote:
> 
> I'm using gpic(1) within LaTeX for figures; unfortunately the generated
> TeX code relies on DVI drivers to implement certain \specials. Those
> are not supported by all drivers and in particular not by pdflatex(1).
> As an alternative I'm looking for a way to generate an EPS file from a
> PIC diagram. It seems that groff can generate PS, but not EPS. I'm
> aware of ps2eps(1) and the like but would like to hear your suggestion.
> 
> -- Christian

Hi Christian,

'ps2eps' should do the job. (It calls 'ps2epsi' and then cuts out the
"preview" block). The only thing to watch is that the %%BoundingBox
it computes _exactly_ includes the marks on the page or, more
precisely, where it thinks they are. This should not be a problem
when these are simply points, lines, etc. made by PostScript drawing
commands, but there can be problems when there is also text, since
ps2eps uses font metric information (from ghostscript) to work out
where the fonts make a print on the page, and this could be slightly
wrong (depending on what fonts you use). Since the BoundingBox is
also a clip path, you might find that little bits are missing from
the extremities of some of the letters. It is also possible (though
I believe this is very unlikely in troff output) that certain
PostScript constructs can deceive ps2eps as to where they make
marks.

If this happens, and also if you want to achieve what is described
just below, then you could consider the following.

As well as dealing with the above problem (if it arises) you may want
to have several Figures all with the same BoundingBox even though
the dimensions of what is drawn on them differ somewhat (for instance
if you want them to be exactly arranged on a page in relation to
each other). 'ps2eps' will not do this, since it computes the
BoundingBoxes separately for each one, and these will differ.
I regularly use the following procedure in this case.

Run ps2eps on each one. Then look at the resulting .eps files,
and locate the line

  %%BoundingBox: llx lly urx ury

in each case, where llx, lly, urx, ury will be four numbers.
Write these down. Then choose a new set to be used for all,
where llx and lly do not exceed the min of all, and urx and ury
are not less than the max of all (and you may want to add a margin
in each case). Then edit the files, changing the %%BoundingBox: line
in each to use your new values.

If the above clipping problem arises, you will need to add a
sufficient margin (decreasing llx, lly and/or increasing urx, ury).
It can also help to open the EPS or PS files in 'gv' in X: the
'gv' window has a little box which shows the coordinates (in points)
of the mouse position, so you can decide "by eye" where you want
the BoundingBox to be. This is the ultimate fallback if you find
that ps2eps is not giving good results.

I hope this helps,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 30-Oct-03                                       Time: 12:20:03
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]