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