Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

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.21

Figure A.21: Creating a new texmf folder

texmf-addnewfolder 

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.22)

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

miktex-add-directory 

Finally, get MiKTEX to update it:

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

    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.23: Updating MiKTEX’s FileName DataBase (FNDB)

miktex-update-fndb 

MiKTEX and TEXnicCenter

If you plan on using the TEXnicCenter editor instead of TEXMakerX, you must make sure when you install MiKTEX, that you make a careful note of the folder you install MiKTEX into because you will need that later, when you run TEXnicCenter for the first time after installation. It should be something like C:\Program Files\MiKTeX 2.9\miktex\bin (or a later version number, if this has moved on since the time or writing). You need to know this, because TEXnicCenter won’t guess it for you.