[luatex] behavior of \write in LuaTeX differs from the one of PdfTeX/XeTeX
Joseph Wright
joseph.wright at morningstar2.co.uk
Wed Mar 25 11:22:23 CET 2015
On 25/03/2015 09:44, Hans Hagen wrote:
> On 3/24/2015 7:36 PM, jfbu wrote:
>> Hi,
>>
>> this is presumably related to
>>
>> % http://tracker.luatex.org/view.php?id=733
>>
>> % http://tex.stackexchange.com/questions/65151/scantokens-in-luatex
>>
>> % http://tug.org/pipermail/lualatex-dev/2011-November/001376.html
>>
>> which address the behavior of \scantokens
>>
>> While investigating the issue I ended up with this,
>> which might very well have been discussed here or is
>> already on the tracker.
>>
>> If I assign catcode 12 to the CTRL-M character, and then
>> \write ^^M to an external file:
>>
>> with pdftex/xetex we get ^^M (three characters) in the file
>> with LuaTeX we get a single CTRL-M (ascii code 13) in the file
>
> if i run
>
> \starttext
>
> \edef\newline{\directlua{tex.write(string.char(10))}}
>
> \newwrite\out %
> \immediate\openout\out=\jobname.out %
> \immediate\normalwrite\out {a\newline b}%
> \immediate\normalwrite\out {c^^Md}%
> \immediate\closeout\out %
>
> \stoptext
>
> i get
>
> a
> b
> c^^Md
>
> which looks ok to me from the perspective of luatex
Isn't that a very different thing: ConTeXt has \catcode`\^=12 here (so
the above fails with plain).
--
Joseph Wright
More information about the luatex
mailing list