

Formatting Information — An introduction to typesetting with LATEX

Appendix A: Installation

Section 2: Your personal TEX directory

MiKTEX (Windows) can recognise when you try to use a class or package in your document that isn’t installed, and automatically download and install it for you right there and then, and carry on compiling your document. TEX Live and MacTEX have a separate package-manager which can be used to add classes and packages if you find you need them.

Doing this is fairly rare if you picked the ‘full’ installation option, as you then have pretty much everything already installed, but there are always new packages coming out, and others being updated.

However, there are also times when you may want to add a new or uncommon class or package by hand — perhaps a private one from a company or organisation (so LATEX and CTAN wouldn’t know about it), or even one you are writing yourself.

To do this, you need a place to put the files where they won’t get mixed up with your documents or with TEX’s own files. This is the ‘right place to put files’ mentioned in the penultimate step ‘Install the files’, and it’s known as your personal TEX directory or personal TEX folder.

LATEX will automatically check this place first for classes and packages, so anything you put in your personal TEX directory will be found before any file of the same name in your main TEX installation, which is why it’s important for manual updates, and for special or private classes, packages, styles, and fonts.

The folder is called texmf (for TEX and METAFONT). For all Unix & GNU/Linux systems, including Apple Macintosh OS X, and for TEX Live systems on Microsoft Windows, that’s all you have to create for now.

For MiKTEX (ProTEXt, you also have to tell the system that you want the folder to be searched — see § A.2.3: this is really important, as otherwise MikTEX won’t use it.

A.2.1 Create a personal TEX folder in Unix and GNU/Linux

Either open a terminal window and type mkdir ~/texmf

Or if you prefer to use a file-manager:

  1. Open a file-manager window (eg Thunar, Nautilus, Dolphin, etc) on your Home directory

  2. Right-click in an empty area of your Home directory so the menu dialog appears

  3. Click Create>New or New

  4. Click Folder or Directory

  5. Name the new folder texmf

  6. Close the file-manager

A.2.2 Create a personal TEX folder in Apple Mac OS X

Either open a Terminal window (find Terminal in ApplicationsUtilities) and type mkdir ~/Library/texmf

Or if you prefer to use the Finder:

  1. Open the Finder on your Home folder

  2. Click on ViewAs Columns

  3. Click on ViewShow View Options

  4. In the Options dialog which appears, make sure Show Library Folder is checked, then close the dialog window

  5. Select Library in the list of folders

  6. Click FileNew Folder

  7. Name the new folder texmf

  8. Close the Finder

A.2.3 Create a personal TEX folder in Microsoft Windows

Either open a Command window (find Command in All Programs) and type

cd %HOME%
md texmf

Or if you prefer to use the graphical directory manager:

  1. Open My Computer (just called Computer in Windows 7/8)

  2. Create a new subfolder called texmf in the C: drive (Win95—XP) or Computer\System\Users\your~name\texmf (Win7–10), as in Figure A.4

Figure A.4: Creating a new texmf folder


You now have to add this folder to the MiKTEX list of root folders:

  1. Name the new folder texmf (make sure it is called texmf (all lowercase) and nothing else)

  2. Click the Start or Windows button and run the MiKTEX Options (maintenance) program (it should be shown among your recent programs).

  3. Click the Roots tab and the Add button, and navigate in the window to the place where you created the texmf folder above (Figure A.5)

Figure A.5: Adding your Personal TEX Directory to MiKTEX


Finally, get MiKTEX to update it:

  1. Click on the General tab and tell MiKTEX to update it along with its other folders by clicking the Refresh FNDB button (Figure A.6)

    You MUST click on the Refresh FNDB button any time you make changes to the contents of your personal TEX directory (the texmf folder), otherwise MiKTEX will not be able to find the files.

Figure A.6: Updating MiKTEX’s FileName DataBase (FNDB)