|
Adobe Illustrator (this page is mostly about CS 3 because that's the last version I bought) is a vector graphics program that comes in handy when you want to create or edit Postsccript/EPS or PDF figures, e.g., for a scientific presentation or publication. I'm not making any statements about how or if this software is better than others - it's discussed here because I've been running it since version 6 and therefore have gotten used to it. Scroll down to the end for alternative (free) graphics programs. In particular, I would strongly recommend looking into Inkscape as a free alternative, and a simple, browser-based relative of it, SVG-Edit (see the discusssion below).
Scenarios in which you may need a program like this are:
For a quick, to-the-point introduction to Illustrator, check out this link; it assumes a much older version of Illustrator, but this has the advantage that there isn't too much extra baggage dealing with advanced features introduced in later versions. Sometimes it's good to go back to basics.
This page has grown quite long. The reason is that I am addressing issues related to a proprietary application (Illustrator) whose inner workings are not open to inspection. So what happens is that the user stumbles upon an issue and has to make some educated guesses as to what's wrong. Since I can't change the software that's causing the trouble, all I can do is to classify the various combinations of circumstances under which the issues arises, and address solutions one by one.
Here is a list of issues with Adobe Illustrator on Mac OS X for which fixes or workarounds are known. I'll then give the quick fixes for these problems, followed by some more technical fixes that lead to more flexibility in manipulating the graphics object:
LaTeX and Mathematica font problems can be circumvented by using Place...
from Illustrator's File
menu to bring EPS or PDF files into a document. The difference to the Open
action is that a placed file is not editable within Illustrator. Click this link to see what this looks like (for a multi-page PDF document, you get to choose which page to place).
The big advantage is that Illustrator now does not have to try and make all the fonts in that figure available via the Type
tool, and there will thus be no font substitutions. This only avoids the problem but doesn't solve it. It's useful only if you intend to embed your final Illustrator output as PDF or EPS into a LaTeX file, because if the original placed file is itself created with LaTeX then its fonts should cause no problems when fed back into a LaTeX in the form of an included graphic.
A more useful and very reliable procedure is to strip off all embedded fonts from the document before opening in Illustrator. This requires an additional step which I'll describe here for a LaTeX document; the analogous procedure is described for Mathematica on a separate page (that's where I initially discovered this trick; then I adapted it in response to a question on the Mac OS X TeX mailing list).
Assume you have generated a file Myfile.pdf
using pdflatex
(or latex
followed by dvipdf
), then run the command
gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=nofont-Myfile.ps -q -dbatch -dNOPAUSE Myfile.pdf -c quit
nofont-Myfile.ps
which you can then open in Illustrator. Text will be converted into vector outlines; this has the consequence that in contrast to the first solution ("placing" an file), the complete contents of the document are editable like any other graphics object. You can change the color and other attributes of individual symbols, scale formulas and do all the beautiful free-hand manipulations that Illustrator is so good at.
Since February 2006, this method is also part of LaTeXiT, a small front-end for LaTeX typesetting. If you enter a formula in LaTeXit, the PDF output can by copied onto the clipboard in the form of a converted PDF with the fonts stripped off, by choosing "Copy as outlined PDF" from the Edit
menu.
I have created a small application called FontBegone that performs the above operation and then converts the file back to PDF
format. The difference to LaTeXiT is that you can use my program on any PDF file, even multi-page documents downloaded from the net. This can be useful not only in conjunction with Illustrator, but also for sending the file to printers that have problems with your fonts.
PDF
, EPS
or PS
file onto the icon. The output file has the same base name as the input file, but with the ending -nofont.pdf
. Alternatively, in the latest version, you can also activate the program without dragging anything onto it; in that case, FontBegone
looks for PDF
content on the pasteboard
and replaces that by the outlined version.
To illustrate how this method works, return to the example given earlier, and compare with the fixed version, processed withFontBegone:
Using Place...
in Illustrator, you can still annotate or mask parts of the placed image, but you cannot, e.g., directly change the color of a line in the plot, or make the labels bigger. Also, when sending a document to someone without the necessary fonts installed, a placed file might again cause trouble. Instead, if Illustrator has converted text into vector graphics outlines, these are independent of specific font installations, and you have the "surgical" freedom to edit attributes such as color, size, transparency etc. Therefore, if you're content to have all your text in the form of graphics outlines, then the quick fix no. 2 above should be the best solution.
If, on the other hand, your goal is to maintain as much as possible of the textual information in the form of character fonts, then there's more work to do; before going on with these home improvement suggestions, note that fonts you installed for Illustrator may not show up properly on somebody else's computer.
To avoid even the remotest possibility of this, export
(or save as...
) the final EPS
or PDF
version of your graphic only after converting all text to outlines with the menu item Type > Create Outlines
. Keep a "master" copy with the same name but extension .ai
, in which text has not been converted to outlines so that you can make textual changes on it and re-export if needed.
LaTeX fonts are not displayed correctly
First, how do you get LaTeX into Illustrator in editable form? You need a
LaTeX typesetting program, and some options for this are
discussed on a
separate page about scientific presentations. Let's
assume you use TexShop.
Illustrator could receive data in PDF in two ways:
Copy
from the teTeX menu and open
Preview. Pressing Apple-N
creates a new
window with the copied part of the LaTeX document. Save
this as a PDF file from Preview, and drag the result
onto the Illustrator icon. This will open a new
Illustrator window with the desired part of your LaTeX
output.
The problem in both cases is that Illustrator will substitute all Computer Modern fonts (used by LaTeX) with its own defaults which generally creates a mess. In LaTeX, you can choose to use different fonts that are not the original Computer Modern, but this by itself only helps if these fonts happen to be available to Illustrator somehow.
To fix this, we need to provide additional fonts to Mac OS X. Here are three
solutions (they can also be combined). I'll summarize them first, then follows a detailed description.
/Library/Application Support/Adobe/Fonts/Reqrd/
. After restaring Illustrator, the fonts should be available. You can of course also install these fonts system-wide using Font Book, but there is no advantage in that unless you plan to use TeX fonts outside of Illustrator.\usepackage{type1cm}
This is still not perfect: punctuation marks such as commas, periods and vertical bars | are not represented correctly in math equations. But this seems to be the best we can do with the available Computer Modern fonts.
Among the fonts installed by this set of files are the ones used by the Euler
package. This is a somewhat more playful-looking font, but it actually works very well with Illustrator CS2/3 (not with CS!). If you want to try this font, add the line \usepackage[mathbf]{euler}
to the preamble of your latex document. Both latex and pdflatex produce output that maintains its appearance in Illustrator CS2. The picture on the right shows an example of Euler font, composed using LaTeXit.
\usepackage{mathtime}
belleek
fonts which are free and part of any standard
teTeX distribution. These fonts can be translated straightforwardly into a format that can be
installed under Mac OS X. The picture on the right illustrates the appearance of these fonts for the same code as above.
Font Book
application, highlight All Fonts
to display the list of system fonts, and click the "+" underneath that list to add fonts. Then choose the three files in the belleek directory you downloaded. You should then have the followng new entries in the Fontbook listing: BLEX
, BLSY
and RBLMI
.
\usepackage{mathtime}
at the end of your LaTeX preamble. Instead of using pdflatex
as I usually do, use latex
followed by dvipdf
for documents that are intended to be imported to Illustrator.
bm
package: to get bold math, use \mathbf{}
instead of \bm{}
in your formulas.
latex
followed by dvipdf
may work better than pdflatex
. If I use pdflatex file.tex
, not all glyphs show up correctly in Illustrator. This is why I have set the default composition method in LaTeXiT
to latex+dvipdf
.
latex
, followed by dvipdf
:
\documentclass{article} \usepackage{mathtime} \pagestyle{empty} \begin{document} Nobody would ever claim that \quad $ \vec\alpha_1(\xi,x)=\frac{\dot{\mathbf r}}{\vert \hbar\vert} \mbox{\quad for\,\,}\xi\neq 0 $ \end{document}I've tried much more complicated sources with many aditional styles (such as AMS packages), and the only problems I encountered are the ones listed above.
\documentclass{minimal}
, which makes the bounding box of the output fit the dimensions of your formula. If you don't use this class, (e.g. because you are following the latex
→ dvipdf
route), the same effect can be achieved by adding the following step after the dvipdf
stage:
pdfcrop filename.pdf
filename-crop.pdf
.
Once you're done editing in Illustrator, converting all text to outline is probably advisable in any case to be on the safe side if you want to send an Illustrator file with LaTeX annotation to someone else. Select all artwork, then go to Illustrator's Type Menu to perform this conversion. This will insure that your figure will display text in the same style even on systems that don't have the above LaTeX fonts installed.
XeLaTeX
. The reason why I don't say much about XeTeX/XeLaTeX
here is that it increases the risk that other users will not be able to read the resulting PDF if they are missing specicific fonts installed only on the author's system. With the STIX fonts now being freely available, one can imagine that they will one day be installed be default on most operating systems. This would significantly enhance the portability of XeLaTeX
-generated scientific papers.
For LaTeX documents with lots of styles and options loaded, it's quite likely that an arbitrarily selected PDF clipping will still encounter font substitution problems in Illustrator, but at least the steps described above should give good results if you trim down the LaTeX source code enough. After all, we are talking mainly about annotating illustrations here (and not about assimilating whole papers into Illustrator), and within that limited context you should be fine with what we have at this point. If not, go back to the quick fix.
There are many other graphics programs. A good place to find out what's available and which technologies are being developed: the Wikipedia web site's lists of vector and bitmap graphics applications. Here are my favorite free graphics programs:
After a long hiatus, development of Seashore has picked up again in 2010, so I recommend taking a look at it, though I personally use Gimp instead of Seashore. If you are still using it, you may also want to have a look at a separate page where I explain how transparency works in Seashore.
convert
command line utility is invaluable. You can get ImageMagick for X11 from fink. See also my general installation instructions.
The convert
utility recognizes a huge number of graphics formats. One problem that I had temporarily was that convert lost its ability to crop images automatically (the command for this used to be convert -crop 0x0
). Here is a workaround for this. However, in the most recent version from fink, it seems to be no problem to crop images using the alternative command convert -trim
instead.
Creative Suite
available online, this would be the best choice. Aviary offers several other online applications that can inter-operate with each other. This includes a node-based effects editor (reminiscent of Blender), a bitmap editor (see above) and even an audio editor.
SVG-Edit is an SVG based editor that can be used off-line but runs in your browser. Its user interface is superficially like that of Inkscape, but it may be preferable to some people because its smaller feature set and platform independence makes it more manageable. The editor supports layers, can import bitmap images and can export as a base64-encoded
string. However, the easiest way to import and export SVG images in this program is to click the SVG source view and copy the verbatim source code to and from an editor (such as emacs). This is possible because SVG is not a binary format but a human-readable XML format.
To view an SVG
file, you can always use a web browser (Safari/Firefox/Camino/Opera). But what if you want to include SVG
in another document such as a LaTeX-generated PDF
? With browser-based solutions such as SVG-Edit, there is no direct PDF export, but you can simply Print to PDF
, or use the print Preview
button (Mac OS X) to open the file in Preview
. Once in Preview.app, you can use the Select
tool to make a copy with the desired dimensions and process the vector graphics further (even additional annotations can be introduced with Prevoew's tools).
pstoedit
utility, and therefore will have its limitations, too. Beginning with version 0.45, Inkscape can import PDF files directly. There's a Mac OS X binary available at the project web site.
Note that for Snow Leopard, I had to set the X11 preferences as shown in this screenshot on the right.
If you don't uncheck the "Update Pasteboard when CLIPBOARD changes" box, Inkscape doesn't let you paste anything on its canvas.
Inkscape has some unique features. For example the ability to make tilings of the plane using any of the two-dimensional space groups. This is something one could get for the Classic Mac under the name Tesselmania!. Very instructive, not just for kids.