22

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?

4
  • There is no need to reboot ! Have you added a newline at the end of your texmf.cnf file? Commented Sep 14, 2012 at 6:25
  • 1
    Doesn't solve the texmf.cnf issue itself, but couldn't you just set TEXMFHOME in your .profile?
    – Joseph Wright
    Commented Sep 14, 2012 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
    Commented Sep 14, 2012 at 9:37
  • 2
    Are you using the correct kpsewhich? Maybe the one from Ubuntu is interfering. What does "which kpsewhich" say?
    – norbert
    Commented Sep 14, 2012 at 9:37

2 Answers 2

24

In Ubuntu:

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

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

if [ -d ~/.texmf ] ; then
    export TEXMFHOME=~/.texmf
fi
5
  • In your first listing the export is local to the current terminal. Is this correct? Commented Nov 22, 2012 at 18:41
  • @MarcoDaniel: yes.
    – gpoo
    Commented Nov 23, 2012 at 1:06
  • Can you explain the meaning of -d ~/.texmf? Commented Nov 23, 2012 at 12:17
  • 2
    In bash shell, it checks whether if the directory ~/.texmf exists. ~ is the user home directory.
    – gpoo
    Commented Nov 23, 2012 at 18:00
  • 2
    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
    Commented Apr 6, 2019 at 17:26
10

The standard procedure you followed is correct. Edit

/usr/local/texlive/2012/texmf.cnf

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .