Skip to main content

Crate retex_lua

Crate retex_lua 

Source
Expand description

Embedded Lua 5.3 and the LuaTeX Lua API.

LuaTexHost implements the engine’s LuaHost trait. During a \directlua call the engine is lent to Lua as scoped userdata stored in the registry under ENGINE_KEY. Library functions borrow it from there, so no Lua object can outlive the borrow. Nested calls (Lua → TeX → Lua) install a fresh scoped reference and restore the previous one afterwards.

The libraries follow the LuaTeX reference manual (chapter 10, “The TeX related libraries”) and are checked against the behaviour of the reference luatex binary.

Modules§

luaotfload
A native replacement for luaotfload.
nodelib
The node library (LuaTeX manual §10.5) and node.direct.

Structs§

LuaTexHost
The Lua interpreter with LuaTeX’s libraries.

Constants§

ENGINE_KEY
Registry key of the scoped engine reference.

Functions§

lua_error_message
Formats a Lua error the way LuaTeX reports it: the message without mlua’s decorations.
luac
--luaconly: compiles Lua files to bytecode, with luac’s options -o name (default texluac.out), -s (strip debug information), -p (parse only) and -v (version). Combining several files into one chunk and listings (-l) are not supported.