[luatex] LUA_INIT mechanism in texlua?
Jean-François Burnol
jean-francois.burnol at univ-lille.fr
Thu Jun 2 09:46:26 CEST 2022
Hi,
Afer reading https://www.lua.org/manual/5.1/lua.html I learned about LUA_INIT.
I have tested it and it works with my lua binary but not with texlua.
For my test with lua I used this file with the executable bit on:
---
#!/usr/bin/env lua
foo = foo or "bonjour"
print(foo)
---
Then (in a bash shell):
export LUA_INIT="foo=\"Guten Tag\""
./test.lua
Guten Tag
Now, a copy of the file above but using "/usr/bin/env texlua" in place of "lua" does not act the same:
./test.texlua
bonjour
echo $LUA_INIT
foo="Guten Tag"
I checked the manpage of texlua (which is the one of luatex) and see no mention.
I searched the lua.pdf documentation for string _INIT and found nothing.
Is there some replacement for LUA_INIT functionality?
Rationale of my question: I was looking into LaTeX3 documentation and wanted
to typeset some of it including implementation. After some quick digging
I understood that the l3build script has a variable
typesetcmds and I first tried to set it on command line but I learned that
it is probably not possible, then I read about LUA_INIT in the Lua documentation
as mentioned above,
which would be nice if it worked with l3build too (i.e. with texlua).
I would be happy to be allowed to do (bash shell) something such as
env TEXLUA_INIT='typesetcmds=""' l3build doc
rather than having to modify a file (either a l3build config or a dtx file)
which sorts of pushes me into rebasing a branch on each pull from upstream.
Please CC jfbu if replying
Best,
Jean-François
More information about the luatex
mailing list.