7

What is \kern instruction good for and how is it defined? I cannot find it in Knuth's book TeXbook.

  • 1
    First part of the question: Take a look at the results of a search for "keming" on the search engine of your choice (image search can turn out to be quite hilarious). Second part: \kern is a primitive, not a macro, so in TeX (the language) it is defined as \kern. – Skillmon Oct 13 at 17:32
  • 5
    The control sequence kern should be in the index of the TeXbook, marked with an asterisk to indicate that it is a primitive. – barbara beeton Oct 13 at 18:14
16

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.

  • 2
    To be more precise I couldn't have found the definition of \kern because it is in so many places in the TeXbook! – user2925716 Oct 13 at 18:25
  • 5
    @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. – Mico Oct 13 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.