Skip to content

alias FindReadFileCallback


(alias) FindReadFileCallback = fun(id_number: integer, asked_name: string) -> string?

Find a file for input (0) or openin (higher integers).

Arguments:

id_number

This number is zero for the log or input files. For TeX's read or write the number is incremented by one, so \read0 becomes 1.

asked_name

This is the user-supplied filename, as found by input, openin or openout.

Return value:

actual_name

This is the filename used. For the very first file that is read in by TeX, you have to make sure you return an actual_name that has an extension and that is suitable for use as jobname. If you don't, you will have to manually fix the name of the log file and output file after LuaTeX is finished, and an eventual format filename will become mangled. That is because these file names depend on the jobname.

You have to return nil if the file cannot be found.

😱 Types incomplete or incorrect? 🙏 Please contribute!