On 1-8-2010 11:45, Jaroslav Hajtmar wrote:
\ctxlua{pars('\printaction')}
\blank[big]
Example 3)
The third example of my most interesting. Function parameter in example is a TeX macro \backslash printaction which not expanded, respectively expanded only when I printing it to TeX. Parameter of function is still string "\backslash printaction" in which it is futile to look for a comma separator. Comma not be found, although the content of macro face that is so. Is there a possibility for this case, as in some way to save to Lua variable content of macro (of course expanded)?
\ctxlua{pars('\\printaction')}
currently the tex parsing and expansion code is not available in luatex (future versions might provide some introspection or expansion code, but it's a hairy topic) Anyhow, given that \printaction is defined you can use the token library to see what's in there (you then can sort of reconstruct the content). Another approach is a two-step: function step_1(str) -- str = \whatever tex.print("\ctxlua{step_2('",str,"')}") end It all depends on what you want to do. Why do you want to look into \whatever? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------