% mactotex.tex - including mac figures in (La)TeX % % LaTeX document % % written 08/08/91 - asf (Adam S. Fedor) fedor@boulder.colorado.edu % \documentstyle[psfig]{article} \special{header=lprep71.pro} \newcommand\Ps{Post\-Script} \newcommand\latexver{2.9} \newcommand\psfigver{1.4} \newcommand\dvipsver{5.47} \newcommand\lprepver{71} \title{Including Mac Figures in \TeX\ with Psfig} \author{Adam Fedor} \date{\today} \maketitle \begin{document} \section{Introduction} The Macintosh computers use their own set of internal commands (`QuickDraw') to store graphics. When the Macintosh converts these commands to \Ps, it creates the \Ps\ file using a set of non-standard definitions. Since these definitions are non-standard, it can be tricky to print Macintosh figures from other computers since these other computers do not often know what these definitions are. This document tries to give a simple (but not foolproof) method of including Macintosh figures in \TeX\ or \LaTeX. NOTE: This document is to be used in addition to the {\em Psfig/\TeX\ User's Guide}. \section{Capture the Figure} There are several ways of capturing the \Ps\ output of MacDraw or some other Macintosh program. One way is by typing \psfig{figure=macclover.ps}-F immediately after clicking `OK' on the print dialog box. The file is always called `PostScript' and is left in the folder of the Macintosh application you are using. The file may also be located in the `Spool Folder' in the `System Folder'. \begin {itemize} \item If the Print Monitor program is running, it may not allow you to write the file to disk. In this case you must turn background printing off. Go to the {\em Chooser} desk accessory and click the `background printing off' box. \end{itemize} Newer printer dialogs have a box you can click on to send the output to a disk (\Ps) file. Also print the figure as you would normally. You will need this later to determine the `Bounding Box'. \begin{itemize} \item If you are using the System 7.0 LaserWriter Dialog: The print dialog that comes with System 7.0 has a box that allows you to print the document to a \Ps\ file. Unfortunately, the entire LaserPrep file is included along with the document. After you have transferred the file to the computer with \TeX\ on it (see below), run the program \verb|cleanps| to get rid of the unwanted LaserPrep info. \end{itemize} \section{Transfer the figure} Transfer the \Ps\ file you made to a computer that has \TeX\ on it. You may do this using the Telnet program (and ftp) on the Macintosh. \section{Find the Bounding Box} Unfortunately, Macintosh does not conform to the standard of specifying the Bounding Box of the graphics it prints. Therefore you must determine the Bounding Box yourself. Take the printout of the figure you made in Step 1, and a ruler. Imagine the smallest box that completely encloses the figure. Now measure the left are right sides of the box from the left edge of the paper (Fig.~\ref{fig-bb}). Do the same for the top and bottom sides from the bottom edge of the paper. \begin{figure} \psfig{figure=macbb.ps,bbllx=1.5in,bblly=5.9in,bburx=5.6in,bbury=10.2in} \caption{Finding the Bounding Box of a figure} \label{fig-bb} \end{figure} \section{Editing the \TeX\ file} Near the beginning of your \TeX\ file (in addition to the line \verb|\input{psfig}|, insert the command \begin{verbatim} \special{header=lprep68.pro} \end{verbatim} This file is a properly edited version of the Apple LaserPrep file that is sent to the printer by the Macintosh. \begin{itemize} \item Note that the version number (68 in this case) must be the same as the version of the LaserPrep file that the \Ps\ file was created with. Look at the \Ps\ file and find the line that says `(AppleDict md)'. The number after this is the version of the LaserPrep file. If this number is 71, you would have to use the file `lprep71.pro' instead. \end{itemize} Now where you want the figure to be included, insert the command \begin{quote} \verb|\psfig{figure=|{\em filename} \verb|,bbllx=#in,bblly=#in,bburx=#in,bbury=#in}| \end{quote} where the number (\verb|#|) you insert after \verb|bbllx| is the left side of the Bounding Box, \verb|bblly| is the bottom, \verb|bburx| is the right side, and \verb|bbury| is the top. This example shows the box dimensions in inches (\verb|in|). \section{Printing the file} Use the program \verb|dvips| to print the \TeX\ file to the printer. As of this writting \verb|dvi2ps| will not work with Macintosh figures. \begin{itemize} \item The file should print out on any printer (not just an Apple LaserWriter). If you have troubles printing a file, try turning off/on the printer to erase any incompatible commands. \item As of this writing, non-resident fonts included in version 71 \Ps\ files will not print on non-Apple printers (This is a bug in lprep71.pro). \item If you still have trouble printing a figure Use the \verb|cleanps| program on each of your \Ps\ figure files. You may also have to run \verb|cleanps| with the \verb|-f| option if your file contains loaded (non-resident) fonts. \end{itemize} This document was composed using \LaTeX\ (ver. \latexver) and Psfig (ver. \psfigver) using version \lprepver\ Mac \Ps\ files. It was printed using dvips (ver. \dvipsver) to an Apple LaserWriter. \end{document}