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?

  • 1
    would mv texmf texmf-something-else be acceptable? Sep 8, 2011 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? Sep 8, 2011 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, 2011 at 7:13
  • 1
    unset TEXMFHOME
    – user2478
    Sep 8, 2011 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. Sep 8, 2011 at 7:22

2 Answers 2


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.)

  • Thanks! I tried setting TEXMFHOME="" myself and when that failed asked here :) Sep 8, 2011 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, 2011 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
  • 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! Sep 8, 2011 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, 2011 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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