I would like to know how to install LaTeX on Mac 10.6 or higher.
But the MacTeX is some 1.28 GB file! Is there a smaller distribution I could install?
What exactly is TeX Live?
MacTeX (and by extension TeX Live) are so big because they contain everything up to, and including the kitchen sink, then heaps on yet more stuff. Odds are, out of that 1.3 GB archive you will only use 300-400 MB worth of files on a regular basis. This is similar in size to an application like OpenOffice.
There is an alternative to downloading and installing a 1.3 GB TeX distribution if you are using Mac OS X.
One thing that hasn't been mentioned here, or in I want to start using LaTeX on a MacOS. Where do I start? is that MacTeX is available in a "Lite" edition called BasicTeX that has been stripped down to ~90 MB.
The trade-off that comes with using BasicTeX is that you will have to download and install additional packages and programs as the need arises- and BasicTeX is so basic that the need will arise. Unfortunately this is a lot more difficult for first time users than it really has to be. MikTeX has been delighting TeX newcomers on Windows for years by automagically installing missing packages as they are needed.
So, after installing BasicTeX you will be faced with the tasks of installing additional programs and installing missing packages.
The components of TeX Live installed by MacTeX and BasicTeX includes TeX compilers and associated macro-systems such as LaTeX, ConTeXt and their add-on packages and modules. These programs are command line based and focus on turning .tex
files into output such as PDF documents- they leave the details of creating .tex
and associated files up to the user.
MacTeX includes additional programs such as an editor and a BibTeX reference manager that help users to work with TeX outside of the command line. BasicTeX does not include these GUI programs. There are two ways to add GUI support to BasicTeX.
Go to the page where BasicTeX is available for download and download the mactex-additions package. Installing this package will provide all the GUI programs that are included in MacTeX but excluded from BasicTeX.
Since the whole point of installing BasicTeX over MacTeX was to avoid downloading things we never use- you can install the GUI programs yourself by mixing and matching to your liking. Here are some things you may want:
The TeX Live Utility. You will want this- it provides a nice GUI to tlmgr
which is the command line program that installs additional packages for TeX Live. This is how you will add missing packages that are required by LaTeX documents.
A nice editor. Choosing an editor is like choosing a religion so you may want to weigh your options. MacTeX includes TeXShop which is a nice Mac-only editor for .tex
documents. TeXworks is similar but also works on Linux and Windows.
The universe of TeX-aware editors is covered in detail by this question.
A program for managing BibTeX entries. BibTeX is a wonderful component of TeX Live that makes the creation and formatting of bibliography entries a breeze. Unfortunately, creating BibTeX input files introduces yet another learning curve. This problem is solved by programs that create the files for you given information such as titles, author names, publications, etc. MacTeX includes BibDesk which is an excellent Mac-only program for managing BibTeX entries. Another good choice is JabRef which is cross-platform.
You will know there is a missing package when you attempt to compile your document and compilation stops with an error message that looks like this:
! LaTeX Error: File `multirow.sty' not found.
Type X to quit or to roceed, or enter new name. (Default extension: sty)
Enter file name:
In this case, LaTeX is trying to load a package named multirow
but cannot find multirow.sty
which is the file that contains the code for the package. To install missing packages, you can try the following things:
Try to Install Directly Using tlmgr
:
This is the "hope-you-get-lucky" approach and it works 90% of the time. Just open the command line and type:
tlmgr install pkgname
Where pkgname
is the missing package that LaTeX was complaining about. In the example above, LaTeX complained about multirow.sty
- the package name is the part before .sty
so the command would be:
tlmgr install multirow
You can also use the TeX Live Utility. Open the application and click on the "Manage Packages" tab. Then:
<pkgname>
into the search field.Using tlmgr
to locate a file:
Sometimes, you type in the package name and tlmgr
tells you package <pkgname> not present in package repository.
or nothing shows up in the TeX Live Utility as a match for your search. In these cases, you may be dealing with a package that is part of a "bundle". A "bundle" is a group of packages that are known to tlmgr
by a single name so that they will always be installed together. A good example is the pdflscape
package.
In this case the tlmgr
comes to help again, as it allows to search the database for packages as well as files. If you are searching for a specific file, the best way is to use
tlmgr search --file <filename>
or in the previous case we would have
tlmgr search --file pdflscape.sty
which returns
oberdiek:
texmf-dist/tex/latex/oberdiek/pdflscape.sty
The same can be achieved in the GUI started with tlmgr gui
by selecting under Match
only the filenames
and enter the file name.
The search command is very powerful and allows to search for package names, descriptions, file names, and also various taxonomies. A look into the output of the tlmgr help
or in the GUI the Help -> Manual
entry will teach many more things.
Using CTAN:
Another way is to use the "Search the package descriptions" feature on CTAN to lookup the package name:
In this case searching for pdflscape
bring up a few results- choose the one that matches the package name:
Find the pkgname
to use with tlmgr
:
For a bundled package, the correct name to pass to tlmgr install
or put into the TeX live search box is the name that comes after /macros/latex/contrib/
in the "Location on CTAN" field. For the pdflscape
package, oberdiek
is the name of the bundle that contains it.
Coming soon.
collection
packages. For instance, I had trouble with a missing pzdr
before, and the solution was to install collection-fontsrecommended
.
sudo tlmgr install collection-fontsrecommended
.
texliveonfly
's wonderful functionality.
This is really just a comment on Sharpie's answer, but I don't have the reputation to comment yet. If tlmgr install <pkg>
doesn't work, try tlmgr search <pkg>
as a way of automating the CTAN search (or tlmgr search --global --all <pkg>
, if you really want to go wild). Here's a recent example that cropped up for me when trying to compile a file that contained \usepackage{epic}
:
$ tlmgr install epic
...
tlmgr: cannot find epic
$ tlmgr search epic
eepic - Extensions to epic and the LaTeX drawing tools.
tlmgr search
somewhere else—I'd somehow managed to miss it on every pass through the documentation—and was pretty sure that I'd forget about this question by the time that I had enough reputation for a comment.)
MacTeX is, as the other answer says, basically TeX Live with a few extras. The extras are things like TeX Shop, a Mac-only TeX editor. The reason TeX Live is so big is that there are a lot of LaTeX packages, and most have documentation in PDF format. It's actually this documentation that takes up a lot of the space. You can install only part of TeX Live, but the standard settings are to install everything. That's because everyone's requirements are different, and it would be very confusing if beginners were told 'load package xxx' and found that it was not installed, but was in TeX Live.
You can install TeX Live directly on a Mac, rather than downloading MacTeX. The later is Mac-like installer, whereas if you use the raw TeX Live installer you need to use the Terminal and acept that it is a Unix application. However, there is a small TeX Live installer that will download the packages you decide to install as the installation runs, and so can keep down the amount of downloading.
tlmgr
can remove it but the versions you find online may not match the code you have installed
Little late to the party but if you want to easily install mactex with varying degrees of bloat you can use the package manager home-brew to install one of the following:
There are three versions of MacTeX.
Full installation: brew cask install mactex
Full installation without bundled applications: brew cask install mactex-no-gui
Minimal installation: brew cask install basictex
You can also use an online LaTeX editor like ShareLaTeX which requires no installation
If the main concern is size, you can start with the essential packages by using the download links here http://www.tug.org/mactex/2009/morepackages.html
I would suggest that you also download "TeX Live Utility.app". It is a great tool for beginners. You can automatically search/download/update packages when you need them later using this graphical tool.
A nice alternative I found recently is https://tectonic-typesetting.github.io/en-US/. What tectonic
does is that it is a standalone that will compile a given latex project taking care of downloading dependencies needed specifically for that project. So this way you never need to install a large latex distribution.
Have a look at TinyTex:
What is the size of TinyTeX? About 84MB on macOS and 66MB on Linux (gzipped), and 99MB on Windows (zipped).
sudo apt-get install texlive-full
saysNeed to get 1,012MB of archives. After this operation, 1,805MB of additional disk space will be used.
Although for any given person many of the packages would be useless, it's really convenient to just install MacTeX and forget about having to hunt for packages in the future.