[comp.lang.postscript] How to include PostScript pictures in troff?

brouwer@shapetc.UUCP (Gerrit Brouwer ) (11/02/88)

I am using UNIX troff (-ms) and the Adobe Transcript package  for
producing PostScript output files for a SUN LaserWriter (== Apple
LaserWriter).  Are there any pre-WYSIWYG wizards out there  know-
ing  a  way  to  include  PostScript pictures (e.g. produced with
Adobe Illustrator) in the text?

By the way, I use the following command, which produces the  text
nicely centered on the LaserWriter output page; why is the change
of the vertical translate needed?

tbl file.r \
    | troff -t -ms \
    | pscat \
    | sed 's/exch def 0 792 translate/exch def 0 842 translate/' \
    | lpr -PLaserWriter

==============================================================================
Gerrit Brouwer          USENET: brouwer@shapetc
Xelion b.v.             UUCP  : ...!mcvax!shapetc!brouwer
P.O. Box 88             PHONE : +31 15 62 21 21
2600 AB  Delft          
The Netherlands
==============================================================================

sbb@esquire.UUCP (Stephen B. Baumgarten) (11/04/88)

In article <175@shapetc.UUCP> brouwer@shapetc.UUCP (Gerrit Brouwer ) writes:
>I am using UNIX troff (-ms) and the Adobe Transcript package  for
>producing PostScript output files for a SUN LaserWriter (== Apple
>LaserWriter).  Are there any pre-WYSIWYG wizards out there  know-
>ing  a  way  to  include  PostScript pictures (e.g. produced with
>Adobe Illustrator) in the text?

There's a macro package called 'psfig' (available for both troff and
TeX) that allows you to include encapsulated PostScript figures (or
text, or whatever) in your source.  The EPS could come from
Illustrator, or from any program that generates EPS files (or even
plain old PostScript files, as long as you're willing to add the
bounding box information yourself).

Basically, it relies on the information in the file's "BoundingBox:"
line to determine the amount of space to reserve, etc.

Works quite well, and it's available in all the usual archive locations.

-- 
   Steve Baumgarten             | "New York... when civilization falls apart,
   Davis Polk & Wardwell        |  remember, we were way ahead of you."
   cmcl2!esquire!sbb            | 
   esquire!sbb@cmcl2.nyu.edu    |                           - David Letterman

harv@ksuvax1.cis.ksu.edu (Harvard Townsend) (11/05/88)

In article <175@shapetc.UUCP> brouwer@shapetc.UUCP (Gerrit Brouwer ) writes:
>I am using UNIX troff (-ms) and the Adobe Transcript package  for
>producing PostScript output files for a SUN LaserWriter (== Apple
>LaserWriter).  Are there any pre-WYSIWYG wizards out there  know-
>ing  a  way  to  include  PostScript pictures (e.g. produced with
>Adobe Illustrator) in the text?
>

"Psfig", available from comp.sources.unix archives, is designed to do this,
but it works with device-independent troff (ditroff), not "old troff"
(otroff). The latter produces code for the C/A/T phototypesetter.  
Since you say you are printing to a Sun Laserwriter, I suspect you have 
otroff on a Sun workstation instead of ditroff unless you spent
some extra money.  One limitation of psfig is that it works best with
Encapsulated Postscript files (EPSF).  In general, the Mac tools don't
produce such files, so you'll have to do some hacking to the Postscript
files to get rid of erasing pages and initialization of graphics states,
etc.  I have gotten psfig to work with Documenter's Workbench 2.0 on a 
Harris HCX-9 with the public domain "tpscript" ditroff-to-postscript 
translator.  I am quite pleased with it.
-- 
Harvard Townsend, Systems Manager
CIS Dept., Kansas State University
Internet:	harv@harris.cis.ksu.edu      BITNET: harv@ksuvax1.bitnet
UUCP:   {pyramid,ucsd}!ncr-sd!ncrwic!ksuvax1!harv