34

I am doing a thesis on graph theory, and I am currently drawing graphs with Illustrator. Vertexes and edges are easy to draw, but how about naming them? How do I get the symbols in image look like symbols in the text?

1
  • AFAIK there once (years ago) was a special plugin for Illustrator for this. Jan 9, 2013 at 16:06

12 Answers 12

21

I totally, totally feel your pain.

When I was writing my dissertation on string theory I encountered the same issue. I managed to develop a pipeline which seems to work quite well:

  1. Draw your graphs/images in Illustrator.
  2. Use http://latex2png.com/. Type your latex equation in there, then preview at 2000 dpi.
  3. Save the image, then load into Illustrator. Alternatively, you can speed things up by using a screencapture software (e.g. ShareX) so you can skip the image saving+loading process.
  4. When in Illustrator, select your imported equation image and choose Object --> Image Trace --> Make and Expand. It is very important to obtain a high dpi image for this step to work favorably.
  5. Your equation should now be a vector graphic.
  6. Select your new vector graphic equation and choose Object --> Ungroup. This will separate the white spaces in your equation from the black content that you need.
  7. Select the white spaces and delete them.
  8. You now have a fully editable equation looking exactly like it does in Latex. You can scale/adjust and colour to your requirements.

Using these same steps, I have managed to create things like in the images below: enter image description here enter image description here enter image description here

Hope that helps,

Hassan

7
  • I really liked this solution. Thank you for sharing it! Jul 14, 2018 at 23:24
  • But this way, the latex fonts are not embeded, are they?
    – le4m
    Oct 1, 2019 at 9:22
  • This graphs and images are awesome!! How can I draw this in illustrator? The effect of light and shadows? Can you recomendme some tutorial or link about this? Sorry for the off topic Apr 2, 2021 at 13:06
  • I would love to know how did you draw these manifolds..
    – gipouf
    Jul 21, 2021 at 9:43
  • For those who are interested: youtube.com/watch?v=MZfBhssuGL0
    – gipouf
    Jul 21, 2021 at 10:07
11

I think it's worth mentioning that, if you're using Mac OS X, LaTeXiT solves this problem in a simple, fast way. Open the program, enter your equation, render it and then drag it into Illustrator. Done.

This will only work if you make sure your images export with outlined fonts. To do this, go to the settings panel of LaTeXiT, and change "Export format of images: " to be "PDF with outlined fonts". Like so:

enter image description here

2
7

I use Illustrator a lot and certainly understand your dilemma. As pltuon states, you can get LaTeX fonts into Illustrator but you will not get the capability of LaTeX kerning and other typographic features automatically. It is also possible to write the text in LaTeX and import the pdf into Illustrator and cut and paste the text/equations from the pdf to the Illustrator file, given that fonts are scalable and available to both as stated by Herbert. Nevertheless, I would like you to consider using tikz-pgf as an option. If I understand the types of graphs you try to draw they would be well suited for tikz-type drawings.

6
  • I am looking at importing of fonts atm, but not fully successfull yet. Do you happen to have a tested method of doing this? Jan 28, 2013 at 15:41
  • @OhtoNordberg May be you could look at LaTeXIt or something similar, which let you create formulas and export them to little pdfs, and if you want to edit them, just drop it again in LaTeXIt and you could edit it.
    – Manuel
    Jan 30, 2013 at 11:33
  • @Manuel How do I get fonts or symbols used in LaTeXit into Illustrator? And finally to the finished PDF including the images, which have same symbols as the equations? Jan 30, 2013 at 11:50
  • 1
    @OhtoNordberg Here it is the official page. There it explains how it works. I don't know if this is what you want but may be a workflow could be that way. You type the equations in LaTeXiT, it gives you an small pdf (may be containing only one letter), you put manually that pdf in Illustrator. I meant use LaTeXiT to avoid the problem of using the fonts in Illustrator.
    – Manuel
    Jan 30, 2013 at 12:01
  • @Manuel Yes I see your point now. Is that essentially someway different from taking screenshots of say DVI containing the symbol and copying that to Illustrator? Jan 30, 2013 at 12:06
6

The fault seems to be at the Illustrators (CS4) end. I do have the fonts embedded but Illustrator is not able to use them:

Fonts are embedded, enter image description here

but Illustrator cannot use them.

Illustrator cannot use them

I did find an alternative way of doing this, although it is not fully satisfactory either:

  1. Create new document in Illustrator
  2. Drag the pdf in.
  3. Select from menu Object - Flatten transparency
  4. Select "Convert All Text to Outlines".
  5. Now you can copy the symbols you need.
5

