[NTG-context] get tex-value in lua

Peter Münster pmlists at free.fr
Tue May 4 13:02:31 CEST 2010


On Tue, May 04 2010, Peter Münster wrote:

> How can I get the value of a variable or a mode in the lua part?

The solution is so simple... :

\ctxlua{userdata = userdata or {}; userdata.myvar = \env{MyVar}}
\starttext
\startluacode
if userdata.myvar then
    tex.print("TRUE")
else
    tex.print("FALSE")
end
\stopluacode
\stoptext

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/




More information about the ntg-context mailing list