Finding TeX files

Peter Flynn peter at silmaril.ie
Wed Jun 10 14:57:48 CEST 2020


> On 10/06/2020 12:34, Jerry wrote:
> On Tue, 9 Jun 2020 22:48:10 +0100, Peter Flynn stated:
>>> kpsewhich article.cls
>> 
>> On my Windows 10 machine, I get this result:
>> 
>> C:\Users\gerar> kpsewhich article.cls
>> C:/Users/gerar/AppData/Local/Programs/MiKTeX 2.9/tex/latex/base/article.cls

This is useful, thanks.


1. Coupled with what I found on a Mac, and what's on my Linux system, we 
have (in that order) the following installation-dependent paths¹:

    C:/Users/gerar/AppData/Local/Programs/MiKTeX 2.9/
    /usr/local/texlive/2016/texmf-dist/
    /usr/share/texlive/texmf-dist

followed IN EVERY CASE by the installation-INdependent path

    tex/latex/base/article.cls


2. If you are hunting for a file that you believe ought to be in your 
TeX system, ALWAYS try with kpsewhich first. It comes with every TeX 
installation.

If kpsewhich can't find it, that means TeX can't, either, because TeX 
uses the same programming as kpsewhich to find files.


3. If you believe the file does actually exist, the next step is to use 
your computer's own indexing system:

Windows: File Explorer
Mac:     Spotlight
Linux:   locate (command)

If that finds the file, then you need to work out why kpsewhich 
couldn't. Most likely it was something downloaded manually which ought 
to have been put "where TeX can find it" but wasn't. For this, read the 
FAQ entry at https://texfaq.org/FAQ-inst-wlcf and keep your files in the 
right places.


4. If both [2] and [3] fail, then EITHER the file is in a place that 
nothing ever looks in, OR the file genuinely isn't on your system, and 
may need installing.



Peter

¹ I don't have details for TeX Live on Windows.


More information about the texhax mailing list.