On 8/27/20 7:35 PM, Wolfgang Schuster wrote:
> [...]
> You have to replace %% with \letterpercent\letterpercent because you're
> still playing with TeX rules.
>
> \startxmlsetups xml:special
>      \startitem
> \cldcontext{string.gsub("\xmlraw{#1}{.}","\letterpercent\letterpercent","\\letterpercent{}")}
>      \stopitem
> \stopxmlsetups

Many thanks for your reply, Wolfgang.

Now I understand what was going on.

> To avoid these limitations create a new Lua function and call only this
> function in the setup:
>
> \startluacode
>
> moduledata = moduledata or { }
>
> function moduledata.special(str)
>      return string.gsub(str,"%%","\\letterpercent{}")
> end
>
> \stopluacode
>
> \startxmlsetups xml:special
>      \startitem
>      \cldcontext{moduledata.special([[\xmlraw{#1}{.}]])}
>      \stopitem
> \stopxmlsetups

Now I see that I have a lot to learn.

Many thanks again for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to