While investigating some things about TeX, I stumbled across TEXINPUTS, which one can use to tell (La/pdf/..?)TeX where to find it's files. I decided to look into it a bit closer and learned about kpathsea, which seems to be where TEXINPUTS is used to guide file search. kpathsea also defines some other variables, like TEXMFHOME, TEXMFDIST and most importantly TEXMF, which is used in the definition of TEXINPUTS in the texmf.cnf
file: TEXINPUTS = $TEXMFDOTDIR;$TEXMF/tex/{$progname,generic,latex,}//
.
Therefore, one can read the order in which the texmf trees are searched (by default) from the definition of TEXMF.
What I am curious about is whether this works not only with TeX Live, but also MikTeX and other distributions. The texmf.cnf
file is located in a subfolder of texlive. According to Christian Schenk's comment on this post, MikTeX does not use kpathsea but rather an emulation of it. MikTeX also has an env-var called TEXINPUTS, but I couldn't find anything about the other TEXMF variables.
If MikTeX does not use the TEXMF variable, how is the precedence of the different trees / roots handled?
TEXINPUTS
dictates the order in which the TEXMF trees are searched, whereas with Miktex you said its stored in a config file. Miktex also recognizesTEXINPUTS
(See the link on TEXINPUTS in my post). Does it have a different meaning with Miktex than with texlive/kpathsea?