Hello, running in circles I have to give up on such an easy thing as passing a tex variable to lua (knowing everything is stored in lua). \setvariable{test}{something}{HHHH} \starttext \getvariable{test}{something}\par % how to access the variable on lua end? \startluacode -- var = \stopluacode \stoptext Thank you, Jano
On 11/25/2020 11:54 AM, Jano Kula wrote:
Hello,
running in circles I have to give up on such an easy thing as passing a tex variable to lua (knowing everything is stored in lua).
\setvariable{test}{something}{HHHH} \starttext \getvariable{test}{something}\par % how to access the variable on lua end? \startluacode -- var = \stopluacode \stoptext Never give up ...
\starttext \setvariable{test}{something}{HHHH} \getvariable{test}{something}\par \meaning\getvariable \startluacode print(">>",tokens.getters.macro(tokens.getters.macro("??variables") .. "test:something")) \stopluacode \def\MyVariableSomething{JJJJ} \startluacode print(">>",tokens.getters.macro("MyVariableSomething")) \stopluacode \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Passing variables to Lua wikified
https://wiki.contextgarden.net/CLD_passing_variables#Variables.
Jano
On Wed, 25 Nov 2020 at 14:33, Jano Kula
Hello Hans!
On Wed, 25 Nov 2020 at 12:33, Hans Hagen
wrote: Never give up ...
\meaning\getvariable
Thank you for reminding me of this one.
print(">>",tokens.getters.macro(tokens.getters.macro("??variables") ..
"test:something")
Not that trivial, but does the job.
Thanks, Jano
participants (2)
-
Hans Hagen
-
Jano Kula