Pablo Rodriguez <mailto:oi...@gmx.es>
17. September 2015 18:47
Dear list,

I have the following sample:

\startluacode
function document.gouppercase(str)
tex.print(str:upper())
end
\stopluacode

\unexpanded\def\MyUpper#1%
{\ctxlua{document.gouppercase("#1")}}

\starttext
\doif{\MyUpper{adfalkjfaeñf}}{\MyUpper{aDFAlkjfaeñf}}{equal}{unequal}

\ctxlua{if string.upper("adfalkjfaeñf") == string.upper("aDFAlkjfaeñf")
then tex.print("equal") else tex.print("unequal") end}
\stoptext

Why are are the first two strings unequal?
You can’t use a unexpandable (which you created with \unexpanded) in ConTeXts \doifXXX commands.

PS. You need \doifelse and not \doif.

Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to