Go to the first, previous, next, last section, table of contents.


File lookup

This section describes how Kpathsea searches for most files (bitmap font searches are the exception, as described in the next section).

Here is the search strategy for a file name:

  1. If name has a suffix, search for exactly name along the appropriate path. Example: given `foo.sty', look for `foo.sty' before `foo.sty.tex', even though it's a TeX input file.
  2. If the file format defines a default suffix, and the suffix of name is not already that default, try appending the default. Example: given `foo.bar', search for `foo.bar.tex'. But if given `foo.tex', don't bother to search for `foo.tex.tex'.
  3. If we're searching for a TFM, PK, or GF file, look for aliases of name in `texfonts.map' files (see section Fontmap). Example: given `Times-Roman', find `ptmr'.
  4. If the file format defines a program to invoke to create missing files, run it (see section `MakeTeX' scripts).
  5. Search for name itself, if we haven't done so already. Example: given `foo', search for `foo'.

This is implemented in the routine kpse_find_file in `kpathsea/tex-file.c'. You can watch it in action with the debugging options (see section Debugging).


Go to the first, previous, next, last section, table of contents.