Everywhere All articles Download Buy — $19

Where apps hide your files

MacTeX folders: texlive, texmf-local and personal texmf

Updated 2026-10-28 · 5 min read

MacTeX keeps TeX Live in a year-named folder under /usr/local/texlive, with your own additions in texmf-local or ~/Library/texmf. Here is where each folder is, how to open the hidden ones, and where to put your own files so an update does not remove them.

The locations

On a Mac, MacTeX installs TeX Live into a folder named for the year, under /usr/local:

/usr/local/texlive/2026

Replace 2026 with the release you installed (the folder name changes each year). The smaller BasicTeX package uses a separate folder, /usr/local/texlive/2026basic. TUG, the group that makes MacTeX, says a new release does not overwrite the previous one, so you may see several year folders side by side. Homebrew's mactex and basictex casks run TUG's own installer packages, so they use the same paths.

Three other places matter:

/usr/local/texlive/texmf-local
~/Library/texmf
/Applications/TeX

The command-line tools are reached through a link, /Library/TeX/texbin, which MacTeX points at the active year's binary folder. TUG tells you to give GUI programs that path rather than a year-specific one, so it keeps working after you switch releases.

Opening the hidden ones

Finder does not show /usr/local. Choose Go > Go to Folder (⇧⌘G), type /usr/local/texlive and press Return. From Terminal:

open /usr/local/texlive

Pressing ⇧⌘. in a Finder window shows hidden items, and TUG's Mac notes mention that shortcut too. The folders are owned by root, so dragging files into them asks for your password.

Ask TeX instead of guessing

The paths above are the defaults. To print where your install really keeps things, use kpsewhich, which TeX Live ships. These commands only read:

kpsewhich -var-value=TEXMFLOCAL
kpsewhich -var-value=TEXMFHOME
kpsewhich -var-value=TEXMFVAR
kpsewhich article.cls

The last one finds a file the way TeX does, so it is the quickest way to learn which copy of a package your documents load. If the command is not found, open a new Terminal window, or check that /Library/TeX/texbin exists with ls /Library/TeX.

What each tree is for

VariableDefault on a MacHolds
TEXMFDIST/usr/local/texlive/2026/texmf-distThe packages, fonts and scripts that ship with TeX Live
TEXMFSYSVAR/usr/local/texlive/2026/texmf-varGenerated format files and font maps that tlmgr writes
TEXMFLOCAL/usr/local/texlive/texmf-localYour system-wide additions, kept from release to release
TEXMFHOME~/Library/texmfYour personal additions
TEXMFVAR~/Library/texlive/2026/texmf-varPer-user cache and generated data
TEXMFCONFIG~/Library/texlive/2026/texmf-configPer-user settings changed by TeX's own tools

On Linux those two per-user trees are hidden dot-folders named ~/.texlive2026, and many guides quote that path. On a Mac the TeX Live installer puts them under ~/Library/texlive/<year> instead; kpsewhich -var-value=TEXMFVAR shows the exact folder. The TeX Live manual says TEXMFVAR holds automatically generated runtime data and should be safe to remove unless you used it for something else, while TEXMFCONFIG holds configuration changes, so keep it unless you know how to recreate them.

Adding your own class, style or font

Put it in ~/Library/texmf or in texmf-local, inside the matching directory structure. The TeX Live manual gives the example of a LaTeX class or package going in tex/latex, so a file of yours would live at:

~/Library/texmf/tex/latex/mystyle/mystyle.sty

Files outside that structure are not found. For texmf-local, the manual adds that the filename database must be up to date before new files are seen. Refresh it with the full path, so the command is found even under sudo:

sudo /Library/TeX/texbin/mktexlsr

The personal tree needs no step beyond keeping the layout correct.

TUG says MacTeX leaves an existing texmf-local alone when you install a newer year and only creates an empty one when none exists. That is why it is the right place for anything you cannot afford to lose.

Updating, switching years and disk use

TUG's own instructions use TeX Live Utility (in /Applications/TeX) to bring a fresh install up to date. Its Configure menu has Change Default TeX Live Version, which is how you switch between year folders when a new release misbehaves. From Terminal, the equivalent is tlmgr:

sudo /Library/TeX/texbin/tlmgr update --self --all

That downloads and changes files inside the year folder, so run it only when you mean to update.

On size, TUG describes the full TeX Live in MacTeX as over 6 gigabytes, and BasicTeX at about 140 MB. The year folder is where the weight is. An old year you no longer use is the main space to reclaim, and TUG's uninstall page says to drag that year's folder to the Trash from /usr/local/texlive (you give an administrator password). Leave texmf-local alone unless you are removing TeX completely.

Why searches miss it

Finder hides /usr/local, and your per-user trees sit inside ~/Library, both outside what Finder and Spotlight searches show you. A package inside texmf-dist has a short file name such as beamer.cls, and the same name often appears in several year folders, so a Finder search is unhelpful even where it works.

Finding a TeX file next time

Type the name of a style file, such as beamer.cls or natbib.sty, into Everywhere and the results list every copy with its folder, so you can see whether the one in texmf-local or your personal tree sits beside the one in the year folder. /usr/local/texlive and ~/Library/texlive are covered by its normal scan, with no extra permission; ⌘↵ reveals a result in Finder. It matches file names only, not the contents of a .sty file.

Common questions

Where is MacTeX installed on a Mac?

TeX Live itself is in /usr/local/texlive/<year> (for example 2026), the apps are in /Applications/TeX, and the command-line tools are reached through /Library/TeX/texbin.

Where do I put my own LaTeX packages and fonts on a Mac?

Use ~/Library/texmf for yourself or /usr/local/texlive/texmf-local for every user, with the files in the matching directory structure such as tex/latex/mystyle/. After adding to texmf-local, run sudo /Library/TeX/texbin/mktexlsr.

How do I find where a LaTeX package file lives?

Run kpsewhich followed by the file name, for example kpsewhich article.cls. It prints the path TeX would load.

Can I delete an old TeX Live year folder?

TUG's uninstall page says each year's distribution lives in one folder under /usr/local/texlive, which you can drag to the Trash after giving an administrator password. Keep texmf-local if you still use TeX.

Find any file before you finish typing

Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.

Version 2.20.3 · macOS 13+ · 4.7 MB · notarised

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Buy a licence Articles Privacy Support