When I started using a unix based system it was very natural to install MacTeX, since the installation of it is more "windows-like", though the installation package is huge. Later I was introduced to MacPorts, and recently Homebrew, which also provide easy ways of installing LaTeX on my system. However, I find myself unable to distinguish the practical differences between these alternatives and argument for using one or the other.

  1. Does MacTeX, MacPorts and Homebrew provide different versions of LaTeX?
  2. Downloading and maintaining tex-libraries with MacTeX is quite easy and automatized through the TexLive utility. Are there similar solutions if one choose to install LaTeX with MacPorts or Homebrew?
  3. Are there advantages/disadvantages with using one or the other solution?
  • In my case, always I installed TeXLive from macports I've got errors (something works from terminal, but not from TeXWorks, TeXShop, TextMate, …). Moreover, it will take longer to install from macports than the MacTeX installation. About homebrew, never used it. – Manuel Feb 7 '13 at 13:05
  • 2
    I haven't used homebrew but most linux-like package managers are not ideal for installing and updating a TeX distribution because of a fundamental misunderstanding about what a TeX "package" is. See Adding a CTAN package to a MacPorts-maintained TeX install for some discussion. – Alan Munn Feb 7 '13 at 13:12

It is possible to install MacTeX with homebrew using Homebrew Cask via

$ brew tap caskroom/cask
$ brew cask install mactex

Since that basically downloads the MacTeX.pkg from ctan it should not be different from the usual manual installation.

If you would like to install without the GUI, you can

$ brew cask install mactex-no-gui

[edit] Homebrew 2.2.6

Skip the brew tap caskroom/cask or the following error occures:

Error: caskroom/cask was moved. Tap homebrew/cask-cask instead.

If you do what it's says, you will get:

Error: caskroom/cask-cask was moved. Tap homebrew/cask-cask-cask instead.

You can continue to do what it tells you, until you realize that you should look for help online. I think it is a fun, yet unhelpful error message, maybe there is a good reason for it. Just go ahead and do

$ brew cask install mactex

Edit 2021

brew has once again changed its syntax for this. You should now be using

$ brew install --cask mactex
  • It's a workaround, although in comments about dropping the Homebrew formula itself MacTex is the recommended approach - see comments in the issue linked in the comment above: github.com/mxcl/homebrew/issues/1087 – Dave Everitt Aug 31 '15 at 11:41
  • 1
    is that not just another level of indirection ? – nicolas Dec 27 '15 at 10:34
  • 9
    The only benefit here is remembering that you have it installed on your system, and having an easy, one-command way of uninstalling it again later: brew cask uninstall mactex. – ELLIOTTCABLE Jan 21 '16 at 3:25
  • 1
    (The basictex package is also available.) – ELLIOTTCABLE Jan 21 '16 at 3:26
  • 2
    You don't need the brew tap command any longer as mentioned here: stackoverflow.com/a/58337898/5048095 brew cask install mactex should work right away – Jeroen Boeye Jan 23 '20 at 13:10
  1. Homebrew does not provide any version of LaTeX:

    $ brew search latex
    latex-mk     latex2html   latex2rtf    pplatex      rtf2latex2e
    If you meant `latex' precisely:
    Installing TeX from source is weird and gross, requires a lot of patches,
    and only builds 32-bit (and thus can't use Homebrew deps on Snow Leopard.)
    We recommend using a MacTeX distribution: http://www.tug.org/mactex/

    Macports' texlive port and MacTeX are both based on the latest TeXlive distribution, MacTeX is very complete (https://www.tug.org/mactex/whatsinthepackage.html) whereas you have much more granularity with all the texlive-* ports of macports (https://www.macports.org/ports.php?by=name&substr=texlive).

  2. With macports, all the above mentioned packages can be installed/updated through the usual port install and port update commands. However, if you need a package that is not pre-packaged by macports then you get absolutely no help (but I doubt that there are many).

  3. I used to use the macport-based texlive distribution, since it allowed me to avoid downloading stuff I didn't need (BibDesk or Excalibur for instance). Now I'm using homebrew and MacTeX, which is better integrated with MacOS X in general (fonts for instance). Disk-space (bandwidth) vs. integration.

Basically both are good solutions so it mostly depends on what else you do… I switched from macports to homebrew for reasons not at all related to TeX, hence my switch in TeX providers.


I just installed MacTeX with homebrew.

brew install Caskroom/cask/mactex

That provided me with /Application/TeX, containing TeXShop program and the utilities.

However, I am missing the pdflatex tool from command line, and that also produces errors in the TeXShop program:

After searching a little bit around, I found out that the missing utilities were actually bundled with MacTeX, and located in Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin.

Great! I will just create a symbolic link to from that location to /usr/texbin. Turns out that I cannot (even with root), create files in /usr on a modern Macintosh (since El Capitan), because of the System Integrity Protection. I considered disabling it with csrutil, but choose rather to try to symlink the required binaries into /usr/local/bin.

ln -s /Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/pdflatex /usr/local/bin 

Did the trick for me.

*note I found a issue in the brew/caskroom repo that might be related. https://github.com/caskroom/homebrew-cask/issues/20592 Feel free to update this answer if it gets fixed

  • If you want to use TeXShop, just change the Path Settings under Engine in Preferences to /Library/TeX/texbin. – Holene Apr 20 '16 at 8:33

I installed LaTeX with MacPorts as an experiment. It seems to be working really well. I installed the main packages with:

sudo port install texlive texlive-latex-extra

which got most of it and took around 15 minutes.

I like to use TeXShop so I installed that as well:

sudo port install texshop3

which requires some reconfiguration to work with the MacPorts LaTeX. In its preferences, in the Engine tab I change the path for both (pdf)TeX and Distiller (ghostscript) to /opt/local/bin. In the Misc tab I changed the names of the Tex and Latex programs to xetex and xelatex respectively.

(I also changed the default encoding to UTF-8).

Hope this helps.

  • brew cask install basictex is a huge mess. port install is the way to go – Hai Feng Kao Jun 18 '20 at 5:29

Talking about MacPorts:

  1. Are there advantages/disadvantages with using one or the other solution?

Advantage of MacPorts

Its latex integrates better & easier with other MacPorts packages. Especially, if you already use MacPorts, sticking to the MacPorts package makes it easy to maintain your ecosystem (like upgrading / uninstalling dependencies).

Moreover, you can save a lot of disk space by having more fine-grained control over which TeX packages you install. Homebrew-Cask just grabs the whole mactex distribution which can consume ~15GB on disk. With Macports on the other hand, you can consume less than 1GB or just a few GB depending on what you install. It's certainly more lightweight.

Disadvantage of MacPorts

On the other hand, a disadvantage is that some apps cannot find the latex software suit, as @Manuel commented.

I've got errors (something works from terminal, but not from TeXWorks, TeXShop, TextMate, …)

To overcome this, you need to set the (la)tex paths manually. Some apps let you set paths in Settings menu, while for others you may put the correct paths in ~/.profile and launch the apps from Terminal.app.

Another problem, as @Alan mentioned, is that managing packages absent in MacPorts is tricky. I'd install these extra packages inside my user directory to keep them separate from MacPorts.

  • 3
    I could put more information on advantages and disadvantages of MacTex / MacPorts (or Homebrew) if someone thinks its worth. – Dean May 12 '16 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.