What is \kern
instruction good for and how is it defined?
I cannot find it in Knuth's book TeXbook.
1 Answer
A "kern" is a typographic term for a nonbreakable space between two items. These items are usually, but not exclusively, glyphs.
\kern
is a TeX primitive that serves to insert nonbreakable space. E.g., a\kern3pt b
inserts 3pt
of nonbreakable space between a
and b
. \kern
may occur in either horizontal mode (to insert horizontal space) or vertical mode (to insert vertical space). Something that \kern
can do but which is not feasible in traditional, i.e., metal-based, typography is to set a negative kerning amount. E.g., \kern-1em
deletes rather than inserts 1em of space.
I cannot find [the term] in Knuth's book TeXbook.
That's quite puzzling. The TeXbook's index states that \kern
occurs on pp. 10, 40, 66, 75, 87, 168, 256, 263, 280, 306, 389, 395-395, 416, 424, and 454-455. In addition, according to the book's index, the word "kerns" occurs on pp. 4, 66, 75, 95-97, 110, 157, 168, 280, 286, 306, 444, and 454-455.
-
2To be more precise I couldn't have found the definition of
\kern
because it is in so many places in the TeXbook! Oct 13, 2019 at 18:25 -
8@user2925716 - Since
\kern
is not a macro but a "primitive" instruction, it's not formally defined anywhere in Volume A of "Computers and Typesetting,Volume A", aka "The TeXbook". To find the exact algorithm that defines a TeX primitive, one must consult "Computers and Typesetting, Volume B", aka "TeX: The Program". That said, the entry for\kern
on p. 280 of the TeXbook (the page number is underlined in the index) comes pretty darn close to a formal definition this primitive.– MicoOct 13, 2019 at 18:44
\kern
is a primitive, not a macro, so in TeX (the language) it is defined as\kern
.kern
should be in the index of the TeXbook, marked with an asterisk to indicate that it is a primitive.