If you want to install latex on your Mac you have two most common options - install Full MacTeX or smaller distro - Basic TeX. See package listing here. The first option is easy, but package weights few gigabytes of data you probably won’t use anyway. The second one might be problematic for latex newbies like me, so here are some scribbles that hopefully might help someone.
You can install BasicTeX directly from the console if you have homebrew installed via
brew cask install basictex
.it comes with
tlmgr
- the native TeX Live Manager and probably you will need to install some missing packages viasudo tlmgr install <package>
. I suggest installingcollection-fontsrecommended
right away. Extra tip: if you will encounter something likePackage fontenc Error: Encoding file 'ly1enc.def' not found. (fontenc)
just installly1
package to solve it - it wasn’t obvious to me at first. You can look up packages online here.I had to manually modify
PATH
on my fish shell after installation by addingset PATH /Library/TeX/texbin/ $PATH
in~/.config/fish/config.fish
(reload shell and check if you can usepdflatex
for example).You can compress generated pdfs further via Ghostscript (code stolen from stackoverflow):
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
or you can check out pdfsizeopt.