[Tex/LaTex] Why is the MacTeX distribution so large? Is there anything smaller for OS X

distributionsfile sizeinstallingmactextexlive

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?

Best Answer

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.

BasicTeX

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.

Installing Additional Programs

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.

Install the MacTeX Additions

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.

Do it Buffet-Style

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.

Installing Missing TeX Live Components

Missing Packages

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:

    1. Enter the <pkgname> into the search field.
    2. Select the package in the main window.
    3. Click install.
  • 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:

    Searching by package description.

    In this case searching for pdflscape bring up a few results- choose the one that matches the package name:

    Search results.

    Find the pkgname to use with tlmgr:

    Package info.

    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.

Missing Fonts

Coming soon.

Related Question