Hallo, I tried the following -------------------------------------- \starttext \startluacode local OldPreLB function MyPreLB(head,gc) texio.write_nl("########### Here I am!") OldPreLB(head,gc) end OldPreLB = callback.find('pre_linebreak_filter') callback.register('pre_linebreak_filter',MyPreLB) \stopluacode Test \stoptext -------------------------------------- but MyPreLB() is not called. What I am doing wrong here? Wolfgang
On Thu, Apr 08 2010, Wolfgang Werners-Lucchini wrote:
[...]
but MyPreLB() is not called. What I am doing wrong here?
Hello Wolfgang, I don't know, but I've played a bit with your example file: \starttext \startluacode local OldPreLB function MyPreLB(head,gc) tex.print("Here I am!") return OldPreLB(head,gc) end local id, error = callback.register('pre_linebreak_filter', MyPreLB) if id == nil then tex.print("Error string:", type(error), "\\par") end \stopluacode Problem: callback.register returns nil, but no error message. \stoptext Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/
2010/4/9 Wolfgang Werners-Lucchini
Hallo,
I tried the following
-------------------------------------- \starttext \startluacode local OldPreLB
function MyPreLB(head,gc) texio.write_nl("########### Here I am!") OldPreLB(head,gc) end
OldPreLB = callback.find('pre_linebreak_filter') callback.register('pre_linebreak_filter',MyPreLB) \stopluacode
Test \stoptext --------------------------------------
but MyPreLB() is not called. What I am doing wrong here?
Hi Wolfgang, see http://www.ntg.nl/pipermail/ntg-context/2010/047018.html -- Best regards, Li Yanrui (李延瑞)
participants (3)
-
Li Yanrui (李延瑞)
-
Peter Münster
-
Wolfgang Werners-Lucchini