Re: [NTG-context] Hooking stoptext

2013-10-08 Thread Procházka Lukáš Ing . - Pontex s . r . o .
On Tue, 08 Oct 2013 13:40:26 +0200, Marco Patzer wrote: On 2013–10–08 Procházka Lukáš Ing. - Pontex s. r. o. wrote: I'm trying to hook commands.stoptext()... There is already a hook for that. No need to tinker with Lua. \setupexternalfigures [location=default] \setupdocument [after=\s

Re: [NTG-context] Hooking stoptext

2013-10-08 Thread Marco Patzer
On 2013–10–08 Marco Patzer wrote: > On 2013–10–08 Procházka Lukáš Ing. - Pontex s. r. o. wrote: > > > I'm trying to hook commands.stoptext()... > > There is already a hook for that. No need to tinker with Lua. > > \setupexternalfigures > [location=default] > > \setupdocument > [after=\setu

Re: [NTG-context] Hooking stoptext

2013-10-08 Thread Marco Patzer
On 2013–10–08 Procházka Lukáš Ing. - Pontex s. r. o. wrote: > I'm trying to hook commands.stoptext()... There is already a hook for that. No need to tinker with Lua. \setupexternalfigures [location=default] \setupdocument [after=\setups{document:after}] \startsetups [document:after] \sta

Re: [NTG-context] Hooking stoptext

2013-10-08 Thread Aditya Mahajan
On 2013-10-08, at 7:22 AM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: > 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 the

[NTG-context] Hooking stoptext

2013-10-08 Thread Procházka Lukáš Ing . - Pontex s . r . o .
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"

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread Wolfgang Schuster
Am 07.03.2012 um 18:37 schrieb Wolfgang Schuster: > > Am 07.03.2012 um 16:57 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: > >> ... Yes, that's it! Thanks a lot! > > You can also write your own stop/stop-commands for the document like > > \def\startmydocument > {\starttext} > > \def\stopm

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread Wolfgang Schuster
Am 07.03.2012 um 16:57 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: > ... Yes, that's it! Thanks a lot! You can also write your own stop/stop-commands for the document like \def\startmydocument {\starttext} \def\stopmydocument {\ctxlua{…}% \stoptext} and use them instead of \startte

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread Procházka Lukáš Ing . - Pontex s . r . o .
... Yes, that's it! Thanks a lot! Best regards, Lukas On Wed, 07 Mar 2012 16:50:01 +0100, Philipp Gesang wrote: On 2012-03-07 15:28, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Hello, I'd need to to hook \stoptext by Lua - I'd need to write something right before the end of the text.

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread Philipp Gesang
On 2012-03-07 15:28, Procházka Lukáš Ing. - Pontex s. r. o. wrote: > 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 > >

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread Procházka Lukáš Ing . - Pontex s . r . o .
... OK, your solution works - - But I'd need one which doesn't force user to hook manually; i.e. without: \let\Oldstoptext\stoptext \def\stoptext{% \startluacode context("END") \stopluacode \Oldstoptext } Hooking should be performed in a Lua function and should be "invisible"

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread luigi scarso
On Wed, Mar 7, 2012 at 3:39 PM, luigi scarso wrote: > > > 2012/3/7 Procházka Lukáš Ing. - Pontex s. r. o. > > Hello, >> >> I'd need to to hook \stoptext by Lua - I'd need to write something right >> before the end of the text. >> > > At least > \let\Oldstoptext\stoptext > \def\stoptext{% > \star

Re: [NTG-context] Hooking \stoptext

2012-03-07 Thread luigi scarso
2012/3/7 Procházka Lukáš Ing. - Pontex s. r. o. > Hello, > > I'd need to to hook \stoptext by Lua - I'd need to write something right > before the end of the text. > At least \let\Oldstoptext\stoptext \def\stoptext{% \startluacode context("END") \stopluacode \Oldstoptext} \starttext \input kn

[NTG-context] Hooking \stoptext

2012-03-07 Thread Procházka Lukáš Ing . - Pontex s . r . o .
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