0

On page 44 of The TeXbook, it says,

the “dangerous bend” sign used in this manual appears as character number 127 of font manfnt, and that font is selected by the control sequence \manual

On page 45 of TeXbook, it says,

Hence code 127 can be typed ^^?, and the dangerous bend sign can be obtained by saying {\manual^^?}. However, you must change the category code of character 127 before using it, since this character ordinarily has category 15 (invalid); say, e.g., \catcode‘\^^?=12

\font\manfnt=manfnt
\manfnt\char127
\bye

produces

enter image description here

  1. Why can it be produced? It is the character number 127, which belongs to category 15(invalid)?
\catcode`\^^?=12
{\manual^^?}
\bye

produces

! Undefined control sequence.
l.2 {\manual
            ^^?}
? 
  1. Why doesn't {\manual^^?} work?
3
  • 1
    Related: tex.stackexchange.com/questions/22632/…
    – gernot
    Nov 27, 2023 at 8:19
  • You are misinterpreting the first quote. \manual is not defined in plain.tex, but in the code of “this manual” (in this case in ”Macros for The TeXbook” aka manmac.tex).
    – cabohah
    Nov 27, 2023 at 9:01
  • BTW: \char always outputs the corresponding character of the current font. So the output of the character 127 of font manfnt is expected in your first example.
    – cabohah
    Nov 27, 2023 at 9:20

1 Answer 1

6

Why can it be produced? It is the character number 127, which belongs to category 15(invalid)?

catcodes control how input characters are interpreted, but there is no input character 127 here, \char127 just accesses the glyph in position 127 of the current font, so \catcode is not consulted at all.

Why doesn't {\manual^^?} work?

You are missing the definition of \manual (from manmac.tex)

enter image description here

\font\manual=manfnt % font used for the METAFONT logo, etc.

\catcode`\^^?=12
{\manual^^?}
\bye
11
  • Why does ^^? is related to \catcode? Does ^^ always output the symbol of ASCII?
    – Y. zeng
    Nov 27, 2023 at 9:27
  • 1
    ^^? is translated very early in tex's scanner so it is just as if you had typed the character 127 so then it looks up the catcode of 127 to see what kind of token to make. Nov 27, 2023 at 9:38
  • Okay. When TeX looks up what category of the character 127 is, it will find it is 15, witch indicates that the character 127 belongs to category 15. But, why \char127 won't be affected by category 15?
    – Y. zeng
    Nov 27, 2023 at 10:00
  • 1
    @Y.zeng no ^^ with two lowercase is the hex code, ^6 with a single uppercase is ctrl (ie shift by 64) Nov 27, 2023 at 10:30
  • 1
    @Y.zeng I was just saying same as the texbook part you quoted The |^^| notation is different from |\char|, because |^^| combinations are like single characters; for example, it would not be permissible to say |\catcode`\char127|, but |^^| symbols can even be used as letters within control words. Nov 27, 2023 at 10:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .