Skip to main content

Module kpathsea

Module kpathsea 

Source
Expand description

An implementation of (the central part of) kpathsea, the path searching library used by TeX. Used by instantiating a Kpathsea instance with the working directory.

Example:

use tex_engine::engine::filesystem::kpathsea::Kpathsea;
let kpse = Kpathsea::new(std::env::current_dir().unwrap());
assert!(kpse.kpsewhich("latex.ltx").path.to_str().unwrap().replace('\\' ,"/").ends_with("tex/latex/base/latex.ltx"));
assert!(kpse.kpsewhich("article.cls").path.to_str().unwrap().replace('\\' ,"/").ends_with("tex/latex/base/article.cls"));
// as expected, the `.tex` file extension is optional:
assert!(kpse.kpsewhich("expl3-code").path.to_str().unwrap().replace('\\' ,"/").ends_with("tex/latex/l3kernel/expl3-code.tex"));

Structs§

KPATHSEA
Kpathsea
A “database” of paths to search for files. Notably, the “global” part (e.g. the system-wide TEXINPUTS, TEXMF, etc.) is shared between all instances of Kpathsea. and lazily computed on first use. *
KpathseaBase
The “base” part of Kpathsea holding information about the “global” parts of the file database, which is (or should be) shared between all instances. Never needs to be instantiated directly; use the canoncial [static@KPATHSEA] instance instead.
KpseResult
The result of a Kpathsea search. TODO capitalization might be an issue. TeX is more permissive wrt case distinctions than the filesystem, (apparently) iff either not covered by an ls-R file or directly in a TEXINPUTS path…?

Statics§

LOG_KPATHSEA