[Tex/LaTex] How to add a .sty file to the MacTeX/TeXShop installation

installingmacmactexpackagestexshop

I've searched online, but I have not found any clear instructions how to permanently add .sty files to my TeXShop installation. I'm using a Mac with OSX (TeXShop is a mac only program).

What is the best way of doing this? The one comprehensive set of instructions I found here.

I've got as far as extracting the files (running LaTeX on the .ins and . dtx files) but after that I don't know what to do. I also don't understand how to update the index of my distribution, and whether there are particular OSX specifics (the instructions are for Windows).

Best Answer

The first question you should ask is whether the package you are trying to install is already installed on your system. If you are using MacTeX as your distribution (which you probably are) then most packages are already available. Within TeXShop you can choose the "Show Help for Package" item from the Help menu and enter your package name. (Or make a simple document that loads the package to see if it doesn't exist.)

Installing packages or classes

If the package doesn't exist, then this answer:

covers everything you need to know.

On a Mac, local additions go into the Library/texmf folder of your Home folder (~/Library/texmf). Unfortunately on OS 10.7 and above, the user Library folder is typically hidden from view. It is, however, easy to access it through the Finder's Go menu: hold down the Option key while choosing the Go menu, and the local Library folder will appear in the list. Alternatively if you type Command-Shift-G you can enter the folder path directly (~/Library/texmf)

You never need to update the file database for local additions to this folder.

If the texmf folder doesn't exist, you will need to create it yourself along with the subfolders necessary for TeX to find things properly (see the linked question for the correct hierarchy). For a one-click version of this you can use this utility:

Installing fonts for pdfLaTeX

Fonts which are to be used with pdfLaTeX should never be installed in this folder. See the following question for details about how to install fonts properly.

Installing fonts for XeLaTeX or LuaLaTeX

These fonts should not go in this folder either, but should be installed as system fonts in the same place that any font on your machine would go. On a Mac this is `/Library/Fonts`.