Jens Nöckel's Homepage

Computer notes home

Scientific Illustrations

Starting point

Adobe Illustrator 10 or CS are two recent versions of 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.

Scenarios in which you may need a program like this are:

Issues and solutions

Here is a list of issues with Adobe Illustrator on Mac OS X for which fixes or workarounds are known:

  1. Drag and drop does not work. Ideally, one would like to be able to drag an image from another application into Illustrator.
  2. LaTeX fonts are not displayed correctly (replaced by a "default font" which usually has no correspondence to the intended expression).
  3. Mathematica-generated postscript is displayed with incorrect fonts.

The solutions are as follows:

  1. One can still drag an image from another application onto the Illustrator icon (e.g., in the dock). This opens the image as a new window in Illustrator, and from there it can be copied into the desired destination window.
  2. Download the TeX-Illustrator Fonts and drag the whole Folder into the Directory /Library/Application Support/Adobe/Fonts/Reqrd/. After restaring Illustrator, the fonts should be available. This worked for me both under Jaguar (Illustrator 10) and Panther (Illustrator CS).
  3. Getting Illustrator to read Mathematica fonts is a tricky business because it depends on your configuration. Here are my own two solutions to the Mathematica font problem. The first one always works for me, the second one is a backup plan.
    • My starting point is that I can select and use all of the Mathematica Fonts from the Illustrator Type/Font Menu. Try this - if you can type greek letters after choosing Mathematica 1 Regular, then we're on the same page. If you do not have these fonts available in Illustrator, then you may be able to get them by copying the file /Applications/Mathematica\ 5.0.app/SystemFiles/Fonts/TrueType/MathematicaFonts.dfont to the Desktop, launching the Font Book Application and installing this file from the Desktop as fonts for use by everyone on the computer.
    • In Mathematica, I then made one important change to the Global Options in the Mathematica Preferences: In Global Options / Data Import/Export Options / To Postscript Options, I un-checked the box next to "IncludeSpecialFonts". You may not want to do this because then other programs like Preview will sometimes not display all the fonts properly. But for Illustrator, the font inclusion is in fact a bad thing. So if you don't disable font inclusion globally, then you should specify it on a case-by-case basis as shown below.
    • In Mathematica, generate any kind of graphics you wish, then export it as an EPS file (Export["test.eps",%, ConversionOptions -> {"IncludeSpecialFonts" -> False}]). The ConversionOptions -> {"IncludeSpecialFonts" -> False} part can be left out if you have set the global option in the previous step, otherwise you need to include this option in the Export command.
    • Now the EPS file without included fonts can be opened by Adobe Illustrator (either from the file menu or by dragging the file onto the Illustrator icon, or any way you like), and the Mathematica fonts should all be there, including greek letters etc. This will work provided that all the fonts you are using in the Mathematica output are also available in Illustrator.
    An example plot in Mathematica:

    The result in Illustrator:

    This is a random item from my thermodynamics lecture, and the formula in the plot uses various different fonts, including FontFamily → "Helvetica Neue" for the Latin text. Bold Italic and simply Bold weights appear (by accident, but it's good as an example). The formula is actually rendered better in Illustrator.

    If you have included all fonts with your EPS file, then Illustrator seems to be unable to display the fonts. This is probably due to a different font encoding that Mathematica uses in the embedded fonts (Illustrator is really the one to blame here). However, you can display these files using different programs:

    • Instead of opening this file with Adobe Illustrator, open test.eps with Preview.app (Apple's built-in PDF viewer).
    • Then select "Copy" from the Edit menu (or press CMD-C).
    • Now switch to Adobe Illustrator and paste the graphics into your Illustrator document. There may be a message saying that some fonts have been converted to outlines. Also, I found that Greek letters do not always show up although math symbols (e.g. integrals) do. Interestingly, this does not occur when pasting into Keynote. However, for the example file in the screen shots above, the route via Preview worked just as smoothly as the first method.
    In summary, therefore, exporting from Mathematica to Illustrator works flawlessly if you make sure not to include special fonts in the exported file by setting the corresponding option as described above. To reiterate this point: you can use all the special fonts in your plot, but do not embed them in the exported EPS file so that Illustrator can instead look them up on its own among the Mathematica (and other) fonts it has available.

Other graphics software

There are many other graphics programs, and here are my favorite free ones:

Bitmap-oriented software
With these kinds of programs, you don't have to worry about fonts as long as you provide your plots in bitmap form (e.g., jpeg exported from Mathematica).
  • GraphicConverter has been around as shareware since the days of the Classic Mac, and it's one of the best tools ever made. On newer Macs, it is pre-installed and free. If you don't have it, it will cost a shareware fee unless you are willing to endure a lengthy countdown before the program starts.
  • Seashore is a lean but very useable Mac OS X freeware application that allows you to draw simple images using layers and transparency. It can use all the installed fonts, and has some degree of compatibility with the Gimp (described below).
    Seashore is especially useful in tandem with Apple's Keynote, because the latter has no bitmap drawing tool of its own: Two screen shots should convince you that Seashore is a decent fix for this:
    In Seahore, select and copy:

    In Keynote, paste into a slide:

    In words: using Seashore, bitmaps as the "font-safe" alternative can easily be integrated into the workflow. Seashore is not as feature-rich as some other X11-based applications (see below), but it's ease of use in a Mac OS X environment can't be surpassed.

  • ImageMagick is like an X-window counterpart to GraphicConverter, but is actually a whole set of tools that I often use from the command line and in scripts. In particular, its 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 recently emerged is that convert lost its ability to crop images automatically. Here is a workaround for this.
  • The Gimp is an extremely powerful graphics manipulation package, comparable to Abobe's Photoshop. Calling this a tool would be an understatement. I started using Gimp on UNIX machines in 1997, initially because graphics editing on my little Mac sometimes exhausted the memory capacity. Gimp was ideal back then because it handles layers and transparency. It's a collossus of a program, and can do extremely intelligent things to your bitmap images. But it has a steep learning curve and handles sluggishly on smaller Macs.
Vector-graphics software
The programs listed below run in the X-window environment, and can handle fonts to a certain extent. It's just a bit more work to make sure Mathematia and other fonts are also installed in the proper X11 font directory. The maturity of open-source graphics software is impressive. As mentioned above, you get all this through fink.
  • Inkscape is almost an Adobe Illustrator replacement. It's got pretty good support for text annotation, but I do have problems with missing fonts sometimes. The user interface is sluggish on a 1 GHz Powerbook, but there's no problem if you're on a 2.5GHz G5. 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.
  • Skencil (formerly Sketch) is a nice-looking vector drawing program. It imports Xfig format - something Inkscape can't do (not a big deal because it's easy to convert from Xfig to other formats). This program has a smaller footprint and works more smoothly. For most people Skencil will likely be the better solution because it's faster and does the job.
  • Sodipodi has a slightly different user interface philosophy, in fact it reminds me more of the Gimp (the right mouse button wields immense power). I particularly like the way it corrects for jitter during free-hand drawing. Your free-hand lines are directly turned into smoothed curves with adjustable control points.
These three are quite usable for general illustration tasks, and all of them are especially suitable for producing scalable vector graphics (SVG) format. The first two also import other formats such as EPS. It's perhaps a matter of taste which of these two you like better. The third one (sodipodi) is very comparable except for its more limited import/export capabilities. I recall that both Skencil and Inkscape had trouble importing Adobe Illustrator's .ai format (even though they bth can supposedly read it). So in practice the transfer of vector graphics between these programs will probably best be done via the EPS or SVG formats. I guess I should include Xfig in the discussion, too (it can use LaTeX fonts). But I'm skipping that one here because I think it's just too old-fashioned.

noeckel@uoregon.edu
Last modified: Wed Apr 27 23:16:58 PDT 2005