I use texlive 2012 on ubuntu 12.04. I wanted my ~/texmf folder invisible, so I edited my texmf.cnf file which is in /usr/local/texlive/2012 directory:

TEXMFHOME = ~/.texmf

I rebooted my computer and ran the command

kpsewhich -var-value TEXMFHOME

which gave me /home/myusrname/texmf. I checked texmf.cnf file again and it still had the line above. And my TEXMFHOME really is ~/texmf because I tested one of my .sty file under/.textmf and it did not work, while it still worked under ~/texmf.

Should I change something else to change my TEXMFHOME?

  • There is no need to reboot ! Have you added a newline at the end of your texmf.cnf file? – Paul Gaborit Sep 14 '12 at 6:25
  • 1
    Doesn't solve the texmf.cnf issue itself, but couldn't you just set TEXMFHOME in your .profile? – Joseph Wright Sep 14 '12 at 6:29
  • I tried on Mac OS X and it works; as Paul Gaborit says, there is no need to reboot. What's the answer of env | grep TEXMF? – egreg Sep 14 '12 at 9:37
  • 2
    Are you using the correct kpsewhich? Maybe the one from Ubuntu is interfering. What does "which kpsewhich" say? – norbert Sep 14 '12 at 9:37

In Ubuntu:

$ kpsewhich -var-value TEXMFHOME
$ export TEXMFHOME=$HOME/.texmf
$ kpsewhich -var-value TEXMFHOME

You can export the variable in your .bashrc file as:

if [ -d ~/.texmf ] ; then
    export TEXMFHOME=~/.texmf
  • In your first listing the export is local to the current terminal. Is this correct? – Marco Daniel Nov 22 '12 at 18:41
  • @MarcoDaniel: yes. – gpoo Nov 23 '12 at 1:06
  • Can you explain the meaning of -d ~/.texmf? – Marco Daniel Nov 23 '12 at 12:17
  • 2
    In bash shell, it checks whether if the directory ~/.texmf exists. ~ is the user home directory. – gpoo Nov 23 '12 at 18:00
  • On my system (Linux Mint 18), exporting TEXMFHOME as an env var does not change the output of kpsewhich. Am I doing something wrong? – Mirlan Apr 6 '19 at 17:26

The standard procedure you followed is correct. Edit


to contain

TEXMFHOME = ~/.texmf

(better ensure a trailing return). There is no need to reboot.

However, if the output of kpsewhich --var-value TEXMFHOME is not ~/.texmf, then probably you have set TEXMFHOME in your environment (probably in the .bashrc file). Check the output of

env | grep TEXMF

to see if this is the case. If it is, then you have to find where the variable is being set and remove it.

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.