# [texhax] TeX Queries (1)

Barbara Beeton bnb at ams.org
Mon Jul 9 23:15:18 CEST 2012

hi, paul,

> A few Tex queries from the TeXBook. I'm looking at the TeX source,
> [...]

when someone reports the existence of a
pdf file of the texbook online, i write
a note (if i can find someone to write it
to) pointing out the terms of the copyright
and requesting that the file be removed
from public view.

regarding the file cited in the original
question, it is a prepublication version,
with index entries also included as margin
notes; those disappeared when the version
to be printed was processed.  however, the
presence of the margin notes is one of the
reasons for the question, so it's worth
a mention.

> chapter 1, page 1, paragraph 1:
> English words like technology' stem from a Greek root <elipsis> which
> is an uppercase form of $\tau\epsilon\chi$.^^{TeX (actually \TeX),
> meaning of} ^^|\tau|^^|\epsilon|^^|\chi|
>
> Does ^^{ ... }' signify a margin note?  I'm calling it a margine note
> because it appears separate from the main text on the right edge of
> the page.

The whole situation with ^{...}' deals with the index; it is explained
lines 23907 and following of the sources. (That the expressions are in
the margin is only for proofreading.)

yes.  this is a temporary expedient to allow
the author to make sure that everything he
wanted to be indexed did, in fact, have an
index entry.

Paul S: so let me get this right, ^^{ ... }' is not for inserting margin
notes?  The TeXBook says it stand for a silent index entry''.  What does
the single up arrow construct (^{...}') do?  TBH I'm getting a bit
confused now.

this input code *does* generate margin notes
for preliminary versions of the book, but
that is not its primary purpose, which is to
generate index entries.

the macros used to structure the texbook and
other volumes in the "computers and typesetting"
series are in the file  manmac.tex , which is
located in the same directory as plain.tex.

> chapter 2, page 3, paragraph 2:
> In the first place, there are two kinds of <elipsis> that shows up as
> something like {\tt\char'22}, and an apostrophe or right-quote that
> looks like {\tt\char'15} or {\tt\char'23}.
>
> \char' according to some web sources maps numeric values to their
> corresponding unicode characters.  in the above extract the macro is
> separated from the numeric value by an apostrophe. I've seen both a
> grave accent () and a double quote mark (") used in examples on the
> web. Do the symbols declare different things about the number that
> follows them?

The syntax is: \char<number>; and a number can be octal (prefixed with a
single quote) or hexadecimal (double quote), and of course decimal
(unprefixed). For the grave I can't see any usage but denoting a number
via a character, i.e. \a (meaning 97, with the backslash optional in
this case).

By the way, \char<number> simply typesets the character at position
<number> in the font <elipsis>

Paul S : Could you elaborate on this please? Is there a reference table for
these values and their respective chars?

i have an octal / hex / decimal equivalence
table, but since it was set up for visual
inspection as a one-page ascii file, i think
like a copy, let me know and i'll send it to
you off line.

regarding what character (actually, glyph)
resides in which position, that varies with
the font.  alphabetic fonts created for tex
generally have digits and latin letters in
their "usual" ascii locations, but otherwise,
locations may be seemingly random.  one thing
they are not is arranged in unicode order.

for the computer modern fonts, the original
source of information regarding location is
in the .mf files used to generate the fonts.
that's not at all easy to slog through.
however, quite a bit can be deduced from the
\mathcode tables in plain.tex.  for example,
\mathcode\^^@="2201 % \cdot
can be taken apart as follows:
\^^@ -- the input convention for the ascii value "00
" -- the next four digits are hex
2 -- the "class" of the symbol (2 = relation)
2 -- the font (2 = symbol, cmsy)
01 -- the location in the font
% \cdot -- a comment saying what the symbol is

looking through plain.tex, i see that for
other characters, \delcode (for delimiters),
\chardef and \mathhexbox are also used to
"locate" symbols in fonts.  mostly the values
are represented in hex, but i see that the
location of accents is sometimes identified
in decimal (as in  \def\aa{\accent23a} ) or in
octal (as in  \def\AA{...{...\hbox{\char'27}}A} ).

it's possible that there's a better resource
for this that isn't visual, but i can't think
of one offhand.

regarding fonts that weren't originally
intended for tex use, the story is quite
different, and i can't be of much help.
-- bb
`