[luatex] Getting the extra primitives?

Manuel Pégourié-Gonnard mpg at elzevir.fr
Tue Feb 16 13:52:48 CET 2010


Taco Hoekwater a écrit :
> function somefunction(A, B)
>   if A == B then
>     tex.sprint("\\@firstoftwo")
>   else
>     tex.sprint("\\@secondoftwo")
>   end
> end
> 
I'd suggest that a more robust version would use the optional "catcode table"
argument of tex.sprint() in order to make sure the strings like "\\@firstoftwo"
are correctly tokenized. Assuming that \catcodetable42 is the standard LaTeX
catcodes plus @ a letter,

function somefunction(A, B)
  if A == B then
    tex.sprint(42, "\\@firstoftwo")
  else
    tex.sprint(42, "\\@secondoftwo")
  end
end

should work in all circumstances.

By the way, Joseph, do this question mean you are implementing basic support for
LuaTeX in expl3? I'd be glad to hear that!

Manuel.


More information about the luatex mailing list