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?
Asked
Active
Viewed 450 times
12
lockstep
- 250,273
Will Robertson
- 73,872
2 Answers
9
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
/home/stacey/texmf/tex/latex/bzr/mymacros.sty
~% export TEXMFHOME=""
~% kpsewhich mymacros.sty
/home/stacey/texmf/tex/latex/bzr/mymacros.sty
~% export TEXMFHOME=$HOME/a-nonexistant-directory
~% kpsewhich mymacros.sty
(1)~%
~% unset TEXMFHOME
~% kpsewhich mymacros.sty
/home/stacey/texmf/tex/latex/bzr/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.)
Andrew Stacey
- 153,724
- 43
- 389
- 751
-
Thanks! I tried setting
TEXMFHOME=""myself and when that failed asked here :) – Will Robertson Sep 08 '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 08 '11 at 18:32
3
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
mhp
- 8,692
-
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! – Andrew Stacey Sep 08 '11 at 17:49 -
@Andrew Stacey: Yes, in your case, you would simply pass
TEXMFHOME=<non-existing-directory>to the subshell in whichlatexis executed. – mhp Sep 08 '11 at 18:30
mv texmf texmf-something-elsebe acceptable? – Andrew Stacey Sep 08 '11 at 07:10mv ~/texmf ~/texmf_) :-). However, maybe usingexport TEXMFHOME=""will overwrite the internal definition of TEXMFHOME? – Martin Scharrer Sep 08 '11 at 07:13/Users/will/Library/texmf. Then you can manipulate that link whenever you want to disable TEXMFHOME. This might be somewhat safer than usingmv. 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 08 '11 at 07:13unset TEXMFHOME– Sep 08 '11 at 07:22export TEXMFHOME=$HOME/a-nonexistant-directoryworks. – Andrew Stacey Sep 08 '11 at 07:22unset TEXMFHOME(as well asexport TEXMFHOME="") only works ifTEXMFHOMEhas been explicitly set (and exported) by the user. It doesn't work ifTEXMFHOMEhas the “implicit” default value set intexmf.cnf. – mhp Sep 08 '11 at 18:02unset TEXMFHOMEdoesn't work. – Andrew Stacey Sep 08 '11 at 18:29