[NTG-context] get tex-value in lua

Peter Münster pmlists at free.fr
Tue May 4 12:12:17 CEST 2010


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/




More information about the ntg-context mailing list