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?

  • you can change the order in the miktex console. miktex then stores that in one of its configuration files. Sep 22 at 14:17
  • @UlrikeFischer I didn't know that, thank you. AFAIK, with TeX Live TEXINPUTS dictates the order in which the TEXMF trees are searched, whereas with Miktex you said its stored in a config file. Miktex also recognizes TEXINPUTS (See the link on TEXINPUTS in my post). Does it have a different meaning with Miktex than with texlive/kpathsea? Sep 25 at 10:30
  • Texinputs has nothing to do with the tree order Sep 25 at 12:19


You must log in to answer this question.

Browse other questions tagged .