Javier Bezos wrote:
Taco:
which just wraps every letter inside \dolua{ }. However, the letters are silently ignored (but "print" prints it in the console, so lua is working). I presume the problem is "tex.print" is like a line in the tex file, while ocp's are applied after expansion, so when \dolua is executed it's too late and the line is sent to nowhere.
That is roughly what happens, yes. I have to look into this at some point, because silently disappearing output is a bit unfriendly, but the precise interaction between otp processing and input states is not the easiest bit of TeX to comprehend, so it may take a while.
OK. What I was wondering was if the whole OCP mechanim could be replaced by lua scripts. Since lua can be embedded in TeX, the transformations would be under the control of TeX and not as external files, unmodifiable at run time. So, I intented to write a OTP passing directly the OCP buffer to lua. Of course, that has some disadvantages since the result may need further expansion to reprocess it. Or perhaps not? This is what I liked to investigate.
lua callbacks will be avialable for each stage: input, after expansion, at various stages of list building, par building, page building, shipout etc Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------