[NTG-context] directlua in xml-environment

Hans Hagen pragma at wxs.nl
Sun Nov 13 18:23:41 CET 2016


On 11/13/2016 2:56 PM, Meer, Hans van der wrote:
> Here is something I do not understand. Possibly I am doing something wrong.
>
> The following code is fine, within <<>> the current contextversion is printed.
>   \def\mymacro{\directlua{tex.print("\\contextversion")}}
>   \starttext
>    calling mymacro <<\mymacro>>\par
>   \stoptext
>
> However calling \mymacro from inside \startxmlsetup .. \stopxmlsetup does not work and results in <<\contextversion>>. I guess that the catcode regime in that environment is to blame.
> But how do I change that in order to get things working? I looked into the LuaTeX-manual where catcodes in relation to tex.print are treated, but in vain and could not find how to.
>
> What do I have to change?
\starttexcode
  ...
\stoptexcode

> Hans van der Meer
>
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context at 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           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 ntg-context mailing list