[Dev-luatex] variable

Hans Hagen pragma at wxs.nl
Mon Mar 5 18:00:12 CET 2018


On 3/5/2018 5:08 PM, and at linux.pl wrote:
> Hello,
> 
> Anybody know how I can set variable in tex?
> 
> For example
> 
> \count10=20
> \def\proste{To jest prosty napis}
>   a\directlua{tex.print(tex.count[10]+5)}b
>   a\directlua{tex.set("\proste","Trudne")}b
> \proste
> \bye
> 
> I need setup \proste definition to my own string
> 
> How I can read TeX variable \mynumber from lua
> and set variable \mynumber on TeX but set in lua script.

\starttext

\newcount\MyCount \MyCount = 20

\def\MyMacro{To jest prosty napis}

a\directlua{tex.print(tex.getcount("MyCount")+5)}b

a\directlua{token.set_macro("MyMacro","Trudne")}b

\MyMacro

\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
-----------------------------------------------------------------


More information about the dev-luatex mailing list