Bijlage A Report on Workshop; Getting PostScript into TEXandLATEX Documents 111

Report on Workshop Getting PostScript into TEXandLATEX Documents1 Anita Z. Hoover University of Delaware 002A Smith Hall Newark, DE 19716

1 Introduction 3 Edward A. Garay, Univesity of Il-

I had a very dif®cult time deciding how to conduct this linois at Chicago (USA) workshop. I had mixed feelings because I did not have Ed presented a solution that he uses for the VM/CMS general solutions for all computer platforms and prin- environment. The driver he is currently using is DVI- ters. It became a nightmare trying to solve just one LASER/PS from ArborText Incorporated and psfig platform, UNIX. So the more I worked on the preparing macros. for the workshop, the sooner I realized that I should present the research on UNIX and open the ¯oor for comments from those who attended. 4 Calvin W. Jackson, Jr., California This format worked wonderfully. The point of a work- Institute of Technology (USA) shop is to exchange ideas. Many interesting comments came out of the workshop and I would like to share Cal talked about a group called SUMEX. He said that this group is a very good resource for information about them with all who attended the conference. computers. Here is the readme ®le if you are interested in Info-Mac. Welcome to the Info-Mac archive at sumex-aim.stanford.edu [36.44.0.6]. Our software is available through anonymous FTP, 2 Anita Z. Hoover, University of a mailserver, and the Bitnet shadow archives. Delaware (USA) More information is stored in the /info-mac/help directory: Anita presented her solution for the UNIX environ- accessing-files.txt -- instructions on accessing ment. The following information can be accessed and converting files via anonymous ftp from zebra.acs.udel.edu all-files.txt -- a list of all files in the archive (128.175.8.11) in pub/tex/postscript. recent-files.txt -- a list of recently created or

 Document from workshop psw.tex modified files

 LaserPrep ®les for System 7 (unmodi®ed) lprep71.pro To get there, type "cd help". Then either generated from a MacWrite ®le "ls" or "dir" should show you the available help lprep71md.pro generated from a MacDraw II files. Use the "get" command to transfer them to ®le your system. Since these files are text, no

 psfig.tex macros for dvips version 5.47 (Tom special decoding is necessary. Rokicki) psfig.tex NOTE: As a volunteer staff, we do not have the The original can be accessed via ano- time to check every binary for viruses or system nymous ftp from compatibility. You should always use caution whitechapel.media.mit.edu when running a downloaded binary. (18.85.0.125) in pub/psfig or linc.cis.upenn.edu (130.91.6.8) Please read "help/posting-guidelines.txt" before making a submission to the archives or the digests. in dist/psfig.

 Filter to ®x Framemaker (landscape and portrait), The Info-Mac Moderators

Splus and Mathematica epsf_filter [email protected] 1

To be published in TUGboat, c 1991, TEX Users Group.

Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands Reprint MAPS#7 (91.2); Nov 1991 112 Report on Workshop; Getting PostScript into TEXandLATEX Documents Bijlage A

5 Shashi Sathaye, University of TEX \special command. Low- and high-level TEX Kentucky (USA) macros are provided to enable such inclusion of TEX- labelled MG graphics in TEX documents.º Shashi presented her solution for the VM/CMS envi- From the last paragraph of his handout at the Confe- ronment. She is using a package called PsT X. PsT X E E rence, is a BIBTEX-like processor for including ®gures into LATEX documents. Figures are included using the ªThe MG System software is available on two 5.25 inch ª\psboxº macro; this macro causes LATEXtomake diskettes or one 3.5 diskette. When ordering, please entries in the ª.auxº ®le(s) for the job. PsTEX ®nds specify which format you prefer. Single CPU licences these entries, locates the corresponding POSTSCRIPT ®- for MG are being offered at US$ 95.00 or CAN$ 110 les (which should be in EPSF format as appropriate for plus $5.00 shipping in the USA or Canada, or $10.00 dvips), and determines how to size the ®gure accor- overseas. Network and site licences are also available. ding to the options speci®ed in the macro in LATEX, and Orders or inquiries should be sent to MG Software, according to the nominal size and shape of the POST- 4223 West Ninth Avenue, Vancouver, B.C., Canada, SCRIPT.PsTEX was originally developed for the UNIX V6R 2C6. E-mail inquiries: [email protected] environment, Shashi has made the necessary changes (Internet), or useradms@ubcmtsg (Bitnet). Payment for VM/CMS and this is now available through the by cheque, or money-order. Institutional purchase or- standard VM/CMS TEX distribution tape managed by ders are also accepted.º Joachim C. Lammarsch. She also said she was willing to port Tom Rokicki's driver (dvips version 5.47) to VM/CMS. 8 Jan Michael Rynning, K.T.H. One week after the conference, Shashi had done the Royal Institute of Technology port to VM/CMS. She tested it for Computer Modern (Sweden) Roman fonts, and Edward Garay is currently testing Jan made a suggestion for determining if your POST- the PostScript fonts. When the testing is complete, SCRIPT ®le has font independence by scaling the entire dvips version 5.47 will beavailablethrough thestandard document up or down a percentage. If the fonts re- VM/CMS TEX distribution tape managed by Joachim main unchanged, then your POSTSCRIPT ®le has font C. Lammarsch. independence. For more information, e-mail to [email protected] (Internet) for PsTEX(UNIX and VM/CMS) and dvips (VM/CMS). For dvips (VM/CMS), you may also send 9 Roger B. Jagoda, Cornell Univer- e-mail to Ed Garay at U12570@UICVM (Bitnet). sity (USA) Roger talked about an integrated network approach for

