[Tex/LaTex] How to edit PDF files produced by LaTeX in Illustrator? Fonts are not found

fontsillustratorpdf

When I try to use Adobe Illustrator (CS4) to edit a PDF file produced by LaTeX with several equations in it, Illustrator complains that it can't find the fonts:

The font CMBX10 is missing.  Affected text will be displayed using a substitute font.
The font CMMI10 is missing.  Affected text will be displayed using a substitute font.
The font CMMI6 is missing.  Affected text will be displayed using a substitute font.
The font CMMI7 is missing.  Affected text will be displayed using a substitute font.
The font CMMI8 is missing.  Affected text will be displayed using a substitute font.
The font CMMIB10 is missing.  Affected text will be displayed using a substitute font.
The font CMR10 is missing.  Affected text will be displayed using a substitute font.
The font CMR7 is missing.  Affected text will be displayed using a substitute font.
The font CMSY10 is missing.  Affected text will be displayed using a substitute font.
The font CMSY6 is missing.  Affected text will be displayed using a substitute font.
The font CMSY7 is missing.  Affected text will be displayed using a substitute font.
The font MSBM10 is missing.  Affected text will be displayed using a substitute font.
To preserve appearance, some text has been outlined.

How do I find & install the necessary fonts?

Best Answer

Moving fonts

As Patrick Gundlach and pluton suggest, you can just make the fonts available to Illustrator. They're in your system's texmf, which you can find by running

kpsewhich -var-value TEXMFDIST

For TeX Live 2011, $TEXMFDIST is by default at

  • Windows: C:\texlive\2011\texmf-dist
  • OS X: /usr/local/texlive/2011/texmf-dist

All the CM* fonts are at $TEXMFDIST/fonts/type1/public/amsfonts/cm, and the MS* fonts are at $TEXMFDIST/fonts/type1/public/amsfonts/symbols. You can install these as system fonts if you want to. But if you don't want to clutter your system fonts, you can copy all the pfb and pfm files to Adobe's local font folder:

  • Windows: Program Files\Common Files\Adobe\Fonts
  • OS X: Library/Application Support/Adobe/Fonts

If you don't actually have TeX, there's also an incomplete collection of TeX fonts here.

XeLaTeX

For easy compatability with Illustrator, you can use XeLaTeX and fontspec to write your LaTeX document in a font available to your system. For math, download a Unicode math font and use it with unicode-math.

Minimal example:

\documentclass{article}
\usepackage[no-math]{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times LT Std}
\usepackage{unicode-math}
\setmathfont{XITS-Math.otf}

\begin{document}
This is some text\par
This is some text with numbers 01234567\par
\[\left(\frac{\omega^2\rho}{\hat{\jmath}}\right)=\int \sqrt{\mathcal{M}(f)}\;dx\] 
\end{document}

Bonus: Your PDF will be tiny.
Downside: Math spacing issues introduced with unicode-math. Limited microtype support.

Other solutions

If you want to guarantee that Illustrator won't mess up your LaTeX document's formatting...

This page suggests using Ghostscript to outline all text on the page:

gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=nofont-Myfile.ps -q -dbatch         -dNOPAUSE Myfile.pdf -c quit

You can also do that in Illustrator, as shown in this video. But this means you can't edit the text – just reposition elements. It will also probably inflate your PDF's size quite a bit.

If you just want to draw on top of the LaTeX document, you can make a new PDF in Illustrator and Place the LaTeX PDF in the background, as in the first part of that video. Make your doodles, remove the background, save the PDF, and overlay it on one of your LaTeX document's pages using \includegraphics.