[Tex/LaTex] Change TEXMFHOME per-user


I would like to know if it's possible to change the default TEXMFHOME location. Partly because I dislike the idea of programs cluttering my home directory with non-hidden files or directories (such as ~/texmf/) and partly because I would like to be able to manually install new LaTeX packages wherever I like, for example in


I know I could change the TEXMFHOME environment variable, but is there also a per-user config file which could change where LaTeX & friends look for files?

Best Answer

It's not clear from the question whether you have admin access to the master texmf.cnf file. If you do, then this is easier than if you do not!

Admin access available

In the case where for example you have a single-user machine and so write access to texmf.cnf in the installation directory, this is doable with no variable setting. You can find where this is using kpsewhich texmf.cnf: I see

palladium:~ joseph$ kpsewhich texmf.cnf

You can then edit this file (with sudo if needed) and alter the TEXMFHOME line to point to where you want.

Admin access not available

The more common case, I think, if wanting to set things here is when you do not have admin access which is exactly why you want to set on a per user basis. Here, it seems you have to set at least one variable. There are two approaches.

The first is to set TEXMFHOME directly. This is clearly pretty easy, and is the recommended method unless you need to do more complex things.

The second approach is to set your system up to use a per user texmf.cnf file. This can go in a location of your choosing, but you will need to set the TEXMFCNF variable with something like

export TEXMFCNF=~/.texmf-config/web2c:

where the : is important as it makes this an additive change. You can then create a texmf.cnf file in this new location, and add whatever settings you want there (TEXMFHOME is just one possible). There is more detail on this in http://people.debian.org/~preining/TeX/TeX-on-Debian/ch2.html#s-sec-user-config-files.