Hello, How can I get the value of a variable or a mode in the lua part? Example: context --arguments=MyVar=true test And in test.tex: \starttext \startluacode local my_var = loadstring("return " .. get_value_of("MyVar")) if my_var then tex.print("TRUE") else tex.print("FALSE") end \stopluacode \stoptext TIA for any help! Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/
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/
participants (1)
-
Peter Münster