Integrating Local Additions

If you have files that you want to integrate into the MiKTeX setup, you have several options:

Use the command-line option --include-directory=dir

For example:

latex --include-directory=C:\path\to\my\style\files thesis.tex

See the section called “Specifying Additional Input Directories”, for more information.

Set environment variables

For example:

set TEXINPUTS=C:\path\to\my\style\files
latex thesis.tex

See Chapter 8, Environment variables, to learn more about MiKTeX environment variables.

Register a user-managed TEXMF directory

Register the root of the directory tree which contains your files. The directory tree must conform to the TDS standard, i.e., you must imitate the directory tree in the MiKTeX installation directory (usually C:\Program Files\MiKTeX 2.9).


This is the recommended method. The rest of this section explains how you can register your own root directory.

A Short Excursion: The TeX Directory Structure (TDS)

Here is a brief summary of the TDS standard:

*.afm go in root\fonts\afm\supplier\font

*.dvi, *.ps or *.pdf go in root\doc\latex\package

*.enc go in root\fonts\enc\syntax\bundle

*.map go in root\fonts\map\syntax\bundle

*.mf go in root\fonts\source\supplier\font

*.pfb go in root\fonts\type1\supplier\font

*.sty, *.cls or *.fd go in root\tex\latex\package

*.tfm go in root\fonts\tfm\supplier\font

*.ttf go in root\fonts\truetype\supplier\font

*.vf go in root\fonts\vf\supplier\font

Please run mthelp tds to learn more about the TDS.

Walkthrough: Registering a User-Managed TEXMF Directory

In this walkthrough, we assume that your own additions are located in the directory tree rooted at C:\Local TeX Files. This tree might look as follows:

Figure 4.4. Sample TeX Directory Structure

Sample TeX Directory Structure

In our example, the input files are distributed over three directories:

C:\Local TeX Files\bibtex\bib\misc

Contains .bib files.

C:\Local TeX Files\bibtex\bst\misc

Contains .bst files.

C:\Local TeX Files\tex\latex\misc

Contains LaTeX input files (*.sty, *.cls, ).

You use MiKTeX Options to register C:\Local TeX Files. Click StartProgramsMiKTeX 2.9MaintenanceSettings to open the MiKTeX Options window (see Figure 4.1, “MiKTeX Options: General Settings”).

Click on the Roots tab. The Roots page (see Figure 4.5, “MiKTeX Options: Roots”) shows the list of currently registered root directories.

Figure 4.5. MiKTeX Options: Roots

MiKTeX Options: Roots

Click Add. In the following dialog box (Figure 4.6, “Browsing to a Root Directory”), browse to C:\Local TeX Files and click OK.

Figure 4.6. Browsing to a Root Directory

Browsing to a Root Directory

The root directory will be appended to the list (Figure 4.7, “MiKTeX Options: Root Directory Added”).

Figure 4.7. MiKTeX Options: Root Directory Added

MiKTeX Options: Root Directory Added

You can move C:\Local TeX Files before the installation directory, if you want to prioritize your own files. Click C:\Local TeX Files to select the list entry. Then click Up to move it before the installation directory (Figure 4.8, “MiKTeX Options: Root Directory Moved”).

Figure 4.8. MiKTeX Options: Root Directory Moved

MiKTeX Options: Root Directory Moved

Click OK to close MiKTeX Options The file name database will be refreshed. Your files in C:\Local TeX Files are now available to MiKTeX.