SLUG mail archive
[Prev][Next][Index][Thread]
Setting Bounding Box in lispm postscript
Date: Mon, 5 Mar 90 18:04:57 EDT
From: "Bruce R. Miller" <MILLER@vax.cam.nist.gov>
Date: Sat, 3 Mar 90 00:33 EST
From: Chris Lindblad <cjl@ai.mit.edu>
[...]
This is all correct, but here at the AI lab Jerry Roylance has come up with a
tex macro that will reads the bounding box information in the the header of a
postscript file, and then automatically computes up with the right offsets for
the psfile special so that the lower left of the bounding box appears at the
(tex) point. It also makes a (tex) box the exact size of the bounding box, so
the macro semantically is the same as setting a character of the size of the
bounding box. See the comments in this file for more information:
% -*- Mode: TeX -*-
% Merging PostScript Illustrations
[...]
% The header looks like
%
% %!PS-Adobe-1.0
% %%Creator: Illustrate Version 11.0
% %%CreationDate: 6/23/87 17:35:01
% %%Pages: 1
% %%BoundingBox: 466.12912 718.63934 612.0283 792.0283
% %%EndComments
%
% *** Should complain if #2 is (atend)
[...]
Very nice macro!
The only thing I could want would be a sort of
\psadobe[desired_width][desired_height]{psfile}
which would set up the scaling the image up to the desired dimensions.
(complain, complain) Shouldn't be too hard given the tools Jerry has
given, though...
The psfig macro package by Trevor Darrell does this. It was originally
meant to be run using the dvips converter, so if you can get this
package with the dvips converter, you should be home free. I happened
to find that the psfig package was sitting around in the source
hierarchy of our Unix system, so it may be sitting around in yours as
well (assuming you have one; you need one to run dvi2ps for psadobe as
well unless you're writing your own on the LispM).
However, we didn't have dvips, and all our printer spooling and
printer/font matching tools were written using dvi2ps instead of dvips,
so I adapted the macro package to interface to dvi2ps. If your system
has dvips, you shouldn't need this. If, however, your Unix system is
running only dvi2ps instead, you may want this.
Here's a message I sent out to our people; it describes where you might
find the documentation and sources in your Unix source hierarchy. (I
moved my modified version to our working tex macro directories for
general use. The directory hierarchy on our system has changed, so this
is only meant as a hint as to where to find things on your system.)
------------------------------------------------------------------------
\psfig is now available for including postscript figures in your
TeX/LateX files. It has the advantage over \psadobe that it can scale
figures to a specified size, such as the current \textwidth in Latex.
(I find this especially useful for screen dumps created using the LispM
facility ScreenBox->PostScript).
To define \psfig,
\input psfig
at the top of your file should work (unless someone deletes the file
/wheaties/usr/lib/tex/localinputs/psfig.tex, in which case ask me for a
copy)
Usage: \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=,
rheight=, rwidth=, clip=}
Examples:
Figure at natural size: \psfig{file=mypic.ps}
Figure scaled to fit height: \psfig{file=mypic.ps,height=2 in}
Figure scaled to fit width: \psfig{file=mypic.ps,width=\textwidth}
For more info and explanation of other options, see
wh:/src1/tex/Distrib2.0/tex82-2.0/TeXcontrib/psfigtex/doc/figdoc.tex
.dvi.dvi2ps
To print this documentation out on daily-planet, on a sun do
cd /src1/tex/Distrib2.0/tex82-2.0/TeXcontrib/psfigtex/doc/
dvi2ps -a /usr/lib/tex/pxlfonts.xerox figdoc.dvi.dvi2ps | lpr -v -P daily-planet
Prolog files and arbitrary clipping are beyond the capabilities of
dvi2ps, but the other features are present.
------------------------------------------------------------------------
Thus, if you have dvips, it is better to use that.
Cheers,
CarlManning
Main Index |
Thread Index