'a^^Mb' isn't equivalent to 'a<return>b'; instead throws pdftex into an extended mode

You are forgetting that TeX works on lines. By inserting ^^M part-way through your input line, all of the rest of it is ignored: TeX (at the macro level) never sees the B\bye so stops at the 'waiting for more input' prompt. Add \tracingall and perhaps a second \bye on a newline to see this.


Page 47 of the TeXbook, second doubly dangerous paragraph:

If TeX sees an end-of-line character (category 5), it throws away any other information that might remain on the current line. Then if TeX is in state N (new line), the end-of-line character is converted to the control sequence token ‘par’ (end of paragraph); if TeX is in state M (mid-line), the end-of-line character is converted to a token for character 32 (‘⍽’) of category 10 (space); and if TeX is in state S (skipping blanks), the end-of-line character is simply dropped.

The category code 5 character is normally inserted in the reading phase, when TeX absorbs a record (a line of input), but in the end any category code 5 character obeys the rule above.

The ^^ convention allows you to explicitly input a category code 5 character, which makes TeX apply the stated rule. Also ^^0d would do the same.

With par I denote what the TeXbook boxes, that is, the control sequence token with that name, as distinct from the primitive \par.


TeX is not “thrown into an extended mode”: the note you see in the log file precedes any input, as you can infer from the open parenthesis that follows the note. It’s simply telling you that e-TeX extensions are being included (actually they have been included during format creation).

The asterisk denotes “interactive mode” and is the prompt for more input, because TeX has ended reading the file you specified on the command line, as can be inferred from the closed parenthesis after the file name. Had you called pdftex -interaction=nonstopmode test29.tex the console would have shown

entering extended mode
(./test29.tex)
! Emergency stop.
<*> test29

where <*> is telling the same information: TeX needed input and, being in non-stop mode, it halts.

Tags:

Tex Core