6 Standardization of nspecial Macintosh and UNIX computers. Here is a detailed description from Roger. General comment about standardizing on the syntax of \special would be helpful as a ®rst start for driver We have SPARCstations (SUN OS 4.1.1) and DECsta- standards rather than trying to get all of the standards tions (Ultrix 4.2), both UNIX workstations, connected agreed upon. over a thin network (TCP/IP). The thin net connects to a Kinetics FastPath K-4 box (K-box) to our AppleTalk network. The K-box is the gateway from 7 Robert A. Adams, University of UNIX TCP/IP to the Macintosh AppleTalk protocol. It also converts between these two protocols. ALL prin- British Columbia (CANADA) ting (i.e. all thePOSTSCRIPT LaserWriter NTX printing) Bob presented his solution by using a package called is done on the AppleTalk side. There are no printers MG (Mathematical Graphics System). From the ®rst directly connected to any UNIX workstations. This is paragraph of his handout at the Conference, because we've found AppleTalk to be faster than 9600 baud. To let the UNIX workstations "see" the Apple- ªMG is a program for generating high-quality two- and Talk LaserWriter NTX printers, we use CAP (Columbia three-dimensional mathematical graphics on an IBM AppleTalk Protocols) ver. 6.01 from the network. PC (or compatible) computer, and for printing these graphics on a POSTSCRIPT output device. The POST- So what works? We use Textures from Blue Sky SCRIPT output of MG can be obtained either as an en- Research on the and they can do every- capsulated POSTSCRIPT ®le for direct printing, or else thing. Blue Sky Research now has available POST- as a pair of TEX readable POSTSCRIPT and Label ®- SCRIPT fonts, so you can avoid the Computer Modern les suitable for incorporating into a TEX document. In Roman font nightmares. But, DO NOT install ANY of

this case TEX will typeset the labels on the graph; the these fonts into the Macintosh System Folder:::only graph itself is relayed to the output device driver by a Textures is set up to use them and it can REALLY screw

Reprint MAPS#7 (91.2); Nov 1991 Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands Bijlage A Report on Workshop; Getting PostScript into TEXandLATEX Documents 113

things up for any other applications such as MicroSoft this information. Hopefully there will be overlap in Word or Excel. certain areas.

The UNIX side is a bit tougher. We have used two products successfully. We use Sitka (formerly TOPS) Corporation product, TOPS and that links the UNIX 11 Barry Smith, Blue Sky Research workstations so they can at least ªseeº the AppleTalk (USA) printers as ªbsd line printersº. However, this works for Barry presented an integrated approach on the Macin- text ®les only. Xinet (Berkely, CA, formerly Mt. Xinu) tosh using Textures. He also mentioned that Adobe also has aproduct to do this called K-Spool which works will be coming out with there own print driver and better (faster) than TOPS. Again this works for text ®les this should eliminate alot of the Macintosh related pro- only. For PostScript, we use Adobe Systems Incorpo- blems. It is also important to make sure that your rated product, TRANSCRIPT, which Cornell has a site LaserPrep ®les match with the POSTSCRIPT ®le you are

license for ( $900.00 per year to maintain, don't ask trying to include in the T X and/or LAT X document. what the initial cost was, I just don't know). This soft- E E ware provides the ®lters and AFM (Adobe Font Metric) He also pointed out that there is a problem with the ®les needed for ANY UNIX box to prepare true POST- Adobe Type Fonts for Computer Modern Roman when SCRIPT ®les (i.e. BoundingBox, etc.). The POSTSCRIPT used with dvips version 5.47 (Tom Rokicki). The dis- ®le is sent to the LaserWriter NTX printers via TOPS cussion lead to the fact that Tom was aware of this and or K-Spool. the problem was being worked on.

