How to TEXINPUTS for MikTeX.

I use macro files for shortcuts for writing my quizzes, tests, etc. I create new directories each semester for each class. These macro files could either be copied into each new directory, or they could be placed into a central directory and be accessible from any directory. On Linux, the TEXINPUTS line

export TEXINPUTS=".:$HOME/styles:"
allows the placement of files in the direcory $HOME/styles that are accessible from any directory. This solves the problem for any Unix style computing system easily, but has not always worked with MikTeX. When I tried in the past, it never worked. I discovered that that MikTeX removed the support for it in version 2.4. Apparently, as of MikTeX 2.5 (which I have installed at home), it works fine. If you read documentation from the MikTeX website at http://docs.miktex.org/manual/envvars.html, it reports that MikTeX does support the TEXINPUTS variable as well as other environment variables. This means that there are two solutions to the problem, rather than the just the Roots Method I previously listed alone.

Environmental Variable Method

Add the local environmental variable TEXINPUTS to Windows. For an example of how to set an environment variable, click here (It is towards the bottom of the page). If you add more than one directory, separate the directories by semi-colons.

Roots Method

Another Here's what to do for MikTeX:
  1. The localtexmf directory on your computer is where you can place files like this. The most likely location of the localtexmf directory is c:\localtexmf. To find out where your localtexmf directory is located, open up "MikTeX Options", and click on the Roots tab (like below). There should be a listing of where the localtexmf directory is at. I'll assume that yours is at c:\localtexmf, but if it isn't, modify the instructions below for your setup.
    MikTeX Options
  2. Place your macro files in the directory c:\localtexmf\tex\latex. (If this directory doesn't exist, then create it).
  3. Every time that you add a file to the c:\localtexmf\tex\latex directory, you need to update MikTeX file database. This database alerts MikTeX to the location of files that can be used by all programs.
  4. To update the file database, open up "MikTeX Options" (Should be located in the programs menu).
    MikTeX Options
  5. Select "Refresh Now" under "file name database" of the "General" tab. Don't forget to refresh the database the first time you place your master macro file in central directory.
  6. Now the macro files are available in any directory!
S. Hyde
Last modified: Mon Jan 23 00:11:40 HST 2006