🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #1238

Troff/Postscript Macro

#1238
From: Richard J. Auletta
Date: Sun, 19 Nov 1989 18:41
23 lines
1260 bytes
I have recently begun inserting more EPS files in to my troff documents
and was always quite frustrated as to where the "image" would
show up on the page. In particular I refer to idraw that appears
to set the coordinates at the lower-left of an 8.5X11 sheet so
that when the origin was translated to the present troff position
the image would be offset by its location in the idraw image.
Is this usual for EPS?

This macro takes the bounding box information and calculates
the proper space and offset for the image to be centered on
the page. Any suggestions/improvements?

--R J Auletta
  rauletta@gmuvax2.gmu.edu

.\" This macro centers an EPS file based on the bounding box information.
.\" Usage: .BB file Bounding_Box  Example: .BB test.eps 143 413 469 613
.\" Assumes the usage of Elan's macro package.
.\"
.de BB
.cS \\$1 \\$4p-\\$2p \\$5p-\\$3p ((\n(.l-(\\$4p-\\$2p)/2)-\\$2p)u \\$3p
..
Technical Details
Message-ID: <588@gmuvax2.gmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!pyrdc!gmu90x!gmuvax2!rauletta

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!pyrdc!gmu90x!gmuvax2!rauletta
From: rauletta@gmuvax2.gmu.edu (Richard J. Auletta)
Newsgroups: comp.text
Subject: Troff/Postscript Macro
Keywords: Troff EPS Centering macros eroff
Message-ID: <588@gmuvax2.gmu.edu>
Date: 19 Nov 89 18:41:19 GMT
Organization: George Mason University, Fairfax Va.
Lines: 23