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"
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.
- type1cm
- dvipng
- etc.
These can be installed using tlmgr install <pkg-name>
. Use sudo tlmgr install <pkg-name>
if permission is denied.
Thanks, it works!