Adobe Illustrator FAQs
by Susan Delap


Q. LaTeX can't read the EPS file that Adobe Illustrator 9 (and up) created.
A. Many thanks to A.J. Aranyosi, a postdoc at MIT, for his documentation on this problem. I have reproduced the contents of his webpage here to ensure that this valuable information doesn't get lost.

How To Fix Adobe Illustrator 9.0's EPS Output For Use in LaTeX
by A.J. Aranyosi (click here for original webpage)

When writing talks, publications, etc., I typically work in Linux, using LaTeX, ghostscript, and some programs we've written in the lab. However, I often use Adobe Illustrator to make figures, because frankly it's the best vector graphic drawing program I've found out there. In addition, Illustrator supports reading and writing of EPS files, which makes it convenient to read existing PostScript files into Illustrator, to save Illustrator files in EPS format and include them in documents, etc.

Up through version 8.0, I had no problem moving EPS files back and forth between Illustrator and other applications (particularly ghostscript and LaTeX), even when I made changes to the PostScript code by hand. With version 9.0, though, suddenly including Illustrator EPS files in LaTeX stopped working. To figure out why, I started poking around in the EPS output of Illustrator. In this new version, Adobe's added a new section after the showpage command. This section consists of a few commands followed by a PrivateData region. To get the EPS file to display properly in LaTeX or gs, I had to delete everything after the showpage command (note: if you do this yourself, be sure to add a carriage return after the showpage line). After doing that, the EPS file behaved just as in the old versions.

Unfortunately, cutting out this section also prevents Illustrator from being able to open the file again: when you try, the program just hangs with an hourglass pointer until you kill it. To fix this problem, you need to "comment out" two lines from the top of the file (note: the lines are already "comments" in PostScript, since they start with a % sign. However, comment lines of the form "%%Keyword: Value" are called DSC lines, which are treated specially in PostScript. Adding "% " to the beginning of each line prevents the PostScript interpreter from treating these as DSC lines. Thanks to Jont Allen for the tip.). The lines that look like this:

%%Creator: Adobe Illustrator(R) 9.0
%%AI8_CreatorVersion: 9.0
should be changed to look like this:
% %%Creator: Adobe Illustrator(R) 9.0
% %%AI8_CreatorVersion: 9.0
Apparently when Illustrator sees these two lines, it assumes it's dealing with an Illustrator file, so it looks for the PrivateData section to get its information. To test this idea, I cut this section out of one file (let's call it file A) and pasted it into another file (file B). When I opened the resulting file in Illustrator, I saw the contents of file A, even though the actual PostScript code described file B. So if the PrivateData section is present, and the two lines above are at the top of the file, Illustrator completely ignores the PostScript code.

Summary:

  1. Delete everything after showpage
  2. Comment out the %%Creator: and %%AI8_CreatorVersion: lines.


Q. OK, but I can't convert these files to PDF.
A. Rick Aster answers:

The above strategy indeed works to get LaTeX to compile to dvi and dvips to produce ps files....I used EPS Illustrator version 10 and turned off all of the options when saving (don't know if this is necessary). Unfortunately the ps files that result will not convert to pdf via pstill, but that is another problem. Here is an edited example file: torque.xfig.ps. I added a showpage statement right after the grestore following the

ADOEndClientInjection: EndPageContent "AI10"
line in the eps produced by Illustrator. I changed the name to a .ps suffix so LaTeX would be happy with the naming convention. Because of the ASCII conventions used by Illustrator on the Mac, I had to first
cat file | tr '\r'  '\n' > newfile
to insert newlines so I could edit in vi. I'll get a script working to do this automatically on the Suns.
 


EES Home | Geology | Geochemistry | Hydrology | Geophysics | Site Map | Search

Last Updated: March 19, 2004
Please contact Webmaster regarding content on this page.