[tex-live] kpsewhich search order and how to change it

Philip K.F. Hölzenspies p.k.f.holzenspies at utwente.nl
Fri Nov 16 17:07:17 CET 2007

Dear Zdeněk, Norbert, all,

> Did you get some errors during rehashing, i.e. that some directories
> were skipped because they are not writable? This may be also a problem
> of permissions of the ls-R files, not only directories.

The access rights really wouldn't have anything to do with it; like I said: I 
can simply write my ~/texmf/ls-R, so anything in there that would be 
inaccessible, would actually not be *readable* as opposed to writable. 
Anything that's not readable can't be used in the first place.

> Hmm, this is strange.
>         kpsewhich -progname latex  -show-path .tex
> gives any hint?
> (Mind, I am not an expert with kpathsea searching, it is a mystery)

This was actually very helpful. I didn't know too much about the implications 
of these TEXINPUTS.<progname> variables. The outcome was actually quite 

holzensp:~> kpsewhich -progname pdflatex  -show-path .tex | sed -e "s/:/\n/g"


This led me to my /etc/texmf/web2c/texmf.cnf, which shows:



TEXINPUTS.pdflatex      = .;$TEXMF/tex/{latex,generic,}//

Because TEXMF is a {...} list and {latex,generic,} is a list too, the first is 
iterated over first. This means that my ~/texmf gets interwoven with the 
global texmfs in the search list (i.e. in the kpsewhich output 
above, /home/aid/holzensp hits are not grouped together). Should this be 
considered a bug?

Anyway, when I move ~/texmf/tex/pgf to ~/texmf/tex/latex/pgf it all works 

The reason that I have a single directory for the entire pgf package 
(including the generic, context, tex and latex parts) is that it makes it so 
much easier to do manual package maintenance. Putting this pgf directory in 
the latex part of my texmf means plain tex and context won't be able to find 

Norbert, I would suggest to either find a different format for the texmf.cnf, 
such that these directories are grouped by locality, or to make an explicit 
note about this behaviour somewhere.

I have a workable solution and my understanding of TeX (Live) has increase. As 
such, I'm as happy as can be ;)

Kind regards,

More information about the tex-live mailing list