Skip to content

Instantly share code, notes, and snippets.

@ayushkarnawat
Created October 22, 2019 17:18
Show Gist options
  • Save ayushkarnawat/6b3b3f172c6d7baaad20360b9e364b1b to your computer and use it in GitHub Desktop.
Save ayushkarnawat/6b3b3f172c6d7baaad20360b9e364b1b to your computer and use it in GitHub Desktop.
Tutorial on installing BasicTeX

Installing BasicTeX

This is a barebones setup to using TeX with matplotlib. Since the whole MacTeX package is ~4GB, and includes a lot of unnecessary binaries, it is better to install BasicTeX and install the packages as you seem fit.

The easiest way to install is by running brew cask install basictex and run which pdflatex to check whether it is installed. This should return a path with the location of the filepath. If it doesn't, then check if the /Library/TeX folder exists.

Finally, add the following to your ~/.bashrc or ~/.bash_profile filepath: export PATH="/Library/TeX/texbin/:$PATH"

Adding packages

Now that you have installed BasicTeX properly, you need to install/add the following packages that matplotlib needs in order to generate the figures properly.

  1. type1cm
  2. dvipng
  3. etc.

These can be installed using tlmgr install <pkg-name>. Use sudo tlmgr install <pkg-name>if permission is denied.

@abir108
Copy link

abir108 commented Mar 12, 2024

Thanks, it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment