I created a custom beamer style. For this I have several .sty files. I am able to install this custom theme on my Ubuntu 12.04 with the standard tex-live provided distribution by putting it my home as following:


And then running texhash

I want to know how to proceed in order to have pdftolatex compiler aware of this package if I put it in a custom directory.


2 Answers 2


Tex-live supports a number of environment variables that are used to specify where to look for files. The most important ones are TEXINPUTS (for packages, classes and support files), BSTINPUTS (for bibtex/biblatex styles) and BIBINPUTS (for bibtex/biblatex databases).

To add your own folder ~/mystuff, just add it to TEXINPUTS and maybe also BSTINPUTS (bash syntax):

export TEXINPUTS=~/mystuff//:${TEXINPUTS}
export BSTINPUTS=~/mystuff//:${BSTINPUTS}

If a directory is postfixed by a trailing double slash, it is searched recursively by pdftex for files, so you may store arbitrary folder structures inside it.

The path can also be relative, which comes handy in collaborative settings (with using a source control system, such as git or subversion). For such projects, I usually maintain a per-project texmf folder with all "unusal" packages, package versions and so on that is committed together with the project's source file into the repository. In the accompanying makefile I then set TEXINPUTS to ./texmf//:${TEXINPUTS}, so that the project is "self-contained" and can be checked out and compiled by any colleague with a standard tex-live distribution. Details about this approach can be found in this answer.


Before TeXLive, installations like teTeX had a $TEXINPUTS environment variable to a directory within your home directory. This told your preferred tex compiler to to look for your individual TeX style files in that directory without having to run texhash on it.

Nowadays, it's all about kpathsea and the contents of your personal style tree needs a hash file as produced by texhash. Fortunately, you can generate that hash file just for your personal tree where you have writing permissions, and use environment variables to tell your preferred TeX compiler in which order it should search your personal tree as compared to the system trees.

See the TeX FAQ on private installation of files for details.

  • 4
    That's not accurate. TeX Live still uses $TEXINPUTS, and your local TeX tree (for example ~/texmf on Linux) does not have to be hashed.
    – Joseph Wright
    May 31, 2012 at 8:29
  • Does that apply to an entire tree hierarchy of personal style files? I have always been under the impression that $TEXINPUTS would only allow a flat hierarchy, i.e. subdirectories would all need their individual entries into the variable. May 31, 2012 at 8:40
  • Yes, that applies to an entire hierarchy.
    – Daniel
    May 31, 2012 at 8:43
  • Thanks. Does it mean that I can't just set an environement variable ? May 31, 2012 at 10:49

Not the answer you're looking for? Browse other questions tagged .