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 3: Your Personal TEX Directory

‘Move the files to a directory where LATEX will find them.’

— Anon. Many class and package installation instructions.

There are always new packages coming out, and others being updated. If you use an automated updater like TEX Live’s tlmgr or MiKTEX’s Update-FNDB then updates will get put in ‘The Right Place’ automatically, and you don’t need to do anything else.

But there are also times when you may want to add a new or special class or package by hand; perhaps a private one from a company or organisation (so LATEX and CTAN won’t know about it, and you’re not allowed to share it); or even classes and packages you are writing yourself.

Every users needs a place to put such files where they won’t get mixed up with your documents or with TEX’s own files. This is the ‘The Right Place’ to put files mentioned in § 3.2.2 above, and it’s known as your Personal TEX Directory (PTD) or Personal TEX Folder (PTF).

LATEX will automatically check this folder first for classes and packages, so anything you put in your Personal TEX Directory will be found before LATEX looks anywhere else. This is why it’s important for manual updates, and for special or private classes, packages, styles, and fonts.

The folder MUST be called texmf (short for TEX and METAFONT), and MUST go in your home (login) directory on Unix & GNU/Linux systems and Microsoft Windows running TEX Live, or in the user Library folder on Apple Macintosh OS X. In MiKTEX (only) you need to tell MiKTEX Console afterwards where you put your Personal TEX Directory (see the procedure ‘Click the Start or Windows button …’ below).

    Creating a Personal TEX Directory

  1. Follow the instructions for your operations system below.

    Unix and GNU/Linux

    You can use either the terminal or the file manager:

    Either

    open a terminal (console) window and type

    mkdir ~/texmf
    Or

    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 Folder

    4. Type the new folder name texmf

    5. Press the Enter key

    6. Close the file-manager

    Apple Mac OS X

    You can use either the terminal or the file manager:

    Either

    open a Terminal window and type

    mkdir ~/Library/texmf
    Or

    use the Finder:

    1. Open the Finder on your Home folder

    2. Click on ViewAs Columns

    3. Click on ViewShow View Options and in the Options dialog which appears, make sure that Show Library Folder is checked, then close the dialog window and select Library in the list of folders

    4. Click FileNew Folder

    5. Name the new folder texmf

    6. Close the Finder

    Microsoft Windows

    You can use either the terminal or a file manager:

    Either

    open a Command window and type

    cd %USERPROFILE% 
    md texmf

    (On older Windows systems (7/8/95/XP/ME) use %HOME% instead of %USERPROFILE%.)

    Or

    use the File Explorer:

    1. Open File Explorer (called My Computer or Computer on older Windows systems)

    2. Make sure it is showing your home folder: this C:\Users\your~name on modern Windows systems (on Windows 7/8 it is Computer\System\Users\your~name and on older Windows it is C:\).

    3. Right-click in your home folder and pick New folder, then type in the name texmf (make sure it is called texmf in all lowercase) and press the Enter key.

  2. Create the TDS subfolder structure (all systems)

    At a minimum, you SHOULD create the TEX Directory Structure (TDS) folders and subfolders tex/latex and fonts/truetype or fonts/opentype inside your new Personal TEX Directory because this is where you put any subsubfolders for fonts, classes, and packages that you add, for example

    texmf/tex/latex/blockchart/
    texmf/tex/latex/blockchart/blockchart.sty
    texmf/tex/latex/supertramp/
    texmf/tex/latex/supertramp/supertramp.cls
    texmf/fonts/truetype/faulmann/
    texmf/fonts/truetype/FaulmannFont-JRMgj.ttf
    texmf/fonts/truetype/FaulmannSmp-GO87G.ttf
    texmf/fonts/opentype/dehning/
    texmf/fonts/opentype/dehning/SuperTramp.otf

    If you want to recreate the entire TDS subdirectory tree, there are instructions in § 3.2.3 above which can also be adapted for Windows systems.

  3. Update your FNDB (MiKTEX only)

    If you use MiKTEX you MUST now tell MiKTEX to add this folder to its File Name Database (FNDB). This step is compulsory: without it, nothing will work.

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

    2. Click the Roots tab and the Add button, and navigate in the window to the place where you created the texmf folder above

      miktex-add-directory
    3. Click on the General tab and tell MiKTEX to update its FNDB along with its other folders by clicking the Refresh FNDB button (the mediaobject ‘…’ below)

      miktex-update-fndb

Warning

In MiKTEX 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.

  1. Find Terminal in ApplicationsUtilities or type Terminal into Spotlight

  2. Find Command in WindowsAll Programs or type Command into the search.