The problems are related to the UNIX side, TOPS doe- sn't handle the K-Box routing as well as K-Spool and it's slower. Also, when you try to include POSTSCRIPT 12 Lee Thompson, University of ®les, psfig is needed, otherwise the ®le never gets to Wisconsin (USA) the printers. We've traced this problem to the UNIX lpr program and how it interacts with the routing software. Lee presented some tricks that can be directly done \special Without the K-Box, lpr STILL chokes on included ®les, in POSTSCRIPT.Hewasusing commands so I think the K-Box may be innocent on this problem. with raw POSTSCRIPT that worked for DVILASER/PS from ArborText Incorporated. These \special com- The Macintosh never has a problem as they are native to mands can be adapted to work with other drivers and AppleTalk. They are just slow and all our data is on the the POSTSCRIPT should still work. UNIX side. Sun Microsystems Incorporated has a new way of prining called NeWSPrint, where the processing Here is an example for ªreverse printingº (reverse videoÐwhite on black). The basic idea is to gene- is done on the UNIX machine and then the POSTSCRIPT ®le is dumped to a dumb printer (no on-board smarts, rate a closed curve (in the simplest case, a rectangle like an HP Laserjet or similar beast). The problem is outling the entire page), ®ll it with black, then set the that to make it work you REALLY have to dedicate a halftone parameter to ªwhiteº before returning. Subse- whole CPU as a printer server with at least 32MB of quent TEX output will then be ªpaintedº in white on the black background. RAM. I'd rather get the POSTSCRIPT printer and keep the CPU for as a usable system (screen/user/desktop). % PostScript procedure for use by TeX \special For more information, % to do reversed printing e-mail [email protected] (Internet) % For the ArborText DVILASER/PS software, % invoke by a line such as: or roger@crnlion (Bitnet). % \vbox to 0pt{\hbox to \hsize{% % \special{ps: plotfile rvrsprnt.psx}\hfil}} % The syntax for other drivers will differ. 10 David K. Steiner, Rutgers Uni- % % Utility procedure: lets work in inches versity (USA) /inch {72 mul} def gsave Dave presented a document that explains what pro- % Make a black retangle that fills the page

grams, macro packages, and fonts are available for TEX, 0 0 moveto 8.5 inch 0 rlineto 0 11. inch rlineto

A

S S

A A -8.5 inch 0 rlineto closepath LI M NIX LTEX, S TEX, M -TEX, L -TEXonU machi- nes at Rutgers. This document also explains how to use 0 setgray fill grestore OST various programs to create graphical output (in P - % Now, leave "graylevel" set to "white" when we SCRIPT) and include them into your TEX document. % go back It was discussed during the workshop that a document 1 setgray % That's all like this should be put together for general use. Per- haps the ideal situtation would be to have a document for each platform/operating system. We could use the (Note that this procedure deliberately violates on of the standard installations and develop documents based on rules normally followed when invoking POSTSCRIPT

Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands Reprint MAPS#7 (91.2); Nov 1991 114 Report on Workshop; Getting PostScript into TEXandLATEX Documents Bijlage A procedures; it returns to TEX with the graphic state of 13 Final Comments the laser printer altered.) Solving the problem of getting POSTSCRIPT into TEX With more elaborate coding, one can ®ll only a speci®c and LATEX documents certainly proved to be a dif®cult area (say a rectangle with rounded corners) with black, one. It appears that many working solutions exist for let TEX set some type, then use another invocation of different computer platforms and environments. I hope \special to restore the halftone to ªblackº. this report can put you in contact with the right people Comment by Anita Hoover: It would also be very easy to help you. Please feel free to contact me if you would to write a macro to enter the numbers being used in the like to add any information or comment on this report. POSTSCRIPT. You would probably have to change the There was a lot of good information exchanged at the way you include the raw POSTSCRIPT. workshop. I want to thank everyone who contributed to the workshop and this report. I could not have done this without you.

Reprint MAPS#7 (91.2); Nov 1991 Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands Bijlage A Report on Workshop; Getting PostScript into TEXandLATEX Documents 115

APPENDIX Getting PostScript into TEXandLATEX Documents UNIX environment Anita Z. Hoover

1 Introduction  MacDraw (only for LaserPrep5.2)

