Article View: comp.lang.postscript
Article #5425Re: including postscript files in troff files
From: Stefan Stapelberg
Date: Sat, 20 Apr 1991 13:36
Date: Sat, 20 Apr 1991 13:36
51 lines
2980 bytes
2980 bytes
In article <1412@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
|Sounds like a psfig replacement. Have you looked at psfig? You'd probably
|get some good ideas from it. Need a beta tester?
No, unfortunately I don't know psfig. Thanks for your offer to test pspic.
[I have changed the name from 'tpic' to 'pspic' since there already exists
a program called tpic. Thanks to James Clark for pointing this out.]
I wrote:
|> ** This is not a very good idea, but so far I have not been able to
|> force troff to output a new position command if there is no text
|> immediately following the vertical/horizontal space instruction.
|> Any hints?
|Yes. Psfig does this:
| .tr \(ts
|Then, it use the \h and \v to set a current position and then emits
|\(ts, then follows with all of the \X stuff to do the postscript
|inclusion. Since \(ts has been aliased to "space", you'll get the
|positioning, but not the glyph itself. This works well with both
|CAT troff (via psroff's \X support) and ditroff.
In one of the first trial versions, I used a .sp instruction to set
a current position, emitting an unpaddable space ('\ ') on a line by
itself and finally spacing one line back. Since this trick always
caused a line break, I changed this to emit the x-pos/y-pos directly
in Postscript. Your solution is much better (it didn't came to my
mind to use \h and \v and to emit just one "faked" character).
|Psfig comes with a patch to ditroff to "sync" the X and Y coordinate
|when an \X is being emitted - an H and V ditroff code will be emitted.
Unfortunately I have no source code. Maybe I can convince my vendor to
install this patch (I am still using DWB 2.0 and it's very unlikely that
newer versions will become available for my system).
|Your sample doesn't make it clear that tpic can arbitrarily size the
|picture, nor is it clear it can find out how much space to reserve
|in troff if there's no bounding box.
If there is no bounding box, the width and height of the picture must be
specified to the .PI-macro (the traditional way :-). pspic can arbitrarily
size the picture by scaling it to fit in a given frame. In this case there
must exist a bounding box, the width (or height) must be specified, and the
option "zoom" has to be set for the picture.
Regards, Stefan
__
Stefan Stapelberg, <stefan@systemware.de>
Technical Details
Message-ID:
<1519@shiva.systemware.de>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!unidui!unido!mikros!shiva!stefanReferences:
<1378@ecicrl.ocunix.on.ca> <1472@shiva.systemware.de> <1412@ecicrl.ocunix.on.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!unidui!unido!mikros!shiva!stefan From: stefan@shiva.systemware.de (Stefan Stapelberg) Newsgroups: comp.lang.postscript Subject: Re: including postscript files in troff files Message-ID: <1519@shiva.systemware.de> Date: 20 Apr 91 13:36:23 GMT References: <1378@ecicrl.ocunix.on.ca> <1472@shiva.systemware.de> <1412@ecicrl.ocunix.on.ca> Reply-To: stefan@systemware.de (Stefan Stapelberg) Organization: MIKROS Systemware, Lohr/Germany Lines: 51