Adding local packages in MiKTeX 2.9 on Windows

I'm writing this down so I never have to search the internet again to figure out how to install local packages for my Latex installation.

There are two competing installations for Windows: MiKTeX and TeX Live. The math department where I work has its own .sty files for formatting exams, and every time I've had a new install of Latex, I've had to figure out where to put these files so Latex knows where to find them. The issue this time is that I've used TeX Live in the past, and now I'm using MiKTeX 2.9 on my home computer. I started searching online for the standard instructions, but then realized that MiKTeX handles things differently. And then the instructions often assumed things I didn't know, like "your local directory structure needs to be TDS-compliant or MiKTeX will complain." So here I've written simple instructions, ones that even I can follow.

First, somewhere on the computer create a directory tree, localtexmf/tex/latex/, and dump the .sty files in there, in the latex folder. (This is TDS compliant.)

Next, go to the Windows start menu and type in "miktex," and the first entry that comes up will be "miktex console." When it opens it will ask about starting with administrator privileges. I choose yes. Once the console window opens click on the Settings tab on the left, then on the Directories tab on top. Click the + to add a root directory. Navigate to the localtexmf folder that was created and hit OK. Now, up in the menu bar at the top of the window, find Tasks, and select "refresh filename database." Now MiKTeX knows where to look for extra packages.

Leave a Reply

Your email address will not be published. Required fields are marked *