[luatex] Strange behavior of tex.print.

Ulrike Fischer luatex at nililand.de
Fri Apr 29 09:25:46 CEST 2011

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?

Ulrike Fischer 

More information about the luatex mailing list