With the release of TeX Live 2022 earlier this week, I decided this is a great time to describe how to install a full TeX Live distribution on Macs. I will also go further and describe how to maintain that distribution, keeping packages up to date. Sorry Windows users. I haven’t touched a Windows machine since the early 2000s and can’t address a Windows setup here, but the instructions for you on the TeX Live site should get you up and running in no time.
MacTeX is a full (the 2022 release clocks in at 4.7 GB) TeX Live distribution that includes literally everything you need to begin using TeX and friends. It includes all the current engines, formats, packages from CTAN, and Mac-specific apps for editing and compiling documents. Due to licensing issues, there may be a few packages from CTAN or other sources that cannot legally be included in TeX Live and therefore also cannot legally be included in MacTeX, but they are few in number (think commercial fonts and things like that).
Before getting into the details, I would like to address the question of why one needs a locally installed MacTeX distribution when fantastic online portals like Overleaf exist. I can think of three good reasons. The first is that with so many users around the world, Overleaf must opt for stability over anything else. They usually only update their TeX Live distribution once each year. They also do not update individual packages between annual TeX Live releases, also for stability. As a result, packages with bugs that are fixed after an initial TeX Live release are not updated. Fortunately, there is a workaround for this (which involves manually uploading the desired package to one’s Overleaf project folder). The second is that Overleaf doesn’t support LaTeX package development, which is best done on one’s local computer. The third is that Overleaf doesn’t permit viewing package documentation, which is usually in PDF format. A locally installed MacTeX distribution gives users instant access to the documentation (for everything that has documentation) from either the command line or from inside the included TeXShop editing environment. That documentation also includes the actual source code for LaTeX itself. Finally, let me remind readers that installing MacTeX locally may not be possible in certain academic environments so the instructions here do not apply in those situations. With all this in mind, let’s get started.
- First, read the system requirements on the MacTeX home page and make sure your system meets the requirements. If so, proceed to the MacTeX download page and fetch the current installer. It’s a huge file (currently 4.7 GB) so be patient if you have a slow broadband connection. By default, the installer should be in your Downloads folder upon completion of downloading. It can stay there for the duration of the installation procedure.
- Launch the installer by double clicking on its icon as usual. After a brief validation check, the installer’s Introduction screen will appear. Read everything you see! This may save you from problems later on. Note especially the mentions of included apps (particularly TeXShop and TeX Live Utility) and Ghostscript. After you have read everything on this screen, click the Continue button.
- This is the Read Me screen and I want to emphasize that you should once again read everything you see here, particularly if you use Asian languages. After you have read everything on this screen, click the Continue button.
- This is the License screen. Be sure to at least read the very last paragraph. LaTeX packages are open source but may ask users to comply with certain restrictions. After you have read at least the last paragraph, click the Continue button and then click the Agree button to proceed.
- Now you are at the Installation Type screen. Do not click on the Change Install Location button. I have never had to do this and I strongly recommend letting the installer put things where they’re supposed to be by default. Instead, click the Customize button. This is the first place where you must make some decisions. Ghostscript is installed by default, but note that you can deselect it and it won’t be installed. It’s a library for manipulating EPS files. If you don’t know what that means, or if you know for sure you will never need to deal with EPS files, then you can do without Ghostscript. It only takes up 132 MB or so, so it’s space requirements are minimal compared to the entire MacTeX distribution. The problem is that if you later decide to remove MacTeX from your system, removing Ghostscript will require a bit of time consuming manual intervention on your part because it is not installed in the same folder hierarchy as the MacTeX distribution itself. If you’re thoroughly confused at this point, just go ahead and install it as it won’t harm anything at all. The Ghostscript Dynamic Library is required by only one program, dvisvgm, and if you don’t know what that is or if you do and can be sure you won’t be using it you can leave the button for this unchecked and it won’t be installed. If this is your first time installing MacTeX, be certain that the GUI Applications and TeXLive-2022 buttons are checked. If, like me, you already have the GUI applications installed then you can unselect that button. After initially publishing this post, I discovered that LaTeXiT requires Ghostscript so I recommend installing Ghostscript after all. Note that the full installation will take several gigabytes. When you’re sure of your choices (don’t agonize too much…it’s not worth it), click the Install button, exhale, and perhaps go to the kitchen for a beverage. By the time you get back, depending on your Mac’s speed, you will probably see the pleasant screen informing you the installation was successful. Click the Close button. You will be prompted to either move the installer to the Trash or leave it where it is. If you need to install MacTeX on another machine, then keep the installer where it is. Otherwise, you can move it to the Trash and delete it. The installer will close after you click to indicate your choice.
- Now let’s check a few things. Open a Terminal and issue
echo $PATH. You should see
/Library/TeX/texbinappended to your previous
PATHenvironment variable. As a test, issue
lualatex --versionand make sure you see the year corresponding to your MacTeX distribution in the first line of the output. You can close your Terminal now.
- At this point, you’re ready to begin creating documents but before I turn you loose to do that, I want to show you the secret to maintaining your MacTeX distribution. Open your Applications folder and you should see an app called TeX Live Utility. This app is the secret sauce to keeping your MacTeX distribution updated and in proper working order. Launch TeX Live Utility. You will probably be prompted to enable a security feature for checking downloaded packages. Click the box to disable future reminders about this and click Enable. You may be asked to authenticate with your password, so do that. TLU (TeX Live Utility) will then fetch all the pending updates for your newly installed MacTeX distribution. Click the Update All button on TLU’s menubar and let the update proceed, authenticating with your password when/if necessary. The update won’t take more than a minute or two and you’ll see an Update Succeeded notification in the center of the TLU window when it has completed.
- Now, I’m going to show you some even cooler features for maintaining your MacTeX distribution. Click the Configure option in the main menubar. If you are in the U.S. you should select Change Paper Size and set that to Letter; otherwise you will probably want to use A4. Be aware that this choice can affect pagination in your documents (as I discovered the hard way recently)! Select Configure Automatic Backups to enable backing up your installed packages. Select Schedule TeX Live Update Checks to check for updates at a desired interval. I have mine set for Daily at 07:05. Note that this will not automatically install updates for you; that requires your user authentication. I highly recommend daily checks because some packages may be frequently updated to fix bugs or to enhance compatibility with other packages. If you go into your Mac’s System Preferences, select Notifications, and enable notifications for TeX Live Utility and TLUNotifier you will see notifications telling you whether or not updates are available to be installed. If you have more than one MacTeX distribution installed, you can select Change Default TeX Live Version (and here I’m using the names MacTeX and TeX Live interchangeably) and set which version you want to use. To save disk space, I always delete the previous year’s distribution once the new version is installed and appears stable. Select Configure Documentation and enable Install documentation when updating because you will want all package documentation available to you. Select Manage Repositories to find the TeX Live repository nearest your geographic location (mostly for convenience) from which to download updates. Note that updates do not necessarily appear on all repositories or servers simultaneously and could take a couple of days to propagate to every repository. Find your desired repository, click it’s name, and click the Use As Home button at the bottom of the Repository window. This will ensure that you use the same repository until or unless you decide to change to a different one. I do this to make sure my MacTeX distributions on different Macs get the same updates at the same time.
If you’ve gotten this far, you now should have a working MacTeX distribution. In the next post, I will lead you through setting up TeXShop, which is in my opinion the best environment for using TeX and friends on a Mac. It’s not just an editor, it’s a powerful document processing environment and needs a bit of setup. That’s all for the next post.
In the meantime, let me know in the comments if you have any questions about setting up MacTeX!