[comp.lang.postscript] Troff macro to include postscript.

mart@euteal.UUCP (Mart van Stiphout) (02/17/89)

In reply to recent questions on how to include postscript
in troff, here is a troff macro that does the job.
---------- cut here ----------------------------------
.\"******** include postscript .pS <file> <height> <box>
.\"******** author: Reinier v.d. Born
.de pS
.ne 1v+\\$2
.rs
.sp 1v+\\$2
.nr pS 0-\\$2
.pP "\\$1" \\n(pS \\$3
..
.de pP
.ie "\\n(.z"" \{\
\\!%
\\!save /psv exch def
\\!\\n(.o  \\n(nl moveto
\\!\\n(.l  0      rlineto
\\!0       \\$2   rlineto
\\!-\\n(.l 0      rlineto closepath clip
\\!\\n(.o  \\n(nl moveto
\\!currentpoint translate resolution 72 div dup neg scale 0 0 moveto 
\\!500 dict begin (
.cf \\$1
.if \\n(.$-2 \{\
\\!0 setgray initmatrix 1 setlinewidth clippath stroke 
.\}
\\!end
\\!PE
\\!.
.\}
.el \{\
\\!.pP "\\$1" \\$2 \\$3
.\}
..
---------- cut here ----------------------------------


Mart van Stiphout
Eindhoven University of Technology
Design Automation Section
Dept. of Electrical Engineering
P.O.Box 513
5600 MB Eindhoven
The Netherlands
Email: mart@euteal.UUCp