Most of the testing I did was based on the UNIX plat- form. My hope is that most of these ideas will help with the transition to other platforms. However, some of the 2 Mathematica, Macsyma, S programs are written speci®cally for the UNIX platform and therefore solving problems may not be so easy. Just incorporate the POSTSCRIPT ®le following the di- rections for psfig or espf. My basic environment consisted of the following:

 TEX3.0andLATEX2.09  dvips version5.47byTomRokicki 3 FrameMaker

 Macro packages used to include POSTSCRIPT 1. psfig I found it the easiest to run the FrameMaker POST- These macros worked well because it allowed SCRIPT ®le through a ®lter which ®xes the location of you to scale the height and width (soon to be the BoundingBox and changes the line which uses the available with dvips macros). It also allows a BoundingBox called FMDOCUMENT. clip option if the POSTSCRIPT ®gure contained a lot of white space. 2. epsf 4 Macintosh These macros are part of the dvips program, and with the exception of the added features 4.1 LaserPrep5.2 mentioned above in psfig, is a ®ne macro You must include this ®le as a header in your document package. using the following \special command for dvips

 bbfig to help calculate the BoundingBox values \special{header=lprep68.pro} I ®rst used this to calculate the BoundingBox va- lues. If this did not work I would calculate it by Assuming you have your LaserPrep ®le as lprep68.pro hand using the great explanation in the dvips do- . cument by Tom Rokicki. Include your POSTSCRIPT ®le using psfig or epsf

 The LaserPrep ®les for the Macintosh with the correct BoundingBoxoption. When you create 1. LaserPrep5.2, "(AppleDict md)" 68 0 this ®le from the Macintosh, the ®le should not contain 2. LaserPrep6.0, "(AppleDict md)" 70 0 the LaserPrep ®le. 3. LaserPrep7.0, "(AppleDict md)" 71 0 \psfig{figure=®le.ps,bbllxpt,bbllypt,%

 Three POSTSCRIPT printers bburxpt,bburypt} 1. HPIIIsi \epsf[bbllx,bblly,bburx,bbury]{®le.ps} 2. QMS-PS1500 3. Apple LaserWriter These POSTSCRIPT ®les printed on the Apple Laser-

 Example POSTSCRIPT ®les Writer NTX, QMS-PS1500, and HPIIsi. 1. Mathematic 2. Macsyma 3. S 4.2 LaserPrep6.0 4. FrameMaker All that applies to LaserPrep5.2 (except you need to in- 5. Macintosh Applications clude the LaserPrep ®le for version 6.0), however these

 CricketGraph ®les only printed on the Apple LaserWriter NTX. I tried

 SuperPaint everything and could not get these to work on the other

 MacDrawII 2printers.

Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands Reprint MAPS#7 (91.2); Nov 1991 116 Report on Workshop; Getting PostScript into TEXandLATEX Documents Bijlage A

4.3 LaserPrep7.0 %%BeginProcSet: . Under System 7.0, the new Print Dialog Box now pro- . vides a button to create a POSTSCRIPT ®le. Doing so %%EndProlog creates a ®le that automatically includes the LaserPrep ®le. This is somewhat of a hassle, but I was able to get consistent results. I also needed to create 2 different LaserPrep ®les. 4.4 QMS-PS1500 and HPIIIsi Printer 1. MacWrite, CricketGraph and SuperPaint 2. MacDrawII All Macintosh POSTSCRIPT ®les that did not require fonts to be downloaded worked ®ne. In the case where I was not able to get the MacDrawII POSTSCRIPT ®le a font needed to be downloaded, you must change the to print using the same LaserPrep ®le for the other Ma- Macintosh POSTSCRIPT ®le so that cexec is something cintosh applications. Perhaps the difference was based different. I changed it to be texec and this worked. I on the downloaded fonts required for my MacDrawII was able to combine all types of Macintosh POSTSCRIPT example. I will have to do further investigation. ®les this way in TEXandLATEX documents. As a result of having to use 2 different LaserPrep ®les This method worked especially nice for the HPIIIsi. I to print these speci®c applications, I was not able to ran into a problem for the QMS-PS1500, where the Su- combine MacDrawII POSTSCRIPT ®les with the other perPaint ®le did not translate properly. Following the Macintosh POSTSCRIPT ®les. method below for the Apple LaserWriter printer solved this problem. 5Conclusion 4.5 Apple LaserWriter I think the best thing to do is to just include the POST- I do not know why this happens, as I am not a POST- SCRIPT ®le originally. If it does not print, see if there is SCRIPT Language expert, but taking the same ®les that a ®lter available to make the proper changes to allow it printed on the QMS-PS1500 and HPIIIsi did not print to print. Lastly, see if there is a logical change that can on the Apple LaserWriter. In order to consistently get be made to the POSTSCRIPT ®letomakeitwork. these ®les to work, I needed to split out the original Also if you plan to mix different POSTSCRIPT ®les ge- POSTSCRIPT ®les created by the Macintosh to not in- nerated from different applications, you can expect to clude the LaserPrep ®le. To do this, you need to delete have problems. the text from

Reprint MAPS#7 (91.2); Nov 1991 Dutch TEX Users Group (NTG), P.O. Box 394, 1740 AJ Schagen, The Netherlands