# [Tex/LaTex] Definition of the TEXINPUTS variable

environment-variableslinuxtexlive

I am using TeX Live 2012/Debian on Linux Mint 14.

I am wondering what the right definition of the TEXINPUTS variable is.

You can always put your personal files in a proper subdirectory of ~/texmf; for instance, your personal .sty files could go in

~/texmf/tex/latex/jana/


This "personal tree" is always consulted for input files before the other trees and doesn't need hashing (with texhash aka mktexlsr). This is by far the preferred method for personal input files.

If instead you have a folder somewhere, you can set the variable TEXINPUTS in the environment by saying something like

export TEXINPUTS=/path/to/the/local/folder//:


The // means that TeX programs will search recursively in that folder; the trailing colon means "append the standard value of TEXINPUTS" (which you don't need to provide).

Note that TEXINPUTS is usually not set; it takes a value as soon as a TeX program is started (by reading a set of texmf.cnf files). However, if the program finds it in the environment, it follows the rule sketched above.

If you need the current directory to be searched for inputs before the local one, then

export TEXINPUTS=.:/path/to/the/local/folder//:


should be the best choice.