LaTeX2AI is a plugin for Adobe Illustrator (MacOS and Windows) that enables the use of editable text labels typeset in LaTeX inside an Illustrator document.
LaTeX2AI is under the MIT license, see ./LICENSE. If you use LaTeX2AI to create figures for your work, please acknowledge it with a link to the GitHub repository. For example:
Feel free to leave a :star: on GitHub. You can also add your work to Work that uses LaTeX2AI.
The following software dependencies are required to run LaTeX2AI:
Download LaTeX2AI from the GitHub release page
Unzip the file
Copy the user interface folder
com.isteinbrecher.latex2ai
to ~/Library/Application Support/Adobe/CEP/extensions/
com.isteinbrecher.latex2ai
to /Library/Application Support/Adobe/CEP/extensions/
com.isteinbrecher.latex2ai
to C:\Users\<USERNAME>\AppData\Roaming\Adobe\CEP\extensions
(the directory might have to be created by the user)com.isteinbrecher.latex2ai
to C:\Program Files\Common Files\Adobe\CEP\extensions\
Copy the native plugin
macOS/LaTeX2AI.aip
to an arbitrary directory. This directory has to be set as the Adobe Illustrator Plugin directory via Edit/Preferences/Plug-ins & Scratch Disks.../Additional Plug-ins Folder/
macOS/LaTeX2AI.aip
to /Applications/Adobe Illustrator <YOUR VERSION>/Plug-ins/
WIN/LaTeX2AI.aip
to an arbitrary directory. This directory has to be set as the Adobe Illustrator Plugin directory via Edit/Preferences/Plug-ins & Scratch Disks.../Additional Plug-ins Folder/
WIN/LaTeX2AI.aip
to C:\Program Files\Adobe\Adobe Illustrator <YOUR VERSION>\Plug-ins\
After a restart of Adobe Illustrator, you can display the LaTeX2AI tools with Window/Toolbars/Advanced
.
To uninstall LaTeX2AI, delete the files you copied.
LaTeX2AI adds four buttons to the main toolbar:
.ai
document as a .pdf
document with the same name. The LaTeX2AI labels are included into the created .pdf
document.These buttons are the main way of interacting with LaTeX2AI. Additionally, double clicking on a LaTeX2AI label will enable the edit mode for that label.
The following form appears when creating or editing LaTeX2AI labels:
This option defines how a label behaves when it its size changes.
Take for example the well-known formula $\sum_{k=0}^{\infty}\frac{x^k}{k!}$
which is placed inside a rectangle:
The green box indicates the size of the LaTeX2I label and the dot describes the placement of the label. If the size changes due to a change in the LaTeX code, the position of this dot relative to the label will stay the same.
If the previous label is now changed to \displaystyle
we get the following result:
The size of the label changed due to a change in the underlying LaTeX code, but the position (the indicated dot) stayed the same.
Additionally, there is the possibility of a baseline placement. This will result in a label where the baseline is exactly in the vertical center of the label. This label can now be easily adjusted and snapped to align with another baseline label or Illustrator text:
Per default, LaTeX2AI places the LaTeX labels inside Illustrator with a scale of 1:1, i.e., 1pt in the LaTeX label is 1pt in the Illustrator document. For example, if the LaTeX item is created with a font size of 12pt the font will match Illustrator text with 12pt. The user can resize the labels like any other Illustrator object, however, be aware that every time the LaTeX code of a label changes, the scale is reset to 1:1.
The recommended way of using LaTeX2AI is to always have items at a scale of 1:1.
By doing so, the exported Illustrator document can be simply included into a LaTeX document with the \includegraphics
option scale=1
, and the font size of the labels in the figures will exactly match the font size of the document (assuming that the header options are the same).
With the LaTeX2AI tool Redo items, one can easily reset the scaling of all LaTeX2AI items in the document.
LaTeX2AI assumed that all Illustrator files in the same directory use the same LaTeX header LaTeX2AI_header.tex
(if no one exits in the directory, it will be created the first time it is needed).
This header can be edited to include packages and macros needed for the labels.
The .pdf
files for the LaTeX labels are stored in the links
subfolder of the document directory.
It is not required to keep track of the files in the links
folder, LaTeX2AI manages and deletes unused label files.
LaTeX2AI currently does not work if there are non ASCII characters in the document name or full document path.
LaTeX2AI currently does not work with Creative Cloud documents. However, if the document is stored in the Creative Cloud Files folder on the disk, LaTeX2AI should work as expected.
If you are interested in contributing to LaTeX2AI, we welcome your collaboration. For general questions, feature request and bug reports please open an issue.
If you contribute actual code, fork the repository and make the changes in a feature branch.
Depending on the topic and amount of changes you also might want to open an issue.
To merge your changes into the main LaTeX2AI repository, create a pull request to the develop
branch (this branch will be merged into main
with the next release).
A few things to keep in mind:
./src/tests
).python3
script ./scripts/check_license.py
to ensure that all added source files have the correct license header.clang-format
to format the C++ code.
Make sure to apply clang format to the changed source files:
Crtl-K
followed by Ctrl-D
.find src -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i
Instructions on how to build LaTeX2AI from source can be found here
A detailed changelog can be found here