Hello, I'm trying to hook commands.stoptext()... Here's a minimal example: why only the first image appears? ---- \startluacode local cmd_p local tab = {} f = function(a) if not cmd_p then cmd_p = commands.stoptext commands.stoptext = function(...) context("Hook") for _, v in ipairs(tab) do context.startTEXpage() context.externalfigure{v} context.stopTEXpage() end cmd_p(...) end end table.insert(tab, a) end \stopluacode \starttext A \ctxlua{f("cow")} \ctxlua{f("hacker")} \stoptext ---- When I modify the code: ---- ... for _, v in ipairs(tab) do --context.startTEXpage() context.externalfigure{v} --context.stopTEXpage() end ... ---- all figures are shown OK. Where's the problem? TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038