I tried the following code: \directlua0{ local function simpleone() return "I'm number 1" end local function simpletwo() texio.write_nl("I'm number 1") end callback.register("start_run",simpletwo) } and got no result neither by replacing simpletwo by simpleone in the callback. Is it normal? The simpletwo function works fine with the callbacks "stop_run". -- Elie
Elie Roux wrote:
I tried the following code:
\directlua0{ local function simpleone() return "I'm number 1" end
local function simpletwo() texio.write_nl("I'm number 1") end
callback.register("start_run",simpletwo) }
and got no result neither by replacing simpletwo by simpleone in the callback. Is it normal?
The luatex run has started already, so your callback.register comes too late. You need to define the function and the callback.register in the startup lua script. Best wishes, Taco
Taco Hoekwater a écrit :
The luatex run has started already, so your callback.register comes too late. You need to define the function and the callback.register in the startup lua script.
Ok, thank you for your explanations! I think some words about it in the manual would be good, even if now that you say it, it's logical. -- Elie
participants (2)
-
Elie Roux
-
Taco Hoekwater