I had the same problem. Here is a summary of how I tackled this issue in Windows 10, using Adobe Illustrator CC 2018, and MikTeX.

  1. First you need to import LaTeX fonts to Adobe (cf. (How do I edit PDF files produced by LaTeX in Illustrator? Fonts are not found). For MikTeX 2.9, TEXMFDIST is at

     C:\Program Files (x86)\MiKTeX 2.9\fonts\type1\public\amsfonts\cm
    
  2. Copy all the pfm and pfb fonts to Adobe Illustrator's local font folder:

    C:\Program Files\Adobe\Adobe Illustrator CC 2018\Support Files\Required\Fonts
    
  3. Then, write your equations in LaTeX, compile, and save as .eps file format. Here is a sample LaTeX format.

    \documentclass[preview]{standalone}
    \usepackage{amsmath}
    \begin{document}
    \thispagestyle{empty}
    $Put your equation here!$
    \end{document}
    
  4. Import your .eps files to Illustrator and it should work.

If you do not like the hassle, as others suggested, you might want to use tikz-pgf which might or might not save you some time!

1
4

Use a font with Illustrator which is also available as Type 1 for TeX, eg. Lucida, DejaVu, Libertine, ... If you can use XeTeX or LuaTeX then you can use for both the same OpenType version.

4
  • Which one is of Illustrator's fonts is looks most like TeX mathematical font? Can an occasional reader be fooled? Jan 10, 2013 at 10:03
  • 1
    you can copy the OpenType fonts of Latin Modern Math from $TEXMF/fonts/opentype/public/lm-math/ to your system font folder. OR you can use STIX mathfont with Illustrator and XITS Math with LuaTeX/XeTeX
    – user2478
    Jan 10, 2013 at 10:08
  • Lucida Calligraphy Italic seems close enough, thanks. If/when I find a better solution, I will post it here. Jan 10, 2013 at 12:28
  • Fonts I found useful are: Asana Math, MathJax_Main-Regular, CMU Serif Italic, CMU Classical Serif Italic, CMU Serif Roman, Myriad Pro.
    – voices
    Jun 29, 2019 at 17:46
4

You can use this amazing script! https://github.com/mkuznets/latex-illustrator

There's no real installation. Simply put the script in your Adobe Scripts folder (or anywhere else), open it from File -> Scripts and write your LaTeX code. It'll immediately get compiled and exported to Illustrator in a way that allows it to be edited within Illustrator.

I've only tested it on Windows 10 with PDFLatex, but I would think that it works on other systems as well.

1
  • Had a quick look at the code. It appears to be Windows specific. Probably won't be too difficult to make it compatible with Linux and macOS though.
    – voices
    Jun 29, 2019 at 17:30
2
  1. How to add all your LaTeX fonts to Adobe Illustrator: Copy the hole directory: C:\Program Files\MiKTeX\fonts into the directory: C:\Program Files\Adobe\Adobe Illustrator CC (64 Bit)\Support Files\Required\Fonts (just the hole thing, don't bother looking for the right one)

  2. Write the equations in your LaTeX editor and generate a pdf of it

  3. Open the pdf in Illustrator and copy the math symbols as you want (you can also edit then in Illustrator, since they are imported as text objects)

1

One way would be to use the overpic package.

Another solution would be to make the Latex fonts you are using in your documents available to Illustrator. Things go fast so I may be wrong here but in the past, I had success putting the .pfb kpfonts (a Latex font) files into C:\Program Files\Common Files\Adobe\Fonts. They were then available in Illustrator. One drawback is that all the mathematical signs will be understood if you open a file containing them (.eps file for instance) into Illustrator but you will not be able to have access to them in Illustrator directly from your keyboard (more exactly, I do not know how to achieve that).

5
  • nowadays we have some fonts which are avilable in OpenType and Type~1
    – user2478
    Jan 9, 2013 at 14:46
  • I cannot add fonts to these computers, they are owned by my university and I have no admin rights. Jan 10, 2013 at 10:10
  • @OhtoNordberg you can always ask the sysadmin for this. Since the fonts are licensed free, and available online, it should not be a problem.
    – yo'
    Jan 10, 2013 at 10:13
  • I copied all the fonts from MikTek fonts folder to the folder you mention, which is pretty brutal. It worked, though. Which files exactly should I copy? I cannot find any kp.pfb files. Jan 14, 2013 at 9:50
  • 1
    I put all the .tfm, .afm, and .pbf kpfonts (their name start with jkp....afm for instance) in the previously mentioned folder. Then they are accessible within Illustrator. Now, that I am reconsidering your question, the .afm files may be the ones used by Illustrator.
    – pluton
    Jan 14, 2013 at 14:11
1

To get around the hassle to have to create a pdf all the time, it's also possible to type the text or equation online into here:

https://www.codecogs.com/latex/eqneditor.php

Choose .svg as format and you can simply download the text/equation as svg-Vectorgraphic. Drag and drop into Illustrator and you are ready to go.

0

Searching for *.pfm in the texlive (or miktext) folder and dragging the found font files into C:\Windows\Fonts allows Illustrator to find most latex fonts and makes it possible to create figures with formulas/symbols.

0

Although Hassan M has already given a perfect solution, I share another perspective.

We can use a software called klatexformula, which can generate eps figures based on latex equation formulation.

Then we can insert the eps files into Ai.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.