[luatex] Strange behavior of tex.print.

Paul Isambert zappathustra at free.fr
Fri Apr 29 09:46:27 CEST 2011


Le 29/04/2011 09:25, Ulrike Fischer a écrit :
> Am Fri, 29 Apr 2011 07:46:06 +0200 schrieb Patrick Gundlach:
>
>> Hi Paul,
>
>>> The manual states about tex.print(n,<strings>) that ``if n is
>>> not a valid catcode table, then it is ignored, and the currently
>>> active catcode regime is used instead.'' However (with catcode
>>> table 1 not initialized):
>>> tex.print(1, "a", "\relax")
>
>>> returns ``aflflelax'' (with the ``fl'' ligature, i.e. character
>>> 13 in CM). So: is that a bug, an inaccuracy in the manual, or
>>> have I misunderstood something? My LuaTeX is v.0.66.
>> I am not awake yet: isn't this due to the single backslash? \r =
>> 13 so that the chars 97,13,101,... get printed. I can't explain
>> the f before the e, so my attempt is probably wrong.
> The first "fl" is dued to the newline between the two strings, the
> second to the carriage return "\r". But the question is why one
> doesn't get the same results as with tex.print(-1,...):
>
> tex.print(-1, "a", "b")       --gives "a b"
> tex.print(-2, "a", "b")       --gives "ab"
> tex.print(111, "a", "b")      --gives "aflb" why?
> tex.print(-1, "c", "\relax")  --gives "c"
> tex.print(9, "c", "\relax")   --gives "cflflelax" why?

Thanks Patrick and Ulrike, the second fl is indeed \r, I missed that; 
now the questions is: why are end-of-line characters printed as if they 
had catcode 12?

Paul


More information about the luatex mailing list