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.