LaTeX is a very useful editor for writing scientific papers or theses that contain mathematical symbols or formulae. It is usually not pre-installed on OSX, but installation is straightforward.

Downloading LaTeX

The official LaTeX website recommends using the MacTeX distribution.

Go to the MacTeX website and download either the full MacTeX or the smaller BasicTex

MacTeX or BasicTex?

The full MacTeX installation file can be 2-3 GB (yes, gigabytes), so could take a while to download, depending on your internet connection. On the plus side, it is fairly comprehensive.

The smaller BasicTex option is only around 100 MB, so it could be worth starting with that if you want to get going, while you wait for the MacTeX download to finish.

If MacTeX download is very slow

If your download is very slow, even though you have a good internet connection, consider choosing the download mirror manually.

This page has instructions, after choosing an http mirrow from the CTAN mirror page. In short:

  1. Choose a mirror close to your location that has an http link. For example, if you are in the UK, there is the mirror http://mirror.ox.ac.uk/sites/ctan.org/
  2. Click on the systems link. It will take you to a page that looks like a directory listing.
  3. Search for the mac folder and click on it
  4. There may be a mactex subfolder, or the MacTeX.pkg file will be in the mac folder itself. You should see the size next to the file as something like 2.9 G. Download the MacTeX.pkg file to your computer.

Installing MacTeX

Go to the folder (e.g. ~/Downloads) that contains the downloaded MacTeX.pkg file. Double-click on it and follow the prompts to install.

Modifying the bash_profile

In order for OSX to find the new LaTeX, you need to add its path to your ~/.bash_profile file. The following commands accomplish this (although you may need to modify the path slightly - please check!):

echo "# LaTeX path: " >> ~/.bash_profile
echo "export PATH=/usr/local/texlive/2017/bin/x86_64-darwin:\$PATH " >> ~/.bash_profile

And then run:

source ~/.bash_profile

That's it, enjoy using LaTeX!