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'd like to be able to temporarily ignore my "home" texmf tree (in MacTeX /Users/will/Library/texmf) for testing purposes; e.g., to test some code and ensure only TeX Live-installed packages are found. Is this easily possible?

share|improve this question
would mv texmf texmf-something-else be acceptable? – Loop Space Sep 8 '11 at 7:10
@Andrew: That's the way I do it (mv ~/texmf ~/texmf_) :-). However, maybe using export TEXMFHOME="" will overwrite the internal definition of TEXMFHOME? – Martin Scharrer Sep 8 '11 at 7:13
A similar suggestion to that of @AndrewStacey's is to keep your "home" texmf tree wherever and create a symbolic link to it via /Users/will/Library/texmf. Then you can manipulate that link whenever you want to disable TEXMFHOME. This might be somewhat safer than using mv. Also you could create a script that when invoked if the TEXMFHOME is enabled disables it, and if it's disables, enables it. – N.N. Sep 8 '11 at 7:13
unset TEXMFHOME – Herbert Sep 8 '11 at 7:22
Testing on my system shows that you need to set TEXMFHOME to something, but that that something need not exist. So export TEXMFHOME=$HOME/a-nonexistant-directory works. – Loop Space Sep 8 '11 at 7:22
up vote 8 down vote accepted

This is a bit long for a comment, and the formatting would be restrictive. Here's what happens on my (Linux) system:

~% echo $TEXMFHOME

~% kpsewhich mymacros.sty
~% export TEXMFHOME=""
~% kpsewhich mymacros.sty
~% export TEXMFHOME=$HOME/a-nonexistant-directory
~% kpsewhich mymacros.sty                        
~% unset TEXMFHOME
~% kpsewhich mymacros.sty

So the one that works reliably is to set TEXMFHOME to something that doesn't exist. (You could set it to something that does exist, but then you run the risk of there being something TeX might look for in that directory.)

share|improve this answer
Thanks! I tried setting TEXMFHOME="" myself and when that failed asked here :) – Will Robertson Sep 8 '11 at 11:02
This is what I do. I have a testing texmf directory, and a TeXShop engine script that sets TEXMFHOME to that directory. If that directory is empty, then you'll get only TL stuff. – Alan Munn Sep 8 '11 at 18:32

My approach is to use a directory other than the default directory for the personal texmf tree (the latter is set in texmf.cnf). If I want the personal texmf tree to be ignored I simply invoke latex (in a Bash shell) like

TEXMFHOME="" latex mydoc.tex
share|improve this answer
So it would seem that if TEXMFHOME is unset or is empty then TeX uses the standard location (most likely $HOME/texmf). So this works if ones home texmf tree is in a non-standard place. Mine works for the standard place, so between us that's everything covered! – Loop Space Sep 8 '11 at 17:49
@Andrew Stacey: Yes, in your case, you would simply pass TEXMFHOME=<non-existing-directory> to the subshell in which latex is executed. – mhp Sep 8 '11 at 18:30

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.