finding locations of many files via kpse

Norbert Preining norbert at preining.info
Thu Jan 16 02:24:52 CET 2025


Hi Karl,

> I've just committed (r73462) a simple change to kpsewhich so that it
> will output a blank line for files that are not found, if multiple input

Thanks, much appreciated ... but in the end I have opted for a lua based
approach, because I needed to check for different extensions, too.

The current script is here:
https://github.com/arXiv/submission-tools/blob/master/tex2pdf-tools/tex2pdf_tools/preflight_parser/kpse_search.lua
It is not super intelligent, nor super nice, but it does it work.

-- Usage:
--   texlua kpse_search.lua [-mark-sys-files] <directory>
--
-- Change into the given directory, then read file names and extensions
-- from stding and try to resolve them via kpse, reporting the findings.
--
-- Input format:
-- Input comes in two line units. The first line contains the filename
-- to look up. It *can* have an extension, but does not need to have.
-- The second line contains a list of extensions to be tested in case
-- the <filename> itself cannot be found using kpse
--
--   filename
--   ext1 ...
--   ...
--
-- Output format:
-- Output comes again in two line units. The first line is the same as
-- the first line of the input, the second line lists the found file, or
-- is empty if not found.
--
-- The option -mark-sys-files can be used to prefix found files with
--   SYSTEM:
-- if they come from the respective TeX installation, and not from the
-- input directory.

Best regards

Norbert

--
PREINING Norbert                              https://www.preining.info
arXiv / Cornell University   +   IFMGA Guide   +   TU Wien  +  TeX Live
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the texhax mailing list.