Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!renoir.Berkeley.EDU!munson From: munson@renoir.Berkeley.EDU (Ethan V. Munson) Newsgroups: comp.sys.mac Subject: Re: MAC-PostScript & TeX Message-ID: <28996@ucbvax.BERKELEY.EDU> Date: 1 May 89 15:28:00 GMT References: <362100013@uicsl.csl.uiuc.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: munson@renoir.Berkeley.EDU.UUCP (Ethan V. Munson) Organization: University of California, Berkeley Lines: 109 About two months ago I posted a message to the TEXHAX mailing list for help on how to include Macintosh generated illustrations in TeX documents which use the psfig macro package. Many events have intervened, but I think that I finally have an answer that is sufficiently correct to post publicly. I know of four basic approaches of which I consider only three effective. They are: 1) MODIFY THE LASERPREP FILE (Ineffective): Several people reported success with this method, but I couldn't duplicate their results. You can save the PostScript which normally goes to the LaserWriter by holding down Command-K while requesting printing. The resulting file contains a long prologue stored in the LaserPrep file in the system folder and printing commands generated by the application program. The basic approach here is to save the prologue separately and edit it so that it will work correctly with programs like dvi2ps. As I said above, several people told me they had done this successfully, but I was never able to. There appears to be a conflict between what dvi2ps does and what the LaserPrep file does. Also, we have a DEC PostScript printer here which cannot accept some of the LaserWriter/68000-specific commands which appear in the LaserPrep file. 2) USE PS-FROM-MAC (Close but no cigar): PS-from-Mac is a Mac application which converts MacPaint and MacDraw files into plain printer-independent PostScript. It was written by Alec Dunn of the University of Sydney. He sells it for a reasonable price. In general, it works like a charm. You run PS-from-Mac on your file and get a PostScript file which can be included "as is" in a TeX document. I don't know if it can read MacDraw II files, but I think MacDraw II can output the old file format, so it shouldn't be much of an issue. The problem is that MacDraw documents do not come out precisely as you would expect. Some of the differences are not important. For example, the Mac prints arrowheads with rounded backs. PS-from-Mac arrowheads are triangles. A more important problem is that some objects get positioned differently than they appear on the screen. I tried to put rectangles around individual 10 pt words. When the screen said the word looked centered in the box, the printed result had the box shifted downward. If you are including a Mac figure in a TeX document, you are likely to be picky about positioning, so I think this is a serious problem. 3) CRICKET DRAW PLUS SOME GYRATIONS (Effective but many steps): Cricket Draw allows you to save a drawing as a PostScript file using its own printer-independent prologue. Unfortunately, there is still a fair amount of massaging required. The steps are: 1) Create your figure. 2) Turn the entire figure into one group by using the Select All and Group menu options. 3) Flip the figure vertically using the Reflect on X menu option. This is necessary because Cricket Draw, like most Mac applications, put its image in the fourth quadrant of the Cartesian plane. If you don't flip the figure it comes out upside down. 4) Open a new PostScript window, and use the Generate PostScript menu option to create a PS version of your figure. Save this PS file using the "Complete" option, which appends the Cricket Draw prologue. 5) Transfer the file to the UNIX box (use a file transfer program in text mode) 6) Determine the bounding box of the figure by using the program bbfig which is part of the dvi2ps distribution. 7) Edit the PS file to make the Bounding Box comment correct. If you figure include text, you must also change some font names. For some reason, Cricket Draw uses names like \_______Symbol for the fonts. If you strip off the non-printing part of the font names, things will work. Obviously, this could be done by a simple sed script. 8) You are now ready to go. Just include the file in your TeX document using psfig. Well, this series of steps is a pain, but frankly, most of it doesn't take that long. Also, Cricket Draw is not very expensive and is designed for precisely the kind of drawing you are likely to want in a figure in a paper. 4) USE ADOBE ILLUSTRATOR (Effective and easy): Adobe Illustrator files are PostScript files. You construct your figure and save it. There is already a Bounding Box comment, so you just transfer the file to the UNIX box and include it in the TeX file. Wait a minute. One trivial problem. I don't have a copy of Illustrator '88 available, but our plain Illustrator files have a Bounding Box comment that looks like %%BoundingBox:91 -394 272 -235 when psfig expects a space after the colon, as in %%BoundingBox: 91 -394 272 -235 Otherwise, it works like a charm. My complaint with Illustrator is that it is primarily intended for graphic artists, which I am not. As a result, there is no round-corner rectangle (of which I am quite fond) and line-drawing and spline-drawing use the same tool, which I find confusing. Finally, Illustrator costs about twice as much as Cricket Draw. CONCLUSION: For me, only Cricket Draw and Illustrator are acceptable solutions. I haven't been able to get the LaserPrep solution to work at all. PS-from-Mac is a good idea but is just inaccurate enough to require multiple passes to get a figure right. Cricket Draw presents a cheap solution that requires some elbow-grease. I think that most of the file editing on the UNIX box can be automated, but a run of bbfig will always be required. Illustrator files require almost no postprocessing but it is an expensive program and may not be as easy for you to use as Cricket Draw. Ethan Munson munson@renoir.berkeley.edu ...ucbvax!renoir!munson My thanks to Steve Strickland for coming up with the Cricket Draw method and to Glenn Reid of Adobe for getting it through my thick head that Illustrator would work just fine.