This question is about organising files in a package for CTAN.
How can I load lua and tex helper files in the documentclass so that they are found when the package is installed in the TeXLive folders?
I would like to upload this package to CTAN: wallcalendar
Some of its functionality depends on running helper Lua functions which are collected in a helper script and used this way:
\luadirect{
require("./scripts/wallcalendar-helpers.lua")
monthEvents(
\luastring{\@t@monthName},
\@t@filterPred,
\@t@formatFunc,
\luastringO{\@t@formatCmd},
\luastring{\@t@eventsCsv},
\luastring{\@t@markDefaultsCsv},
\@t@minEvents
)}}
And there are helper tex files which define names of things for a given language, such as i18n/hungarian.tex
Used this way:
% Load internal translations
\InputIfFileExists{i18n/\@wall@calendarLanguage.tex}{}%
{\ClassError{wallcalendar}{File Not Found: i18n/\@wall@calendarLanguage.tex}{}}
These methods only work when the files are copied in the project folder (where the user's document such as mycalendar.tex is).
kpse.find_file("wallcalendar-helpers.lua"). This will return the correct path to the script (to be used in you require). – TeXnician Oct 17 '17 at 05:21kpseit is built in to Lua's default input search in luatex. – David Carlisle Oct 17 '17 at 06:47