Hello, I'd need to to hook \stoptext by Lua - I'd need to write something right before the end of the text. See the simple example: ---- t-Hook.mkiv \startluacode local stoptext_p = context.stoptext context.stoptext = function(...) context("END") stoptext_p(...) end \stopluacode \starttext \input knuth \stoptext % To be hooked by Lua ---- This code should write "END" right before the end of the document, but it doesn't. How to achieve that? - I'd rather Lua to TeX do the job as I need Lua to do more complicated things (the example above is very simplified). 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