[luatex] read and write streams

jfbu jfbu at free.fr
Thu Nov 19 23:31:46 CET 2015

Le 19 nov. 2015 à 20:10, Markus Kohm <komascript at gmx.info> a écrit :

> Am Donnerstag, 19. November 2015, 18:48:53 schrieb jfbu:
>> to be
>> robust with respect to future enlargement of output streams for this task ?
> \newrite\terminal
> \immediate\write\terminal{Test}
> As long, as you do not open the new write, it will write to terminal and log 
> file. BTW: For LaTeX you should simply use \typeout. So for generic code you 
> may use something like:
> \begingroup\expandafter\expandafter\expandafter\endgroup
> \expandafter\ifx\csname typeout\endcsname\relax
>  \newwrite\@typeout
>  \def\typeout{\immediate\write\@typeout}
> \fi


I looked for rationale for doing a \newwrite rather
than direct \write128, and the only one I see is for
the package to provide the user an option to have
the concerned messages sent to a separate file 
if need be

This could be useful as things written to the log
seems to get hardwrapped every 79 characters 
(with pdftex, and it seems to be 80 characters
with luatex). Whereas they are not hardwrapped
when "\write" to another file.

I used \message initially but found it had 
somewhat unpredictable behavior with respect
to making new lines in the log, and I didn't
want to set \newlinechar. This is why I went
for \write16, but the hard-wrapping somewhat
annoys me.

I am sure the 80 characters vs 79 characters
must have been discussed on this list before,


More information about the luatex mailing list