sources-request@mirror.UUCP (03/04/87)
Submitted by: trevor@grasp.cis.upenn.edu (Trevor Darrell) Mod.sources: Volume 8, Issue 96 Archive-name: psfig-tex/Part01 psfig/TeX -- include PostScript (and Macintosh) figures inside a TeX document. Psfig/TeX is a new macro package for TeX that facilitates the inclusion of arbitrary PostScript figures into TeX documents. Figures are automatically scaled and positioned on the page, and the proper amount of space is reserved. Custom characters may be created and used freely throughout a document. Since the Macintosh drawing applications produce PostScript, they can be used to create figures. \begin{sales pitch} The most appealing feature of psfig/tex is its clean user interface; whenever possible assumptions are made about where the figure should go and what size it should be, so the user need not explicitly specify anything but the name of the figure. Psfig/tex searces the file for it's bounding box comment to find its natural size if the size is not specified, or in order to scale it evenly (if the user only specifies a height or a width but not both). The figure is always placed at the current TeX pen position, and the PostScript enviornemnt is the "standard" (ie non-dvips) one. Of course, all default actions may be overridden in a reasonable way. Lots of options. \end{sales pitch} System Requirements: Right now dvips (from TextSet or ArborText or whatever they are calling themselves this week) is the only supported postprocessor. Porting to dvi2ps hasn't yet been done, but should not be difficult. **> Psfig/TeX is available via anonymous ftp at linc.cis.upenn.edu (10.4.0.96 and 128.91.2.8). <** (see below for uucp) The main shar files are pub/psfigtex.shar.[1-4] (110K); a full PostScript copy of the documentation is in pub/psfigtex.ps (~0.8MB); some expensive figures used in the documentation but not included in the shar file are in pub/figs/fancyimage.ps and pub/figs/psfig.ps.1 (about a half meg combined). If you don't have the expensive figures and run off a copy of the documentation, the figures will come out in draft mode (just a filename, no figure). Since these two figres are roughly 4 times as large as all the other figures, source, and text combined, I kept them separate. The full PostScript copy has the expensive figures. horror stories, comments, suggestions, sucess stories, and other assorted trivia can be sent to trevor@grasp.cis.upenn.edu or linc.cis.upenn.edu. UUCP: POsted in mod.sources, in three parts, and available through archive sites there. #! /bin/sh # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # If all goes well, you will see the message "End of archive 1 (of 3)." # Contents: man src doc README MANIFEST copyright doc/README # doc/advice doc/figdoc.tex doc/figs doc/figs/box.ps doc/figs/cm.ps # doc/figs/frogfill.mac doc/figs/lab.ps doc/figs/pretzel.ps # doc/figs/rosette.ps doc/figs/starlines.ps doc/figs/triangle.ps # man/README PATH=/bin:/usr/bin:/usr/ucb; export PATH if test ! -d 'man' ; then echo shar: creating directory "'man'" mkdir 'man' fi if test ! -d 'src' ; then echo shar: creating directory "'src'" mkdir 'src' fi if test ! -d 'doc' ; then echo shar: creating directory "'doc'" mkdir 'doc' fi echo shar: extracting "'README'" '(1955 characters)' if test -f 'README' ; then echo shar: will not over-write existing file "'README'" else sed 's/^X//' >README <<'@//E*O*F README//' Xwhat is it? X=========== Xpsfig/tex -- include PostScript (and Macintosh) figures inside a TeX document. X XFeatures: X simple, clean interface X psfig automatically positions the figure at the X current pen position X figures can be scaled easily X implemented as a TeX macro package; has been brought up under X unix and VMS. X X XFrom the abstract of the documentation (sans figures, of course): X================================================================= XPsfig/tex is a new macro package for TeX that facilitates the inclusion Xof arbitrary PostScript figures into TeX documents. Figures are automatically Xscaled and positioned on the page, and the proper amount of space is reserved. XCustom characters may be created and used freely throughout a document. Since Xthe Macintosh drawing applications produce PostScript, they can be used to Xcreate figures. X XSystem Requirements: X==================== XRight now only dvips (from TextSet or ArborText or whatever they are calling Xthemselves this week) is the only supported postprocessor. Porting Xto dvi2ps should be easy, trivial for a good subset of psfig's features. XI plan to tackle dvi2ps sometime in the future, but if anyone out there Xhas a good knowledge of what the PostScript environment under dvi2ps looks Xlike and a spare day, I'll be glad to show what has to be changed. X X XRoadmap: X======== Xdoc/ : X contains the tex source to the documentation Xman/ : X contains a man page (and a cleartext copy for non unix types) Xsrc/ : X tex and postscript source for psfig/tex X X Xquestions, comments, and complaints to trevor@grasp.cis.upenn.edu X Xdisclaimer: X=========== XI have an interest in keeping this thing working and I'll try to clean Xup any bugs, but there are no guarantees, and I am not interested in spending Xtime getting psfig to run under foreign OS's. X XFeel free to adapt psfig to any particular application; however please Xretain the authorship notices, and send me a copy of any neat improvements. X @//E*O*F README// if test 1955 -ne "`wc -c <'README'`"; then echo shar: error transmitting "'README'" '(should have been 1955 characters)' fi fi # end of overwriting check echo shar: extracting "'MANIFEST'" '(945 characters)' if test -f 'MANIFEST' ; then echo shar: will not over-write existing file "'MANIFEST'" else sed 's/^X//' >MANIFEST <<'@//E*O*F MANIFEST//' X File Name Kit # Description X----------------------------------------------------------- X MANIFEST 1 X README 1 X copyright 1 X doc 1 X doc/README 1 X doc/advice 1 X doc/figdoc.tex 1 X doc/figs 1 X doc/figs/box.ps 1 X doc/figs/cm.ps 1 X doc/figs/frogfill.mac 1 X doc/figs/lab.ps 1 X doc/figs/mac.pro 2 X doc/figs/pathtext.ps 2 X doc/figs/piechart.ps 2 X doc/figs/pretzel.ps 1 X doc/figs/rosette.ps 1 X doc/figs/starlines.ps 1 X doc/figs/triangle.ps 1 X doc/figs/trianglev.ps 2 X doc/figs/zip.ps 2 X man 1 X man/README 1 X man/psfigtex.l 2 X man/psfigtex.out 2 X src 1 X src/README 2 X src/figtex.pro 2 X src/psfig.tex 3 @//E*O*F MANIFEST// if test 945 -ne "`wc -c <'MANIFEST'`"; then echo shar: error transmitting "'MANIFEST'" '(should have been 945 characters)' fi fi # end of overwriting check echo shar: extracting "'copyright'" '(388 characters)' if test -f 'copyright' ; then echo shar: will not over-write existing file "'copyright'" else sed 's/^X//' >copyright <<'@//E*O*F copyright//' XAll software, documentation, and related files in this distribution of Xpsfig/tex are Copyright (c) 1987 Trevor J. Darrell X XPermission is granted for use and non-profit distribution of psfig/tex Xproviding that this notice be clearly maintained, but the right to Xdistribute any portion of psfig/tex for profit or as part of any commercial Xproduct is specifically reserved for the author. X @//E*O*F copyright// if test 388 -ne "`wc -c <'copyright'`"; then echo shar: error transmitting "'copyright'" '(should have been 388 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/README'" '(471 characters)' if test -f 'doc/README' ; then echo shar: will not over-write existing file "'doc/README'" else sed 's/^X//' >doc/README <<'@//E*O*F doc/README//' X XNote that two quite expensive figures (they are alone larger than all the Xrest of this package) have been placed in draft mode to make this smaller for Xuucp transport. X XTo get the full document, ftp the files figs/fancyimage.ps and figs/psfig.ps.1 Xfrom linc.cis.upenn.edu (anonymous ftp, pub directory) and place them in the Xdoc/figs directory of psfigtex. X XThen delete the line that says X\psdraft %% delete me for full copy of paper Xfrom figdoc.tex X XThere you have it! @//E*O*F doc/README// if test 471 -ne "`wc -c <'doc/README'`"; then echo shar: error transmitting "'doc/README'" '(should have been 471 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/advice'" '(2380 characters)' if test -f 'doc/advice' ; then echo shar: will not over-write existing file "'doc/advice'" else sed 's/^X//' >doc/advice <<'@//E*O*F doc/advice//' XAdvice on debugging psfig/tex problems: X-------------------------------------- X XIn the ideal world, document debugging tools would be paid the same attention Xas program debugging tools. In the real world, this is not the case, yet with Xpackages of ever increasing sophistication such as TeX debugging a docuement Xis becoming no less problematic that debugging 'C'. Having experience in Xsuch matters I would say debugging 'C' (or most other programming enviorments) Xis much more conducive to retaining one's sanity. X XAnyway, with proper care and feeding psfig will grow up to be a well used Xtool in your bag of tricks. It can be eased through the problem years with the Xfollowing hints on common problems: X----- X Xif a document crashes (stops printing and flushes the job) on or about Xa figure, the figure probably has some illegal postscript in it, or Xuses macintosh calls and the prolog was not properly loaded. Finding Xthe offending command by reading the error message from the printer or Xusing an error trapping utility is critical. Either use the error Xhandler distributed to the laser-lovers board some time ago, or Xmoniter the errors coming back from the printer. If the offending Xcommand is "psu" you can bet your mac prolog is missing. Check for Xproblems with page reversing and psglobal (they dont mix well) X Xif a document stops printing at some random point (but may continue to Xaccept data) the printer memory may have been exceeded (VMErrors). XThis usually becomes a factor on papers exceeding twenty pages (using Xour installation). Use the printer memorysize option to dvips to Xremedy this; the optiumum value is not yet known -- I use 60000 for Xour laserwriter when I run into trouble, and it usually gets me out of Xthe woods. Some people have had rather severe problems printing the Xdocumentation and have had to limit memory to <20000. X Xif a figure consistantly comes out at the same place on the page despite Xpsfig's valiant attemps to move it about, it is probably using the clippath Xto decide where it should print. Use the clip option (see the manual) X Xif a figure is comming out out of position, it may be that the bounding box is Xin error, test the bounding box by printing the figure alone and using a ruler X Xand last, but not least, Xa lone psfig in a centering enviornment will be ignored by LaTeX; try Xpreceeding it by a hard space or some similar hack. @//E*O*F doc/advice// if test 2380 -ne "`wc -c <'doc/advice'`"; then echo shar: error transmitting "'doc/advice'" '(should have been 2380 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figdoc.tex'" '(22919 characters)' if test -f 'doc/figdoc.tex' ; then echo shar: will not over-write existing file "'doc/figdoc.tex'" else sed 's/^X//' >doc/figdoc.tex <<'@//E*O*F doc/figdoc.tex//' X\documentstyle{article} X\begin{document} X\input{../src/psfig} X\addtolength{\parskip}{7pt} X% X% PostScript Logo X\def\Ps{PostScript} X\title{Incorporating \Ps\ and Macintosh figures in \TeX\ } X\author{Trevor Darrell} X\date{January 9, 1987} X\maketitle X% X\begin{abstract} Xpsfig/\TeX\ is a new macro package for \TeX\ that facilitates the Xinclusion of arbitrary \Ps\ figures into \TeX\ documents. XFigures are automatically scaled and positioned Xon the page, and the proper amount of space is reserved. XFor example: X\par X\hbox{ X\hspace{.3in} X\vbox{\psfig{figure=figs/zip.ps}\vspace{.5in}} X\psfig{figure=figs/piechart.ps,height=1.5in} X\vbox{\psfig{figure=figs/starlines.ps}\vspace{.6in}} X} X\par XCustom characters such as X`\psfig{figure=figs/pretzel.ps,height=8pt}' and X`\psfig{figure=figs/cm.ps,height=8pt}' Xmay be created and used freely throughout a document. Since the XMacintosh drawing applications produce \Ps, they can be used to create Xfigures. X\end{abstract} X% X\section{Introduction} XThe \TeX\ typesetting system is a powerful tool in the preparation of the Xwritten word, yet when the time comes to add figures or pictures to a document, Xone traditionally had to resort to tedious manual paste-up. XWith the advent of the \Ps\ page description language, Xwhich allows the `nesting' of environments and is rapidly becoming Xa {\it de facto} standard, it is now possible to merge graphics Xdirectly into a document. psfig provides the facility for the Xnested inclusion of a \Ps\ figure in a \TeX\ document. X% X\par X\section{Including a figure} XTo include a \Ps\ figure with psfig, simply load the psfig macros at the Xbeginning of your document with X\par X{\tt\verb+\input{psfig}+} X\par Xthen invoke the macro X\par X{\tt\verb+\+psfig\{figure={\it input}\}} X\par Xwhere {\it input} is the name of a \Ps\ file. Xpsfig will automatically position the figure at the current place on the page, Xand reserve the proper amount of space in \TeX\ so that it doesn't conflict Xwith any other objects. X\par XFor example, if we have a file called `piechart.ps' which contains the X\Ps\ code to draw the chart in the abstract, and it was the first figure Xin our non-page reversed document, we would use the commands X\begin{quote} X{\tt\verb+\+input psfig } \\ X{\tt\verb+\+centerline\{\verb+\+psfig\{figure=piechart.ps\}\}} X\end{quote} XSince no mention of size was made in the above example, psfig draws the figure Xat its natural size (as if it was printed directly on Xa \Ps\ printer.) The pie's natural size is several inches across, which Xis a little large; the pie in the abstract was produced with: X\par X{\tt\verb+\+centerline\{\verb+\+psfig\{figure=piechart.ps,height=1.5in\}\}} X\par XThe {\tt height} option specifies how tall the figure should be on the Xpage. Since no {\tt width} was specified, the figure was scaled equally Xin both dimensions. XBy listing both a {\tt height} and a {\tt width}, figures can be scaled Xdisproportionatly, with interesting results. X\par XFor example: X\par X\centerline{\hbox{ X\psfig{figure=figs/rosette.ps,height=.8in,width=.15in} X\psfig{figure=figs/rosette.ps,height=.8in,width=.35in} X\psfig{figure=figs/rosette.ps,height=.8in} X\psfig{figure=figs/rosette.ps,height=.8in,width=1.2in} X\psfig{figure=figs/rosette.ps,height=.8in,width=1.5in} X}} X\par Xwas produced with: X\begin{quote} X\tt\verb+\+centerline\{\verb+\+hbox\{ \\ X\verb+\+psfig\{figure=rosette.ps,height=.8in,width=.15in\} \\ X\verb+\+psfig\{figure=rosette.ps,height=.8in,width=.35in\} \\ X\verb+\+psfig\{figure=rosette.ps,height=.8in\} \\ X\verb+\+psfig\{figure=rosette.ps,height=.8in,width=1.2in\} \\ X\verb+\+psfig\{figure=rosette.ps,height=.8in,width=1.5in\}\}\} X\end{quote} X\par X\subsection{Caveats} XFor psfig to find the natural size of a figure, the figure must have a Xproper bounding box comment; see section 5 below. Draft mode (also Xdetailed below) should be used liberally to speed throughput. XAlso, some versions Xof \LaTeX\ will fail to properly center a lone figure in a centering Xenvironment; Xa good work-around is to precede the figure with a hard space. On very large documents with many figures, the printer memory Xallocated to dvips may have to be limited. X Finally, the X\verb+\psfig+ macro will be confused by extra white space or newlines in its Xargument. X\par X\section{Generating PostScript} XBefore you can include a figure, however, you must create Xthe \Ps\ file that describes it. XThe most common methods for creating a \Ps\ figure are to Xuse either a drawing application such as MacDraw, an image-to-ps or Xtextronix-to-ps translator, or to Xdirectly code \Ps\ by hand. A brief \Ps\ tutorial is included as an Xappendix. X\begin{figure} X\centerline{\psfig{figure=figs/pathtext.ps,height=2in}} X\centerline{Figure 1. a \Ps\ figure} X\end{figure} X\par X\subsection{Macintosh files} XUsing a Macintosh (or any other system that supports mouse-based drawing Xutilities that use \Ps) is one of the easiest ways of creating Xa figure (figure 2a.) XMacDraw is the recommended tool, since Xit produces code that is independent of scaling (as opposed to MacPaint, Xwhich produces a bitmap of the figure.) XThere are several known methods of capturing a MacDraw/MacWrite figure Xin \Ps\ form and transferring to the \TeX\ host; most involve some Xmucking about with tricky control sequences, one is detailed in the appendix. X\par XMacDraw creates a output file in the form of `QuickDraw' calls, which are Xinterpreted as a set of \Ps\ procedures. These procedures are defined Xin what is called the `macintosh prolog', which must be prepended Xto any macintosh file Xto be sent to the printer. XThere is a {\tt prolog} option in the psfig macro to specify a file that Xshould be prepended to the figure. The name of the prolog is, of course, Xsite dependent; we have used `/usr/lib/ps/mac.pro'. XFor example, if you had a file `frog.mac' that contained the macintosh Xcode to draw kermit (figure 2b), he could be included with: X\begin{quote} X{\tt\verb+\+psfig\{figure=frog.mac,prolog=/usr/lib/ps/mac.pro\}\}} X\end{quote} X\begin{figure} X\centerline{ X\vbox{\vss\psfig{figure=figs/lab.ps,width=2.5in}\vss} X\hss\vbox{\vss\psfig{figure=figs/frogfill.mac,width=2in}\vss}} X\par X\centerline{Figure 2a \& 2b: Macintosh figures.} X\end{figure} XIf there are many such figures, it is probable that the repeated inclusion Xof the mac.pro file will cause a significant increase in file size and Xtransmission time. An alternative method is to load the mac.pro file Xonce globally, so that it will be available throughout the rest of the Xdocument. Use {\tt \verb+\psglobal{\usr\lib\ps\mac.pro}+} at the Xbeginning of your document Xto achieve this effect. For this to work properly, the \verb+\psglobal+ must Xbe before any Macintosh figures, and the final output must not be page Xreversed. X\footnote[1]{It is possible to use psglobal in Xpage reversed document; place it just before the last figure in Xyour document. This is living dangerously, and you do so at your own risk.} X\par X\subsection{Images (ph), plot, and other sources} XAny program that produces \Ps\ as output can be used for psfig figures. XFor instance, the {\it ph} program will convert a bitmap image Xto \Ps\ form and thus can be Xused to include an image in a document (figure 3.) X\par XThere are similar utilities that can convert files from unix plot(5) Xor Textronix 4014 format into \Ps. XThe Unix text processor {\it troff} produces \Ps, so one can slice a page Xout of a Troff document and include it in a \TeX\ paper (figure 4.) X\begin{figure} X\psdraft %% delete me for full copy of paper X\centerline{ X\vbox{\vss\psfig{figure=figs/fancyimage.ps,height=3in,width=2.25in,bbllx=72bp,bblly=72bp,bburx=540bp,bbury=540bp}\vss} X\hspace*{0.2in}\fbox{\psfig{figure=figs/psfig.ps.1,height=3in,width=2.25in,bbllx=1sp,bblly=1sp,bburx=8.5in,bbury=11in}} X} X\par X\centerline{Figure 3: A bitmap image.\hss Figure 4: Troff in \TeX} X\end{figure} XNote that the {\it troff} page was processed by Xthe {\it troff} counterpart to psfig, and itself contains two images and several X\Ps\ tricks. X\par X\section{Draft figures} XCertain \Ps\ figures (such as large bitmap images being transmitted at X9600 baud) can tie up a slower \Ps\ device such as an XApple LaserWriter for quite some time. XTo circumvent this, a figure Xmay be printed in draft mode, which will occupy the same space on the Xpage as far as X\TeX\ is concerened, but it will just print the name of the file from Xwhich the figure is derived, and will not actually include it. XThe macro {\tt \verb+\+psdraft} will switch into draft mode, and all Xsubsequent psfig macros will produce draft figures. The macro {\tt X\verb+\+psfull} will switch out of draft mode. X\section{Bounding boxes} XTo properly translate and scale a figure psfig must know its `natural' Xposition on the page; this information is present Xin what is called the {\it bounding box} of a \Ps\ program. The Xbounding box is a outer limit to the marks created by a program, Xand is specified as four coordinates of a rectangle: the lower-left $x$ coordinate X(bbllx), the lower-left $y$ coordinate (bblly), the upper-right X$x$ coordinate (bburx), and the upper-right $y$ coordinate (bbury). XAdobe has defined a convention whereby the bounding box of a program Xis contained in a `bounding box comment'. X\footnote[2]{See `Appendix J: \Ps\ File Structuring Conventions' in X{\it The \Ps\ Language Reference Manual}} XThis comment, which must be present in any file to be used as a psfig figure, Xis a line of the form X\begin{quote} X\tt \verb+%%+BoundingBox: \it bbllx bblly bburx bbury X\end{quote} XAll values are in \Ps\ points, relative to the {\it default} Xtransformation matrix. The only mandatory \Ps\ convention is Xthat the first line of the file should begin with the characters X`\verb+%+!' (a `\verb+%+' begins a comment in \Ps.) A good place for the Xbounding box comment is as the second line of the file. X\par XThere is a {\it bbfig} utility on systems to aid in calculating Xthe bounding box, refer to the {\it bbfig(l)} manual page for further information. X\section{Advanced topics} X\subsection{psfig internal structure} XIn including a figure, the {\tt \verb+\psfig+} macro performs the following Xoperations: XFirst, if bounding box information (see below) is omitted from the list Xof arguments, the Xfile containing the figure Xis searched and the information recovered from the bounding box Xcomment. Then, Xif both {\it height} and {\it width} are missing they are computed to Xbe the height and width of the bounding box. If only one is missing, Xit is set to be the appropriate value such that there is no distorted Xscaling. XIf {\it rheight} or {\it rwidth} (see below) is missing it is presumed to Xbe the same as the height and width. X\par X The {\tt\verb+\+psfig\{figure={\it input}\}} macro Xuses a vbox in \TeX\ to reserve the space. XThe actual inclusion of files is preformed with a X{\tt \verb+\+special} command to the {\it dvips} postprocessor. XPresently, {\it dvips} is the only supported post-processor, Xbut it shouldn't be to difficult to port psfig to Xa different postprocessor, presuming similar capabilities and/or Xaccess to source code. Xpsfig depends on certain \Ps\ function calls; these are downloaded Xwith the \verb+\psfiginit+ macro. Do not use page-reversing on your Xoutput if you are manually initializing psfig with \verb+\psfiginit+, or Xare using \verb+\psglobal+. XIt is possible to include these Xdefinitions into the standard dvips (or whatever) header file; this Xhas been done on our systems and users need not do a X\verb+\psfiginit+. X\subsection{Reserved size} X\psfig{figure=figs/box.ps,rheight=0bp,rwidth=0bp,height=1.25in,width=\textwidth} XThere are two sizes associated with each psfig figure: the size Xat which it is to be printed on the page Xand the size it reserves in \TeX. This latter size is appropriately Xtermed the {\it reserved size}, and is expressed as clauses of the form X``{\tt rheight={\it dimen}}'' Xand ``{\tt rwidth={\it dimen}}''. If ommited, the reserved size defaults Xto the real size. Some special effects need to be transparent Xto \TeX\ and thus have a zero reserved size, such as the grey Xbox enclosing Xthis paragraph. X\subsection{Clipping} XNormally a \Ps\ program can be expected to not mark the page Xoutside its bounding box. If this is not the case, or if you Xwant to use the bounding box to isolate part of a larger figure, Xthere is an option that sets the \Ps\ clip path so that Xno marks will show up outside the declared bounding box. Currently Xthis is invoked by adding a clause of the form ``{\tt clip=}''. XHere a slice has been taken out of the pie chart in the example by Xspecifying a smaller bounding box and adding the clip option. X\par X\centerline{\psfig{figure=figs/piechart.ps,height=2in,bbllx=306bp,bblly=396bp,bburx=486bp,bbury=546bp,clip=}} X\par XSome \Ps\ programs use the clipping path to position their output on Xthe page; if a figure is being drawn at its natural size and position Xdespite psfig commands to the contrary, it may need the clip option. X\par X\subsection{\Ps\ environment} XThe \Ps\ environment within psfig is fairly robust. All of the Xusual \Ps\ operators will operate as desired; in particular Xthe operators `showpage', `initgraphics', and `defaultmatrix' will Xall behave consistently inside a figure, except that `showpage' will Xonly do an `initgraphics' and will {\it not} print or erase the current Xpage. X\par XIt is very possible, however, for a \Ps\ program to bypass the psfig Xenvironment and disrupt a document. These cases are infrequent, X and a `work-around' solution can usually be found. X\par X\section{Acknowledgements} XNed Batchelder co-developed the original {\it troff} version of this Xprogram with the author, and was responsible for much of the overall design. XGreg Hager provided an initial \TeX\ implementation. XFigure 1 and the three broken out figures in Xthe abstract were taken from examples in {\it The PostScript Language XTutorial and Cookbook.} XThe image in figure 3 was designed by Kamran Manoochehri, rendered with X{\it CARICATURE}, by Cary Phillips. X\newpage X\appendix X\section*{Appendix A: \Ps\ Overview} XCoding \Ps\ by hand gives you the most control possible over the Xshape and appearance of the figure; for example, few conventional document Xpreparation packages could produce the graphic in figure X\Ps\ is a stack-oriented language, very similar to Forth and RPN in the way Xthat arguments are handled, yet it features strong typing and higher Xlevel control structures. It has an advanced imaging primatives, based on a X{\it stencil and paint} imaging model. Objects are rendered on the Xpage by applying {\it paint}, which can be any color or sampled image, Xthrough a {\it stencil}, a closed geometric path that limits where the Xpaint should go. For example, a line can be described as applying black paint Xthrough a long thin stencil. This generality is preserved throughout \Ps, Xincluding in its treatment of fonts, but that does not prevent \Ps\ Ximplementations from taking advantage of special cases for efficiency Xconsiderations. Rarely would an actual \Ps\ interpreter draw a line Xby creating a thin rectangle and performing a fill operation; Xwhat is important is that its Xbehavior can be perfectly characterised as if it had. X\par X\Ps\ has a full complement of data types, operators, and control structures. XIn general, arguments are pushed on an operand stack, then popped off and acted on by an operator Xor procedure. When \Ps\ encounters an object it can't execute immediately X(such as a number or a string), Xit is pushed onto the operand stack. Thus, to provide parameters to an Xoperator, simply list them before the operator name. Thus \Ps\ (like Xforth), is a prefix language. All expressions are thus unambiguous, and Xthe syntax is very efficient to interpret. X\par XFor instance, arithmetic is easy: X\begin{quote} X\tt 2 2 add X\end{quote} Xwould leave a `4' on the operand stack. Similarly, to add X$\frac{1+2}{2+3} + 13 * 9$, you would type X\begin{quote} X\tt 1 2 add 2 3 add div 13 9 mul add X\end{quote} X\par XIn addition to numbers and operators there are several different types Xof objects that \Ps\ supports. A string, for instance, is denoted by Xtext enclosed in parenthesis. An array of objects is denoted by Xbrackets, and a procedure by braces. XAn identifier that is not a number, string, or composite object Xis a {\it name} object. There are two types of name objects, {\it Xexecutable}, meaning the value or procedure associated with the object will Xbe evaluated immediately, and {\it literal}, which is not evaluated. XA literal name has a `/` prepended to it, Xand is pushed directly on the operand stack, while an executable name is Xlooked up on the {\it dictionary stack}, and its associated value placed Xon the operand stack. XA {\it dictionary} is a data Xstructure that associates {\it key} - {\it value} pairs. XAll operators, variables, and procedures are referenced through the Xdictionary stack, which essentially establishes the hierarchical naming Xenvironment in \Ps. X\par XThere are always at least two entries on the dictionary stack: the system dictionary and Xthe user dictionary. The system dictionary contains all the bindings for the Xbuilt-in operators, while the user dictionary holds user variables and Xprocedures. A \Ps\ program is free to modify the user dictionary (and to Xadd new entries on the stack), but can not write to the system dictionary. X\par XAssigment is with the {\tt def} operator, which takes a literal name and value Xand stores it in the topmost dictionary; to initialize $\pi$ you Xcould say X\begin{quote} X\tt /pi 3.14 def X\end{quote} XAfter this {\tt def}, typing the executable name {\tt pi} Xwill cause \Ps\ to look up that name in the dictionary stack and place 3.14 on the operand stack. X\footnote[3]{The value need not be numeric; it may be a string, array, or procedure, among other things.} XFor instance, X\begin{quote} X\tt pi r 2 exp mul X\end{quote} Xwould evaluate $\pi r^2$ (of course, if {\tt r} had not been Xdefined, an error would have been generated). X\par X\begin{figure} X\par X\begin{picture}(340,220) X\put(0,120){\tt newpath } X\put(0,110){\tt 50 50 moveto} X\put(0,100){\tt 150 50 lineto} X\put(0,90){\tt 100 150 lineto} X\put(0,80){\tt closepath stroke} X\put(0,70){\tt showpage} X\put(170,0){\fbox{\psfig{figure=figs/triangle.ps,width=162pt,bbllx=0sp,bblly=0sp,bburx=8.5in,bbury=11in}}} X\put(100,100){\vector(1,0){50}} X\end{picture} X\par X\centerline{Figure 5: a sample \Ps\ program.} X\end{figure} XThe \Ps\ language has a rich collection of operators, including Xthe usual stack operators (pop, dup, exch, ...), arithmetic operators (add, mul, Xsin, ...), and control operators (if, loop, for ...), as well as Xmore advanced operators Xfor manipulating dictionaries, arrays, strings, and files. X\par XWhile \Ps\ has all the capabilities of a general purpose language, it Xis first and foremost a page description language, Xand as such has a whole range of operators that manipulate Xthe graphics state and place marks on the page. XAll values given to graphic primitives in \Ps\ are transformed through the X{\it current transformation matrix (CTM)} before any marks are made on the Xpage. Thus the CTM establishes the scale and orientation of the coordinate Xsystem in which a program will run. XThe default \Ps\ CTM produces a coordinate system in \Ps\ points (\Ps\ points Xare the same as `big points' (bp) in \TeX - 72 to the inch) Xwith the origin in the lower left hand corner of the page. XThe CTM can be scaled, rotated, or translated dynamically Xby a \Ps\ program. X\par XAn important object in the graphics environment is the {\it current Xpath}, an internal \Ps\ data structure that keeps Xtrack of geometric shapes. The current path is composed of an arbitrary number Xof connected or disjoint line segments, curves, and Bezier cubics. X\par XThe {\tt newpath} operator clears the current path, and Xthe {\tt moveto} operator will move the current point to an arbitrary location. X{\tt Moveto} takes two arguments, an x and y location on the page, Xso to move to (307,397) you would say {\tt 307 397 moveto}. XExactly where (307,397) is on the page depends on the CTM; with the Xdefault matrix, it is roughly at the center of the page. X\par XFrom the current point, an {\tt x y lineto} will add a line Xsegment to {\it (x,y)} on the current path, or Xa {\tt closepath} will add a segment back to the first Xpoint in the path. XTo create arcs and circles, a {\tt x y r ang1 ang2 arc} will Xadd a counterclockwise segment from {\it ang1} to {\it ang2} of a circle of Xradius {\it r} whose center is at {\it (x,y)}. XNote that none of these commands actually Xmark the page; they just build up the path structure. XTwo operators which will mark the page according to the Xcurrent path are: X{\tt stroke}, which will draw a line along the current path, and X{\tt fill}, which will paint the region enclosed by the current path. XFigure one depicts a sample \Ps\ program and its result. X\par XText can be equally as simple; first, you must set up the current font. X\begin{quote} X\tt /Times-Roman findfont 10 scalefont setfont X\end{quote} Xwould set the current font to be ten point roman. XA string can be printed at the current point using the {\tt show} operator. XIn \Ps\, strings are delimited by parenthesis. X\par XWhen a \Ps\ program has completed putting all useful marks onto a page, Xit should execute the X{\tt showpage} operator, which causes the printer to print and eject the current page. X\par XThus, to label the vertices in our triangle, we could modify our Xprogram as follows X\begin{quote} X\tt newpath \\ X50 50 moveto \\ X150 50 lineto \\ X100 150 lineto \\ Xclosepath stroke \\ X/Times-Roman findfont 10 scalefont setfont \\ X45 55 moveto (a) show \\ X155 55 moveto (b) show \\ X95 55 moveto (c) show \\ X60 35 moveto \\ X(The Triangle ABC) show \\ Xshowpage X\end{quote} Xwhich would produce: X\par X\psglobal{figs/mac.pro} X\centerline{\psfig{figure=figs/trianglev.ps}} X\par XThis overview was only meant to give a flavor of the \Ps\ Xlanguage, and therefore has only touched on the simplest Xof it's commands. For a more thorough introduction, Xconsult the {\it PostScript Language Tutorial and Cookbook} Xand {\it PostScript Language Reference Manual} from Adobe Systems. X\par X\section*{Appendix B: Capturing \Ps\ files from a Macintosh} XIn general, a \Ps\ file can be transferred from a Macintosh to another host Xusing any of the popular terminal emulators and a serial line. We have used XMacTerminal and Kermit without any problems. X\par XSlightly trickier is getting the \Ps\ into a file on the Macintosh. For XMacDraw and MacWord (and perhaps others), there is an undocumented X``feature'' whereby the \Ps\ code can be diverted into a file rather than Xbeing sent to a printer. Immediately after clicking `ok' from the print Xmenu, hit clover--F; the code will be placed in a file with the name X``PostScript'' (there is no known way to change this). Clover-K will Xcapture the file {\it and} the lengthy prolog mentioned above. X\end{document} X @//E*O*F doc/figdoc.tex// if test 22919 -ne "`wc -c <'doc/figdoc.tex'`"; then echo shar: error transmitting "'doc/figdoc.tex'" '(should have been 22919 characters)' fi fi # end of overwriting check if test ! -d 'doc/figs' ; then echo shar: creating directory "'doc/figs'" mkdir 'doc/figs' fi echo shar: extracting "'doc/figs/box.ps'" '(105 characters)' if test -f 'doc/figs/box.ps' ; then echo shar: will not over-write existing file "'doc/figs/box.ps'" else sed 's/^X//' >doc/figs/box.ps <<'@//E*O*F doc/figs/box.ps//' X%! X%%BoundingBox: 0 0 1 1 Xnewpath X0 0 moveto X1 0 lineto X1 1 lineto X0 1 lineto Xclosepath X.8 setgray Xfill X @//E*O*F doc/figs/box.ps// if test 105 -ne "`wc -c <'doc/figs/box.ps'`"; then echo shar: error transmitting "'doc/figs/box.ps'" '(should have been 105 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/cm.ps'" '(281 characters)' if test -f 'doc/figs/cm.ps' ; then echo shar: will not over-write existing file "'doc/figs/cm.ps'" else sed 's/^X//' >doc/figs/cm.ps <<'@//E*O*F doc/figs/cm.ps//' X%! X%%BoundingBox: 27.47 27.47 172.52 172.52 X X100 100 translate Xnewpath X 0 0 moveto X 0 0 72 0 90 arc X closepath X fill X X 0 0 moveto X 0 0 72 90 180 arc X closepath X stroke X X 0 0 moveto X 0 0 72 180 270 arc X closepath X fill X X 0 0 moveto X 0 0 72 270 360 arc X closepath X stroke X Xshowpage @//E*O*F doc/figs/cm.ps// if test 281 -ne "`wc -c <'doc/figs/cm.ps'`"; then echo shar: error transmitting "'doc/figs/cm.ps'" '(should have been 281 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/frogfill.mac'" '(1646 characters)' if test -f 'doc/figs/frogfill.mac' ; then echo shar: will not over-write existing file "'doc/figs/frogfill.mac'" else sed 's/^X//' >doc/figs/frogfill.mac <<'@//E*O*F doc/figs/frogfill.mac//' X%! Xmd begin XT 32 760 100 72 72 psu X(Frog2; user: )jn X%%Title: Frog2 X%%Creator: MAC LaserWriter Driver X%%BoundingBox: 35 576 251 792 X%%For: X1320 od X%%EndProlog X%%Page: ? 1 Xop X0 0 xl X1 1 pen X0 0 gm X0 0 720 540 6 dorect X58 <40A00000040A0000>setpat X63 78 123 147 4 dorect X4 4 pen X19 61 119 155 130 412 4 doarc X0 grlevel X21. 63. 117. 153. 130 412 0 doarc X58 grlevel X37 61 137 155 45 132 4 doarc X0 grlevel X39. 63. 135. 153. 45 132 0 doarc Xbc X142 130 gm Xbp X133 130 T qi X133 103 qc X151 85 qc X187 67 qc X196 67 qc X205 76 qc X187 112 qc X142 130 T qq X138 130 gm X58 grlevel Xqf X7 ec Xbc X142 130 gm Xtr X0 grlevel Xpt X178 148 pl X151 148 pl X151 166 pl X133 130 pl Xeu X133 121 gm X187 85 lin Xbc X70 130 gm Xbp X79 130 T qi X79 103 qc X61 85 qc X25 67 qc X16 67 qc X7 76 qc X25 112 qc X70 130 T qq X75 130 gm X58 grlevel Xqf X7 ec Xbc X70 130 gm Xtr X0 grlevel Xpt X34 148 pl X61 148 pl X61 166 pl X79 130 pl Xeu X76 121 gm X22 85 lin X0 0 gm X16 setgry X40 67 62 149 4 doval X0 grlevel X42. 69. 60. 147. 0 doval Xbc X73 34 gm Xbp X73 16 T qi X82 7 qc X91 16 qc X91 22 qc X73 34 T qq X73 25 gm X64 grlevel Xqf X7 ec X2 2 pen X0 0 gm X14 77 31 85 4 doval X0 grlevel X15. 78. 30. 84. 0 doval Xbc X4 4 pen X139 34 gm Xbp X139 16 T qi X130 7 qc X121 16 qc X121 22 qc X139 34 T qq X139 25 gm X64 grlevel Xqf X7 ec X2 2 pen X0 0 gm X14 131 31 139 4 doval X0 grlevel X15. 132. 30. 138. 0 doval Xbc X143 71 gm Xbp X161 74 T qi X170 86 qc X164 95 qc X155 101 qc X128 107 qc X125 95 qc X158 89 qc X137 80 qc X140 68 qc X143 71 T qq X152 73 gm X32 grlevel Xqf X7 ec Xbc X71 71 gm X0 grlevel Xbp X53 74 T qi X44 86 qc X50 95 qc X59 101 qc X86 107 qc X89 95 qc X56 86 qc X77 80 qc X74 68 qc X71 71 T qq X62 73 gm X32 grlevel Xqf X7 ec X0 page Xcp X%%Page: ? 2 Xop X-1 page Xcp X%%Trailer Xend @//E*O*F doc/figs/frogfill.mac// if test 1646 -ne "`wc -c <'doc/figs/frogfill.mac'`"; then echo shar: error transmitting "'doc/figs/frogfill.mac'" '(should have been 1646 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/lab.ps'" '(15162 characters)' if test -f 'doc/figs/lab.ps' ; then echo shar: will not over-write existing file "'doc/figs/lab.ps'" else sed 's/^X//' >doc/figs/lab.ps <<'@//E*O*F doc/figs/lab.ps//' X%! X%%BoundingBox: 135 410 462 688 Xmd begin XT 64 1520 50 72 72 psu X(NewLab3; user: )jn X%%Title: NewLab3 X%%Creator: MAC LaserWriter Driver X%%For: X1320 od X%%EndProlog X%%Page: ? 1 Xop X0 0 xl X1 1 pen X0 0 gm X0 0 1440 1080 6 dorect X64 grlevel X369 723 442 742 4 dorect X0 grlevel X369.5 723.5 441.5 741.5 0 dorect X2 2 pen X797 158 gm X32 grlevel X776 179 lin X869 179 gm X848 158 lin X719 200 gm X0 grlevel X719 527 lin X749 608 gm X32 grlevel X749 596 lin X869 530 gm X869 578 lin X293 596 gm X671 596 lin Xbc X4 4 pen X292 529 gm X0 grlevel Xpt X292 643 pl X280 655 pl X256 655 pl X244 643 pl X244 526 pl Xeu X1 1 pen X0 0 gm X64 grlevel X585 267 634 274 4 dorect X0 grlevel X585.5 267.5 633.5 273.5 0 dorect X294 627 gm X273 627 lin X294 621 gm X273 621 lin X294 615 gm X273 615 lin X294 609 gm X273 609 lin X294 603 gm X273 603 lin X294 597 gm X273 597 lin X294 591 gm X273 591 lin X267 627 gm X246 627 lin X267 621 gm X246 621 lin X267 615 gm X246 615 lin X267 609 gm X246 609 lin X267 603 gm X246 603 lin X267 597 gm X246 597 lin X267 591 gm X246 591 lin Xbc X4 4 pen X292 526 gm X64 grlevel Xtr X0 grlevel Xpt X277 526 pl X277 544 pl X292 544 pl Xeu Xbc X670 529 gm Xpt X670 649 pl X685 664 pl X757 664 pl X769 652 pl X769 619 pl X757 607 pl X748 607 pl Xeu Xbc X718 595 gm Xpt X850 595 pl X868 577 pl Xeu X2 2 pen X869 458 gm X32 grlevel X869 506 lin X869 386 gm X869 434 lin X869 314 gm X869 362 lin X869 242 gm X869 290 lin X4 4 pen X868 289 gm X0 grlevel X868 313 lin X868 361 gm X868 385 lin X868 433 gm X868 457 lin X868 505 gm X868 529 lin Xbc X670 217 gm X64 grlevel Xtr X0 grlevel Xpt X685 217 pl X685 199 pl X670 199 pl Xeu Xbc X292 316 gm Xpt X292 205 pl X280 193 pl X244 193 pl X232 205 pl X232 283 pl X244 295 pl Xeu X2 2 pen X671 248 gm X32 grlevel X293 248 lin X4 4 pen X0 0 gm X64 grlevel X217 670 320 689 4 dorect X0 grlevel X219. 672. 318. 687. 0 dorect X685 526 gm X685 661 lin X670 526 gm X685 526 lin X0 0 gm X64 grlevel X247 277 320 296 4 dorect X0 grlevel X249. 279. 318. 294. 0 dorect X2 2 pen X293 527 gm X668 527 lin X671 317 gm X293 317 lin X245 524 gm X32 grlevel X245 491 lin X4 4 pen X271 247 gm X0 grlevel X292 247 lin X2 2 pen X389 317 gm X389 248 lin X449 317 gm X449 248 lin X509 317 gm X509 248 lin X575 317 gm X575 248 lin X575 596 gm X575 527 lin X509 596 gm X509 527 lin X449 596 gm X449 527 lin X389 596 gm X389 527 lin X4 4 pen X775 199 gm X718 199 lin X709 526 gm X718 526 lin X685 199 gm X688 199 lin X670 217 gm X670 142 lin X718 142 gm X718 199 lin X1 1 pen X672 147 gm X693 147 lin X672 153 gm X693 153 lin X672 159 gm X693 159 lin X672 165 gm X693 165 lin X699 147 gm X720 147 lin X699 153 gm X720 153 lin X699 159 gm X720 159 lin X699 165 gm X720 165 lin Xbc X693 144 gm Xpt X693 171 pl X699 171 pl X699 144 pl Xeu X4 4 pen X0 0 gm X64 grlevel X439 277 494 296 4 dorect X0 grlevel X441. 279. 492. 294. 0 dorect X64 grlevel X352 277 407 296 4 dorect X0 grlevel X354. 279. 405. 294. 0 dorect X1 1 pen X64 grlevel X210 240 247 286 4 dorect X0 grlevel X210.5 240.5 246.5 285.5 0 dorect X285 246 gm X240 210 lin X240 246 gm X285 210 lin X2 2 pen X473 527 gm X64 grlevel X455 527 lin X1 1 pen X456 528 gm X0 grlevel X456 546 lin X0 0 gm X510.5 438.5 546.5 474.5 360 450 0 doarc X2 2 pen X413 527 gm X64 grlevel X395 527 lin X1 1 pen X396 528 gm X0 grlevel X396 546 lin X0 0 gm X510.5 378.5 546.5 414.5 360 450 0 doarc X2 2 pen X365 527 gm X64 grlevel X383 527 lin X1 1 pen X384 528 gm X0 grlevel X384 546 lin X0 0 gm X510.5 366.5 546.5 402.5 90 180 0 doarc X2 2 pen X362 317 gm X64 grlevel X380 317 lin X1 1 pen X381 318 gm X0 grlevel X381 300 lin X0 0 gm X300.5 363.5 336.5 399.5 180 270 0 doarc X2 2 pen X533 527 gm X64 grlevel X515 527 lin X1 1 pen X516 528 gm X0 grlevel X516 546 lin X0 0 gm X510.5 498.5 546.5 534.5 360 450 0 doarc X2 2 pen X599 527 gm X64 grlevel X581 527 lin X1 1 pen X582 528 gm X0 grlevel X582 546 lin X0 0 gm X510.5 564.5 546.5 600.5 360 450 0 doarc X2 2 pen X599 317 gm X64 grlevel X581 317 lin X1 1 pen X582 318 gm X0 grlevel X582 300 lin X0 0 gm X300.5 564.5 336.5 600.5 270 360 0 doarc X2 2 pen X536 317 gm X64 grlevel X518 317 lin X1 1 pen X519 318 gm X0 grlevel X519 300 lin X0 0 gm X300.5 501.5 336.5 537.5 270 360 0 doarc X2 2 pen X476 317 gm X64 grlevel X458 317 lin X1 1 pen X459 318 gm X0 grlevel X459 300 lin X0 0 gm X300.5 441.5 336.5 477.5 270 360 0 doarc X2 2 pen X416 317 gm X64 grlevel X398 317 lin X1 1 pen X399 318 gm X0 grlevel X399 300 lin X0 0 gm X300.5 381.5 336.5 417.5 270 360 0 doarc X690 201 gm X690 186 lin X720 201 gm X720 186 lin X0 0 gm X186.5 675.5 216.5 705.5 270 360 0 doarc X186.5 705.5 216.5 735.5 180 270 0 doarc X246 528 gm X246 543 lin X276 528 gm X276 543 lin X0 0 gm X513.5 231.5 543.5 261.5 360 450 0 doarc X513.5 261.5 543.5 291.5 90 180 0 doarc X4 4 pen X718 595 gm X718 529 lin X2 2 pen X293 440 gm X293 404 lin X671 440 gm X671 404 lin X1 1 pen X0 0 gm X510.5 279.5 540.5 309.5 180 270 0 doarc X480.5 279.5 510.5 309.5 90 180 0 doarc X294 525 gm X279 525 lin X294 495 gm X279 495 lin X0 0 gm X336.5 279.5 366.5 309.5 180 270 0 doarc X306.5 279.5 336.5 309.5 90 180 0 doarc X294 351 gm X279 351 lin X294 321 gm X279 321 lin X0 0 gm X510.5 654.5 540.5 684.5 270 360 0 doarc X480.5 654.5 510.5 684.5 360 450 0 doarc X669 525 gm X684 525 lin X669 495 gm X684 495 lin X0 0 gm X336.5 657.5 366.5 687.5 270 360 0 doarc X306.5 657.5 336.5 687.5 360 450 0 doarc X672 351 gm X687 351 lin X672 321 gm X687 321 lin X0 0 gm X64 grlevel X443 408 480 457 4 dorect X0 grlevel X443.5 408.5 479.5 456.5 0 dorect X32 grlevel X449.5 420.5 473.5 444.5 0 doval X432 464 gm X0 grlevel X432 458 lin X435 461 gm X429 461 lin X423 489 gm X64 grlevel X481 420 492 446 2 dorect X0 grlevel X0 1 6 [tb X{0 fs}fx X{9 fz}fx X%%Changefont: |----1Helvetica XF /|----1Helvetica fnt X21 am X(Hand)aa X]es X0 0 gm X64 grlevel X419 437 432 450 4 doval X0 grlevel X419.5 437.5 431.5 449.5 0 doval X64 grlevel X410 422 441 441 4 dorect X0 grlevel X410.5 422.5 440.5 440.5 0 dorect X64 grlevel X420 425 430 435 4 dorect X0 grlevel X420.5 425.5 429.5 434.5 0 dorect X32 grlevel X420 434 430 438 4 dorect X0 grlevel X420.5 434.5 429.5 437.5 0 dorect X64 grlevel X387 486 433 535 4 dorect X0 grlevel X387.5 486.5 432.5 534.5 0 dorect X499 428 gm X0 1 6 [tb Xgf X25 am X(Vision)aa X]es X0 0 gm X64 grlevel X363 495 376 508 4 doval X0 grlevel X363.5 495.5 375.5 507.5 0 doval X64 grlevel X354 504 385 523 4 dorect X0 grlevel X354.5 504.5 384.5 522.5 0 dorect X64 grlevel X364 510 374 520 4 dorect X0 grlevel X364.5 510.5 373.5 519.5 0 dorect X32 grlevel X364 507 374 511 4 dorect X0 grlevel X364.5 507.5 373.5 510.5 0 dorect X399 670 gm X64 grlevel X642 396 678 586 2 dorect X0 grlevel X1 1 6 [tb X{1 fs}fx X{36 fz}fx X%%Changefont: |----1Helvetica XF /|----1Helvetica sbs Xfnt X184 am X(Grasp Lab)aa X]es X4 4 pen X244 490 gm X220 490 lin X244 460 gm X220 460 lin X244 460 gm X244 352 lin X2 2 pen X245 350 gm X32 grlevel X245 317 lin X4 4 pen X244 250 gm X0 grlevel X244 316 lin X235 247 gm X250 247 lin X2 2 pen X707 527 gm X64 grlevel X689 527 lin X1 1 pen X690 528 gm X0 grlevel X690 546 lin X0 0 gm X510.5 672.5 546.5 708.5 360 450 0 doarc X4 4 pen X757 664 gm X757 607 lin X868 241 gm X868 178 lin X847 157 gm X796 157 lin X775 178 gm X775 199 lin X1 1 pen X0 0 gm X64 grlevel X464 638 477 651 4 doval X0 grlevel X464.5 638.5 476.5 650.5 0 doval X64 grlevel X455 647 486 666 4 dorect X0 grlevel X455.5 647.5 485.5 665.5 0 dorect X64 grlevel X465 653 475 663 4 dorect X0 grlevel X465.5 653.5 474.5 662.5 0 dorect X32 grlevel X465 650 475 654 4 dorect X0 grlevel X465.5 650.5 474.5 653.5 0 dorect X64 grlevel X434 638 447 651 4 doval X0 grlevel X434.5 638.5 446.5 650.5 0 doval X64 grlevel X425 647 456 666 4 dorect X0 grlevel X425.5 647.5 455.5 665.5 0 dorect X64 grlevel X435 653 445 663 4 dorect X0 grlevel X435.5 653.5 444.5 662.5 0 dorect X32 grlevel X435 650 445 654 4 dorect X0 grlevel X435.5 650.5 444.5 653.5 0 dorect X64 grlevel X404 638 417 651 4 doval X0 grlevel X404.5 638.5 416.5 650.5 0 doval X64 grlevel X395 647 426 666 4 dorect X0 grlevel X395.5 647.5 425.5 665.5 0 dorect X64 grlevel X405 653 415 663 4 dorect X0 grlevel X405.5 653.5 414.5 662.5 0 dorect X32 grlevel X405 650 415 654 4 dorect X0 grlevel X405.5 650.5 414.5 653.5 0 dorect X64 grlevel X374 638 387 651 4 doval X0 grlevel X374.5 638.5 386.5 650.5 0 doval X64 grlevel X365 647 396 666 4 dorect X0 grlevel X365.5 647.5 395.5 665.5 0 dorect X64 grlevel X375 653 385 663 4 dorect X0 grlevel X375.5 653.5 384.5 662.5 0 dorect X32 grlevel X375 650 385 654 4 dorect X0 grlevel X375.5 650.5 384.5 653.5 0 dorect Xbc X672 492 gm X32 grlevel Xpt X657 492 pl X657 354 pl X672 354 pl Xeu X0 0 gm X64 grlevel X396 594 409 607 4 doval X0 grlevel X396.5 594.5 408.5 606.5 0 doval X64 grlevel X381 585 400 616 4 dorect X0 grlevel X381.5 585.5 399.5 615.5 0 dorect X64 grlevel X384 596 394 606 4 dorect X0 grlevel X384.5 596.5 393.5 605.5 0 dorect X32 grlevel X393 596 397 606 4 dorect X0 grlevel X393.5 596.5 396.5 605.5 0 dorect X64 grlevel X354 594 367 607 4 doval X0 grlevel X354.5 594.5 366.5 606.5 0 doval X64 grlevel X363 585 382 616 4 dorect X0 grlevel X363.5 585.5 381.5 615.5 0 dorect X64 grlevel X369 596 379 606 4 dorect X0 grlevel X369.5 596.5 378.5 605.5 0 dorect X32 grlevel X366 596 370 606 4 dorect X0 grlevel X366.5 596.5 369.5 605.5 0 dorect X64 grlevel X376 558 389 571 4 doval X0 grlevel X376.5 558.5 388.5 570.5 0 doval X64 grlevel X367 567 398 586 4 dorect X0 grlevel X367.5 567.5 397.5 585.5 0 dorect X64 grlevel X377 573 387 583 4 dorect X0 grlevel X377.5 573.5 386.5 582.5 0 dorect X32 grlevel X377 570 387 574 4 dorect X0 grlevel X377.5 570.5 386.5 573.5 0 dorect X64 grlevel X372 330 381 348 4 dorect X0 grlevel X372.5 330.5 380.5 347.5 0 dorect X64 grlevel X383 302 432 375 4 dorect X0 grlevel X383.5 302.5 431.5 374.5 0 dorect X32 grlevel X389.5 308.5 425.5 344.5 0 doval X389.5 332.5 425.5 368.5 0 doval X326 404 gm X0 grlevel X326 410 lin X323 407 gm X329 407 lin X350 404 gm X350 410 lin X347 407 gm X353 407 lin X0 0 gm X64 grlevel X351 362 364 375 4 doval X0 grlevel X351.5 362.5 363.5 374.5 0 doval X64 grlevel X362 353 381 384 4 dorect X0 grlevel X362.5 353.5 380.5 383.5 0 dorect X64 grlevel X368 364 378 374 4 dorect X0 grlevel X368.5 364.5 377.5 373.5 0 dorect X32 grlevel X365 364 369 374 4 dorect X0 grlevel X365.5 364.5 368.5 373.5 0 dorect X303 364 gm X64 grlevel X356 300 367 340 2 dorect X0 grlevel X0 1 6 [tb X{0 fs}fx X{9 fz}fx X%%Changefont: |----1Helvetica XF /|----1Helvetica fnt X35 am X(Arm-Eye)aa X]es X0 0 gm X64 grlevel X438 309 451 322 4 doval X0 grlevel X438.5 309.5 450.5 321.5 0 doval X64 grlevel X431 320 462 339 4 dorect X0 grlevel X431.5 320.5 461.5 338.5 0 dorect X64 grlevel X441 326 451 336 4 dorect X0 grlevel X441.5 326.5 450.5 335.5 0 dorect X32 grlevel X441 323 451 327 4 dorect X0 grlevel X441.5 323.5 450.5 326.5 0 dorect X64 grlevel X438 354 451 367 4 doval X0 grlevel X438.5 354.5 450.5 366.5 0 doval X64 grlevel X431 338 462 357 4 dorect X0 grlevel X431.5 338.5 461.5 356.5 0 dorect X64 grlevel X441 341 451 351 4 dorect X0 grlevel X441.5 341.5 450.5 350.5 0 dorect X32 grlevel X441 350 451 354 4 dorect X0 grlevel X441.5 350.5 450.5 353.5 0 dorect X64 grlevel X465 570 478 583 4 doval X0 grlevel X465.5 570.5 477.5 582.5 0 doval X64 grlevel X444 558 469 598 4 dorect X0 grlevel X444.5 558.5 468.5 597.5 0 dorect X567 459 gm X64 grlevel X451 564 462 592 2 dorect X0 grlevel X0 1 6 [tb Xgf X23 am X(Voxel)aa X]es X4 4 pen X0 0 gm X64 grlevel X439 670 494 689 4 dorect X0 grlevel X441. 672. 492. 687. 0 dorect X64 grlevel X352 670 407 689 4 dorect X0 grlevel X354. 672. 405. 687. 0 dorect X1 1 pen X750 201 gm X750 303 lin X801 375 gm X867 375 lin X870 237 gm X750 237 lin X2 2 pen X749 215 gm X64 grlevel X749 233 lin X1 1 pen X750 234 gm X0 grlevel X768 234 lin X0 0 gm X216.5 732.5 252.5 768.5 270 360 0 doarc X870 303 gm X750 303 lin X2 2 pen X749 257 gm X64 grlevel X749 239 lin X1 1 pen X750 240 gm X0 grlevel X768 240 lin X0 0 gm X222.5 732.5 258.5 768.5 360 450 0 doarc X801 375 gm X801 303 lin X801 447 gm X801 375 lin X870 447 gm X801 447 lin X870 519 gm X720 519 lin X801 447 gm X801 519 lin X2 2 pen X800 350 gm X64 grlevel X800 368 lin X1 1 pen X801 369 gm X0 grlevel X819 369 lin X0 0 gm X351.5 783.5 387.5 819.5 270 360 0 doarc X2 2 pen X800 398 gm X64 grlevel X800 380 lin X1 1 pen X801 381 gm X0 grlevel X819 381 lin X0 0 gm X363.5 783.5 399.5 819.5 360 450 0 doarc X2 2 pen X800 494 gm X64 grlevel X800 512 lin X1 1 pen X801 513 gm X0 grlevel X819 513 lin X0 0 gm X495.5 783.5 531.5 819.5 270 360 0 doarc X2 2 pen X752 518 gm X64 grlevel X734 518 lin X1 1 pen X735 519 gm X0 grlevel X735 537 lin X0 0 gm X501.5 717.5 537.5 753.5 360 450 0 doarc X2 2 pen X719 470 gm X64 grlevel X719 452 lin X1 1 pen X720 453 gm X0 grlevel X738 453 lin X0 0 gm X435.5 702.5 471.5 738.5 360 450 0 doarc X2 2 pen X719 341 gm X64 grlevel X719 359 lin X1 1 pen X720 360 gm X0 grlevel X738 360 lin X0 0 gm X342.5 702.5 378.5 738.5 270 360 0 doarc X64 grlevel X558 819 571 832 4 doval X0 grlevel X558.5 819.5 570.5 831.5 0 doval X64 grlevel X570 807 583 820 4 doval X0 grlevel X570.5 807.5 582.5 819.5 0 doval X64 grlevel X570 789 583 802 4 doval X0 grlevel X570.5 789.5 582.5 801.5 0 doval X64 grlevel X570 771 583 784 4 doval X0 grlevel X570.5 771.5 582.5 783.5 0 doval X64 grlevel X558 759 571 772 4 doval X0 grlevel X558.5 759.5 570.5 771.5 0 doval X64 grlevel X546 771 559 784 4 doval X0 grlevel X546.5 771.5 558.5 783.5 0 doval X64 grlevel X546 789 559 802 4 doval X0 grlevel X546.5 789.5 558.5 801.5 0 doval X64 grlevel X546 807 559 820 4 doval X0 grlevel X546.5 807.5 558.5 819.5 0 doval X64 grlevel X555 768 574 787 4 dorect X0 grlevel X555.5 768.5 573.5 786.5 0 dorect X64 grlevel X555 786 574 805 4 dorect X0 grlevel X555.5 786.5 573.5 804.5 0 dorect X64 grlevel X555 804 574 823 4 dorect X0 grlevel X555.5 804.5 573.5 822.5 0 dorect X64 grlevel X375 726 394 739 4 dorect X0 grlevel X375.5 726.5 393.5 738.5 0 dorect X64 grlevel X422 728 435 738 4 dorect X0 grlevel X422.5 728.5 434.5 737.5 0 dorect X64 grlevel X417 726 421 730 4 doval X0 grlevel X417.5 726.5 420.5 729.5 0 doval X64 grlevel X414 729 418 733 4 doval X0 grlevel X414.5 729.5 417.5 732.5 0 doval X64 grlevel X417 732 421 736 4 doval X0 grlevel X417.5 732.5 420.5 735.5 0 doval X64 grlevel X521 824 537 867 4 dorect X0 grlevel X521.5 824.5 536.5 866.5 0 dorect X64 grlevel X524 827 537 840 4 dorect X0 grlevel X524.5 827.5 536.5 839.5 0 dorect X64 grlevel X524 839 537 852 4 dorect X0 grlevel X524.5 839.5 536.5 851.5 0 dorect X64 grlevel X524 851 537 864 4 dorect X0 grlevel X524.5 851.5 536.5 863.5 0 dorect X702 641 gm X64 grlevel X633 699 644 745 2 dorect X0 grlevel X0 1 6 [tb Xgf X41 am X(Workshop)aa X]es X0 0 gm X64 grlevel X435 780 445 790 4 doval X0 grlevel X435.5 780.5 444.5 789.5 0 doval X64 grlevel X426 765 457 784 4 dorect X0 grlevel X426.5 765.5 456.5 783.5 0 dorect X64 grlevel X450 783 460 793 4 dorect X0 grlevel X450.5 783.5 459.5 792.5 0 dorect X32 grlevel X447 783 451 793 4 dorect X0 grlevel X447.5 783.5 450.5 792.5 0 dorect X64 grlevel X327 768 337 778 4 doval X0 grlevel X327.5 768.5 336.5 777.5 0 doval X64 grlevel X315 753 346 772 4 dorect X0 grlevel X315.5 753.5 345.5 771.5 0 dorect X64 grlevel X312 771 322 781 4 dorect X0 grlevel X312.5 771.5 321.5 780.5 0 dorect X32 grlevel X321 771 325 781 4 dorect X0 grlevel X321.5 771.5 324.5 780.5 0 dorect X64 grlevel X414 735 418 739 4 doval X0 grlevel X414.5 735.5 417.5 738.5 0 doval X64 grlevel X425 731 432 738 4 doval X0 grlevel X425.5 731.5 431.5 737.5 0 doval X475 681 gm X403 681 lin X475 681 gm X475 687 lin X403 681 gm X403 687 lin X439 681 gm X439 687 lin X457 681 gm X457 687 lin X421 681 gm X421 687 lin X469 681 gm X469 684 lin X463 681 gm X463 684 lin X451 681 gm X451 684 lin X445 681 gm X445 684 lin X433 681 gm X433 684 lin X427 681 gm X427 684 lin X415 681 gm X415 684 lin X409 681 gm X409 684 lin X402 696 gm X0 1 6 [tb Xgf X5 am X(0)aa X]es X420 696 gm X0 1 6 [tb Xgf X5 am X(3)aa X]es X438 696 gm X0 1 6 [tb Xgf X5 am X(6)aa X]es X456 696 gm X0 1 6 [tb Xgf X5 am X(9)aa X]es X471 696 gm X0 1 6 [tb Xgf X10 am X(12)aa X]es X484 696 gm X0 1 5 [tb Xgf X16 am X(feet)aa X]es X0 page Xcp X%%Trailer Xend @//E*O*F doc/figs/lab.ps// if test 15162 -ne "`wc -c <'doc/figs/lab.ps'`"; then echo shar: error transmitting "'doc/figs/lab.ps'" '(should have been 15162 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/pretzel.ps'" '(349 characters)' if test -f 'doc/figs/pretzel.ps' ; then echo shar: will not over-write existing file "'doc/figs/pretzel.ps'" else sed 's/^X//' >doc/figs/pretzel.ps <<'@//E*O*F doc/figs/pretzel.ps//' X%! pretzel.ps -- an example for the psfig paper. X%%BoundingBox: 95 100 185 200 X X5 setlinewidth X1 setlinecap X110 100 moveto X120 120 140 160 160 160 curveto X170 160 180 150 180 140 curveto X180 120 160 100 140 100 curveto X120 100 100 120 100 140 curveto X100 150 110 160 120 160 curveto X140 160 160 120 170 100 curveto Xstroke Xshowpage @//E*O*F doc/figs/pretzel.ps// if test 349 -ne "`wc -c <'doc/figs/pretzel.ps'`"; then echo shar: error transmitting "'doc/figs/pretzel.ps'" '(should have been 349 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/rosette.ps'" '(3426 characters)' if test -f 'doc/figs/rosette.ps' ; then echo shar: will not over-write existing file "'doc/figs/rosette.ps'" else sed 's/^X//' >doc/figs/rosette.ps <<'@//E*O*F doc/figs/rosette.ps//' X%! X%%BoundingBox: 124.38 124.38 487.61 487.61 X% Cookbook Example Program from First Printing, Revised 7 Jan 1985 X% Program: Repeated Shapes Number: 6 X%----------------------------------------------------------------------------- X% X % This program prints a rosette X % design by defining a section of X % that design and printing that X % section repeatedly. This program X % illustrates the ``for'' and X % "arc" operators, and it shows X % how coordinate transformations X % can be nested so as to use the X % most convenient coordinate X % system for each part of a X % design. X/inch {72 mul} def X X/wedge % Define an ``ice cream cone'' X { newpath % shape by means of the ``arc'' X 0 0 moveto % operator. This shape will have a X 1 0 translate % 30 degree angle topped off with X 15 rotate % a semicircle. Set the path's X 0 15 sin translate % first point at the current X 0 0 15 sin -90 90 arc % origin. Next, move the origin to X closepath % the center of the semicircle by X } def % translating to the right 1 unit, X % rotating counter-clockwise by 15 X % degrees, and translating ``up'' X % in the rotated system by the X % radius of the semicircle. The X % ``arc'' operator includes a X % straight line to the initial X % point of the arc and a curved X % section to the end of the arc. X % Note that the semicircle goes X % from -90 degrees to 90 degrees X % in the rotated coordinate X % system. X Xgsave X 4.25 inch 4.25 inch translate % Move into position for the X % rosette. X 1.75 inch 1.75 inch scale % Make the edges of the rosette 1 X % 3/4 inches long. X 0.02 setlinewidth % Use a 7/200 inch thick line. X 2 1 13 % Set up the ``for'' operator to X % iterate 12 times, pushing 2 onto X % the stack the first time, 3 the X % next time, ... , and 13 the last X % time. X { % The last argument for ``for'' is X % the sequence of operations to be X % repeated. This sequence must be X % enclosed by braces. X 13 div setgray % Divide the loop index by 13 to X % set a gray value. X gsave % Enclose the ``wedge'' operation X wedge % in a ``gsave''-``grestore'' X % pair, as it will mess up the X % coordinate system. X gsave % Save the wedge path for use X % after the ``fill''. X fill X grestore X 0 setgray stroke % Draw a black border around the X % wedge. X grestore % Get out of the coordinate system X % left by wedge. X 30 rotate % Set up for the next section. X } for % Close the last argument and X % execute the ``for'' operator. Xgrestore Xshowpage X @//E*O*F doc/figs/rosette.ps// if test 3426 -ne "`wc -c <'doc/figs/rosette.ps'`"; then echo shar: error transmitting "'doc/figs/rosette.ps'" '(should have been 3426 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/starlines.ps'" '(327 characters)' if test -f 'doc/figs/starlines.ps' ; then echo shar: will not over-write existing file "'doc/figs/starlines.ps'" else sed 's/^X//' >doc/figs/starlines.ps <<'@//E*O*F doc/figs/starlines.ps//' X%! X%%BoundingBox: 300 400 410 420 X/Times-BoldItalic findfont X27 scalefont setfont X X/rays { X 0 1.5 179 X { gsave X rotate X 0 0 moveto X 108 0 lineto X stroke X grestore X } for X} def X Xsave X X300 400 translate X.25 setlinewidth X Xnewpath X0 0 moveto X(StarLines) true charpath clip X Xnewpath X54 -15 translate Xrays X Xshowpage X Xrestore X @//E*O*F doc/figs/starlines.ps// if test 327 -ne "`wc -c <'doc/figs/starlines.ps'`"; then echo shar: error transmitting "'doc/figs/starlines.ps'" '(should have been 327 characters)' fi fi # end of overwriting check echo shar: extracting "'doc/figs/triangle.ps'" '(110 characters)' if test -f 'doc/figs/triangle.ps' ; then echo shar: will not over-write existing file "'doc/figs/triangle.ps'" else sed 's/^X//' >doc/figs/triangle.ps <<'@//E*O*F doc/figs/triangle.ps//' X%! X%%BoundingBox: 20 20 160 160 Xnewpath X50 50 moveto X150 50 lineto X100 150 lineto Xclosepath stroke Xshowpage X X @//E*O*F doc/figs/triangle.ps// if test 110 -ne "`wc -c <'doc/figs/triangle.ps'`"; then echo shar: error transmitting "'doc/figs/triangle.ps'" '(should have been 110 characters)' fi fi # end of overwriting check echo shar: extracting "'man/README'" '(81 characters)' if test -f 'man/README' ; then echo shar: will not over-write existing file "'man/README'" else sed 's/^X//' >man/README <<'@//E*O*F man/README//' Xpsfigtex.l : X source for a unix man page Xpsfigtex.out : X clear text copy of same @//E*O*F man/README// if test 81 -ne "`wc -c <'man/README'`"; then echo shar: error transmitting "'man/README'" '(should have been 81 characters)' fi fi # end of overwriting check echo shar: "End of archive 1 (of 3)." cp /dev/null ark1isdone DONE=true for I in 1 2 3; do if test -! f ark${I}isdone; then echo "You still need to run archive ${I}." DONE=false fi done case $DONE in true) echo "You have run all 3 archives." echo 'See the README' ;; esac ## End of shell archive. exit 0