TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

share|improve this question
Don't define TEXINPUTS in the environment if you don't have compelling reasons to do it, such as the need to set some shared input directory. – egreg Jan 14 '13 at 11:11
I have a local folder where I put extra stuff in. Therefore I need to define the variable and somehow adding :$TEXINPUTS in the definition does not work. – Jana Jan 14 '13 at 12:03
you should not set TEXINPUTS. You'll get problems when using ConTeXt or LuaTeX beside pdflatex – Herbert Jan 14 '13 at 12:30
@Herbert, what problems? How should we refer to collections of other latex content instead? We have used TEXINPUTS to manage large collections of files created by different people for many years. What should we do to use lualatex? – Leo Mar 6 '14 at 19:43
up vote 24 down vote accepted

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


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.

share|improve this answer
I have the following: export TEXINPUTS=.:/path/to/my/local/folder//:/usr/share/texmf//:/usr/share/texlive/tex‌​mf//. But now it is missing a lot of files. For example inputenc.sty. – Jana Jan 14 '13 at 12:38
@Jana That's surely a wrong way to do that. – egreg Jan 14 '13 at 13:08
Problem is that I do not know the right way. – Jana Jan 14 '13 at 13:17
@Jana Did you try my answer? As I've added, for clarity, you don't need to add the value of TEXINPUTS, the trailing colon suffices. – egreg Jan 14 '13 at 13:32
What is the shared folder? /usr/share/? Because I had that but then I got the error as in post tex.stackexchange.com/questions/91284/error-in-english-cfg – Jana Jan 14 '13 at 14:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.