🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #5326

Re: including postscript files in troff files

#5326
From: Chris Lewis
Date: Thu, 11 Apr 1991 17:20
71 lines
4565 bytes
In article <1595@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
>In article <5353@ns-mx.uiowa.edu> papalacharla@icaen.uiowa.edu (Paparao Palacharla) writes:
><Does anyone know how to include postscript files in troff files? If so
><how and where can I get the software.

>You don't say which troff you are using.  If it is a troff text processor that
>provides output for the C/A/T phototypesetter, then the answer is you can't.

You lie beagle breath! ;-) ;-)  Well, you can't if you're driving a C/A/T
phototypesetter, which wouldn't make any sense because it ain't postscript.
In order to use that old version of troff, you need a CAT to <something>
converter (postscript in this case).  Such as psroff, thack or pscat (from
Transcript).

>Not easily anyway.  The old troff produces very specialized output that can't
>contain any kind of special code that can be sent to the post processor that
>converts C/A/T output to PostScript.

Psroff (1.0 thru 3.0) can do this with CAT troff when driving Postscript.
It even works with psfig in psroff 3.0.  I don't think any of the other CAT troff
to (anything) converters can do this - though you imply that pscat might be
able to.  (psroff 3.0 does this by faking \X'').  

>But, if you are using a post-processor, like the pscat program from the Adobe
>TranScript package, you can put a special keyword into the text.  You can then
>find that keyword in the PostScript output and manually edit in the PostScript.
>The keyword is just some normal text that will never be in the document, some
>unique word in caps will do.  Normal 10pt text is preferred, since that will
>keep if from being kerned.  The complete PostScript line that contains the
>keyword will be replaced with your PostScript data.  You must surround the
>included text with the following:

This is a useful approach if you have a "dumb" filter.  The reason you want it
at 10 point is not because of kerning, but is because you want to have the
pointsize at an integral multiple of the width table "unitwidth" parameter.
Otherwise, ditroff's integer width calculations may have a off-by-1 error,
and some optimizers (such as the one in psroff) will break the word into
more than one hunk.  Other things that can go wrong is that the token might
get hyphenated, and it requires that you understand the Postscript that
the driver emits so that you can figger out how to insert the code.

Many ditroff-to-<something> converters have support for \X'f...' and
\X'p...' (or similar).  Where these are converted into file includes and
raw postscript passthru.  This is what psfig uses, and psroff supports
it, along with later versions of psdit (which is what comes in Transcript
I think).  Versions of tpscript can support this too.  There are other
conventions for this, so you may have to consult your manuals.

The best solution is to use psfig.  Psfig works with EPS (you really
only need a BoundingBox comment, and that's easy if you are writing
the postscript yourself) and knows how to scale and place the item according to
what you want, and takes pains to ensure that the inclusion doesn't bugger up
the postscript and tells troff how big a space to leave for it.

Using your method, or the other \! approach, or using \X directly requires
you to do a lot more about allocating space in troff, scaling/placing the
object, and making sure you don't blow up the "imaging model" that the
postscript driver is trying to use.  (Eg: scales/rotates/translates buggering
up subsequent troff output).

>To make all of this easier, get the groff text handling package.  It has
>PostScript inclusion built in.

Psroff 3.0 has it built in for both CAT troff and ditroff, and is a bit easier to
get into a machine than groff.  It also has a lot of other interesting
"side" mechanisms.  Also does a pretty good job with Laserjets.
-- 
Chris Lewis, Phone: (613) 832-0541, Internet: clewis@ferret.ocunix.on.ca
UUCP: uunet!mitel!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!
Technical Details
Message-ID: <1383@ecicrl.ocunix.on.ca>
Path: arc1-ca.pugleaf.net!utzoo!telly!eci386!ecicrl!clewis
References: <5353@ns-mx.uiowa.edu> <1595@vidiot.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!eci386!ecicrl!clewis
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Newsgroups: comp.lang.postscript
Subject: Re: including postscript files in troff files
Message-ID: <1383@ecicrl.ocunix.on.ca>
Date: 11 Apr 91 17:20:17 GMT
References: <5353@ns-mx.uiowa.edu> <1595@vidiot.UUCP>
Organization: Elegant Communications Inc., Ottawa, Canada
Lines: 71