* accessing tex variable on lua side
@ 2020-11-25 10:54 Jano Kula
2020-11-25 11:33 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Jano Kula @ 2020-11-25 10:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 325 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 596 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing tex variable on lua side
2020-11-25 10:54 accessing tex variable on lua side Jano Kula
@ 2020-11-25 11:33 ` Hans Hagen
2020-11-25 13:33 ` Jano Kula
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2020-11-25 11:33 UTC (permalink / raw)
To: mailing list for ConTeXt users, Jano Kula
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing tex variable on lua side
2020-11-25 11:33 ` Hans Hagen
@ 2020-11-25 13:33 ` Jano Kula
2020-11-25 17:14 ` Jano Kula
0 siblings, 1 reply; 4+ messages in thread
From: Jano Kula @ 2020-11-25 13:33 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 320 bytes --]
Hello Hans!
On Wed, 25 Nov 2020 at 12:33, Hans Hagen <j.hagen@xs4all.nl> 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
[-- Attachment #1.2: Type: text/html, Size: 913 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing tex variable on lua side
2020-11-25 13:33 ` Jano Kula
@ 2020-11-25 17:14 ` Jano Kula
0 siblings, 0 replies; 4+ messages in thread
From: Jano Kula @ 2020-11-25 17:14 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 524 bytes --]
Passing variables to Lua wikified
<https://wiki.contextgarden.net/CLD_passing_variables#Variables>.
Jano
On Wed, 25 Nov 2020 at 14:33, Jano Kula <jano.kula@gmail.com> wrote:
> Hello Hans!
>
> On Wed, 25 Nov 2020 at 12:33, Hans Hagen <j.hagen@xs4all.nl> 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
>
[-- Attachment #1.2: Type: text/html, Size: 1411 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-25 17:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 10:54 accessing tex variable on lua side Jano Kula
2020-11-25 11:33 ` Hans Hagen
2020-11-25 13:33 ` Jano Kula
2020-11-25 17:14 ` Jano Kula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).