Note: This guide is designed specifically for Macs with Apple Silicon chips (M1, M2, M3, etc.). If you are using a Mac with an Intel CPU, please be aware that this guide may not be fully compatible with your system.
Follow these steps to install Asymptote on your Mac. This guide assumes you're starting from scratch, without Homebrew or MacTeX installed.
If you already installed Homebrew, you can proceed with step 2 (or step 3, if Homebrew is already working on your machine).
Homebrew is a package manager for macOS that simplifies the installation of software.
You can read more about it on the official Website brew.sh or on Githubhomebrew
-
Open the Terminal app.
-
Paste the following command and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
You may be prompted to enter your password. Go ahead and do so.
-
Wait until the whole installation process is finished.
Let's make sure Homebrew is properly installed.
-
Restart your Terminal (you can do this by closing it with the keys
CMD+Q
and opening it again). -
Type
brew
and press Enter to check if Homebrew commands are recognized.-
If you see a list of commands and how to use them, proceed to Step 3.
-
If not, enter the following command to add homebrew to your PATH Variables:
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
Then, restart your Terminal again (
CMD+Q
) and check if the commandbrew
is working now. If it still doesnt work, please make sure you installed homebrew properly. -
MacTeX is a distribution of TeX/LaTeX for macOS. Asymptote works with TeX to produce high-quality technical graphics and comes directly with the installation of MacTeX.
You can read more about it on the official Website tug.org/mactex.
Please note that this installation process can take some time, as it is largely dependent on your network speed. MacTeX requires a download of approximately 6GB. Additionally, ensure that there is sufficient space available on your hard drive before proceeding.
-
Install MacTeX by running:
brew install --cask mactex
-
Enter your password if prompted and wait for the installation to finish.
-
Restart your Terminal (
CMD+Q
) after the installation is complete.
Now, you're ready to install Asymptote.
-
First, check if the
asy
command is available by typingasy
in your Terminal. If it's not recognized, proceed with the next step. -
Add TeX to your PATH by typing the following in command in your Terminal:
echo "export PATH=/Library/TeX/texbin/:$PATH" >> ~/.zshrc
-
Restart your Terminal (
CMD+Q
) and typeasy
again. You should see some text about Asymptote now.
To work with Asymptote and to check if the installation process was successfull, follow the steps below:
-
Open your Terminal and navigate to your desired output folder (for example
cd downloads
to navigate to yourDownloads
folder). -
Try the following command to create a PDF from your
.asy
file. If you dont have one, you can download the example.asy file from this repository, which should only print a circle like in the image below.asy -f pdf example.asy
Note: If you prefer a
.eps
file, you can simple use the following command:asy example.asy
Replace example.asy
with the path to an actual Asymptote file (if its in another folder than your Terminal or has another name).
If you get a PDF output, congratulations, you've successfully installed Asymptote on your Mac! ✅