[tex-k] Exercise 8.6 of the TeXbook
Hanson Char
hanson.char at gmail.com
Tue Jul 23 06:57:23 CEST 2024
Here is a git diff of the proposed fix to the latest texbook.tex:
$ git diff
diff --git a/tex/texbook/texbook.tex b/tex/texbook/texbook.tex
index a1e5078..54975e2 100644
--- a/tex/texbook/texbook.tex
+++ b/tex/texbook/texbook.tex
@@ -2956,7 +2956,7 @@ category~9 when |INITEX| begins.)
characters, since the first |^^B| is converted to code~2 which doesn't
equal the following character |^|. Hence
the result is seven tokens: |^^B|$_7$ |^^B|$_7$
-|M|$_{11}$ \cstok{\^{}\^{}B} \]$_{10}$ |^^M|$_{11}$ \cstok{M\^{}\^{}M}.
+|M|$_{11}$ \cstok{\^{}\^{}B} |^^C|$_{10}$ |^^M|$_{11}$ \cstok{M\^{}\^{}M}.
The last of these is a control word whose name has two letters.
The \<space> after |\M| is deleted before \TeX\ inserts the \<return> token.
> On Jul 22, 2024, at 2:25 PM, Hanson Char <hanson.char at gmail.com> wrote:
>
> Hi,
>
> I think I may have found an error in the answer of exercise 8.6 on page 305 of the TeXbook.
>
>> EXERCISE 8.6
>> Assume that the category codes of plain TEX are in force, except that the characters
>> ^^A, ^^B, ^^C, ^^M belong respectively to categories 0, 7, 10, and 11. What tokens are produced from the (rather ridiculous) input line ‘^^B^^BM^^A^^B^^C^^M^^@\M␣’?
>> (Remember that this line is followed by ⟨return⟩, which is ^^M; and recall that ^^@ denotes the ⟨null⟩ character, which has category 9 when INITEX begins.)
>
> The current answer says the result is seven tokens as follows:
>
> ^^B_7 ^^B_7 M_11 ^^B ␣_10 ^^M_11 M^^M
>
> But shouldn't it rather be:
>
> ^^B_7 ^^B_7 M_11 ^^B ^^C_10 ^^M_11 M^^M
>
> ? Only the category code of ^^C is changed to 10, but the character code remains the same (ie 3).
>
> Thoughts?
>
> Regards,
> Hanson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-k/attachments/20240722/7c380ba9/attachment.htm>
More information about the tex-k
mailing list.