\documentstyle[11pt,psfig]{article}

\title{\bf Including Adobe Illustrator and PowerPoint Figures Into a Latex File}

\author{Martin Rinard \\
        Laboratory for Computer Science\\
        Massachusetts Institute of Technology\\
        Cambridge, MA 02139 \\
        {\tt rinard@lcs.mit.edu} }


\begin{document}
\maketitle

\section{Introduction}

LaTex works fine for most of my paper writing needs, but including
drawing is always a potential problem. I've figured out how to
include drawings from Microsoft PowerPoint and Adobe Illustrator
into LaTex documents. This note tells you how to do it; hopefully
it will spare you the hassle of figuring it out from scratch like
I did. Fair warning --- I have tried this procedure out for several
examples, but there is no guarantee it will work for other examples
or for other versions of PowerPoint or Illustrator. Good luck!

\section{Including Adobe Illustrator Drawings}

This procedure is designed to work with Adobe Illustrator version 7.0
installed on Windows NT 4.0. 
\begin{enumerate}
\item Draw your figure using Adobe Illustrator.
\item Choose Save As from the File menu. You will get a dialog box.
\item Choose Illustrator EPS from the pull-down menu on the dialog
  box in the Save As Type field. Then hit the Save button.
\item Another dialog box will pop up. Check compatability 6.0, uncheck the
  Include Document Thumbnails, and set Preview to None.
  Then hit the OK button.
\item The EPS file should be ready to include! See Section~\ref{sec:including},
which presents the LaTex source to include an EPS file.
\end{enumerate}

\section{Including Microsoft PowerPoint Drawings}

This procedure is designed to work with Microsoft PowerPoint
97 running on Windows NT 4.0. 
\begin{enumerate}
\item Draw your figure using PowerPoint. PowerPoint apparently generates
stuff outside the bounding box; I've been able to get around this by
moving the figure to the upper left hand corner of the page before
printing it.
\item Choose Print from the File menu.
\item A dialog box pops up; check Print to File and Print Current Page,
then hit 
\item From PowerPoint, print the page containing the figure to a file.
You do this by choosing Print from the File menu, then checking 
Print to file and Current slide on the dialog box that comes
up. Hit OK, and you'll get a dialog box that asks you to choose
where to put the PostScript file.
\item Read the generated PostScript file into GhostView, and choose
     PS to EPS from the File menu. Generate an EPS file.
\item Delete everything between the \%\%BeginSetup and \%\%EndSetup.
I have written a quick Perl program that does this. It reads from
standard input and prints to standard output. Figure~\ref{fig:perl}
presents the program.

\item The EPS file should be ready to include! See Section~\ref{sec:including},
which presents the LaTex source to include an EPS file.
\end{enumerate}

\begin{figure}[htbp]
\begin{verbatim}
#!/usr/bin/perl

while(<>) {
  if (/\%\%BeginSetup/) {
    print;
    while(<>) {
      if (/\%\%EndSetup/) {
        last;
      }
    }
  }
  print;
}
\end{verbatim}
\caption{\label{fig:perl}
Perl Program to Delete Problematic Stuff in PowerPoint PostScript Files}
\end{figure}

Alternative:
\begin{enumerate}
\item  From PowerPoint, print the page containing the figure to a file.
\item  Read the generated PostScript file into Adobe Illustrator.
\item  Edit the file as desired. Note that PowerPoint puts lots of 
     invisible junk around the figure, so you should probably delete
     the junk.
\item Follow the procedure for inserting an Adobe Illustrator figure
     into a LaTex document.
\end{enumerate}

People tell me that with some printer drivers, it is possible to 
print EPS directly from PowerPoint, then include the EPS file
directly into a LaTex document.

\section{Including A Figure}
\label{sec:including}

Here is the LaTex source to include a figure:
\begin{verbatim}
\begin{figure}[htbp]
\begin{center}
\begin{tabular}{c}
\psfig{figure=figuretest.eps,clip=}
\end{tabular}
\end{center}
\caption{Here Is a PowerPoint Figure Inserted Into A Latex File}
\end{figure}
\end{verbatim}

Figure~\ref{fig:included} presents the figure. 

\begin{figure}[htbp]
\begin{center}
\begin{tabular}{c}
\psfig{figure=figuretest.eps}
\end{tabular}
\end{center}
\caption{\label{fig:included}
Here Is a PowerPoint Figure Inserted Into A Latex File}
\end{figure}

A typical situation is that 
you are running Illustrator or PowerPoint on a Windows machine, and
LaTex on a Unix machine. If this is the case, you will have to 
use ftp or some similar program to transfer the EPS file from the
Windows machine to the Unix machine before you can include it.

\section{Acknowledgements}

In graduate school I shared an apartment for several years with
Tom Rokicki. Besides being a great roommate, Tom is also a PostScript
and Latex wizard, and I got some PostScript advice from him as was I figuring
out how to do this.

\end{document}
