Broadly speaking, how does LaTeX look for class and styles in a *nix based system?

More specifically, export TEXMFHOME='~/.config/texmf' followed by texhash ~/.config/texmf is not referenced when I call one of my own classes or styles. Interestingly, even if TEXMFHOME remains as I have just described, LaTeX will still search ~/texmf/tex/latex/local/ for classes and styles. That leads me to believe that it will always look there but perhaps I am wrong.

So, how does LaTeX search for classes / styles? Which folders does it look within, and how do you edit those settings?

EDIT: Unlike other questions, I am also wondering how to edit these recursive settings, either by declaring variables or editing config files.

  • 1
    Many TeX implementations on those systems relies, for file lookup, on the kpathsea library, whose behavior is detailed in the kpathsea manual. – GuM Aug 26 '19 at 2:12
  • Have you read, for example, this answer? – GuM Aug 26 '19 at 2:24
  • 2
    You should never do mktexlsr on TEXMFHOME. – egreg Aug 26 '19 at 15:49
  • @egreg how come? – Justapigeon Aug 26 '19 at 16:43

Browse other questions tagged or ask your own question.