[tex-k] How extra space in log may be fixed after \batchmode

Igor Liferenko igor.liferenko at gmail.com
Fri Aug 7 06:57:19 CEST 2020


Hi all,

> I suspect term_offset is >0 in the Q case, and not the others,
> precisely because of the lack of a newline after "Entering \batchmode".

The fact that extra space is printed in the Q case is a bug, IMHO.
Think about it: why do we print that space at all? It is needed when
we are not in the beginning of line. But here we *are* in the beginning
of line, because of this code:

     print("..."); print_ln; update_terminal; return;

(notice the `print_ln').

So, in the Q case the extra space is not intentional.
Rather, it is printed as a side effect
that we do not output newline after "Entering \batchmode".

But then another question rises: why do we check
term_offset *and* file_offset:

> 12677 else if (term_offset>0)or(file_offset>0) then print_char(" ");
> 12678 print_char("["); j:=9;

Aren't terminal and file output supposed to be in sync?
I suppose they are. So, there is a simple fix for this bug
(it passes TRIP):

> 12677 else if (term_offset>0)or(file_offset>0) then print_char(" ");
< 12677 else if (file_offset>0) then print_char(" ");

If terminal and file output aren't supposed to be in sync,
then this fix may be used instead (it also passes TRIP):

> 12677 else if (term_offset>0)or(file_offset>0) then print_char(" ");
< 12677 else if
((term_offset>0)and(interaction<>batch_mode))or(file_offset>0) then
print_char(" ");

Regards,
Igor


More information about the tex-k mailing list.