# [texhax] Ref. Man. Bausum [was tabbing]

Karl Berry karl at freefriends.org
Fri Sep 15 23:57:12 CEST 2006

    In my example I asked for a macro for which
\accent is a "hard-wired shorthand" in the previous sense.

I guess it might be possible to to program the most important part of
\accent in macros, but I don't propose to do it for the mere sake of the
exercise :).  Here is the description of the make_accent procedure from
tex.web:

-------------------------------------------------------------------------------
@ The positioning of accents is straightforward but tedious. Given an accent
of width |a|, designed for characters of height |x| and slant |s|;
and given a character of width |w|, height |h|, and slant |t|: We will shift
the accent down by |x-h|, and we will insert kern nodes that have the effect of
centering the accent over the character and shifting the accent to the
right by $\delta={1\over2}(w-a)+h\cdot t-x\cdot s$.  If either character is
absent from the font, we will simply use the other, without shifting.
-------------------------------------------------------------------------------

The slant is one of the \fontdimen parameters, and the char dimensions
could (I guess) be found by typesetting them in an \hbox, and then
laboriously doing all the calculations ...

There would be some TeXnical differences, as later on tex.web says:

-------------------------------------------------------------------------------
@ The kern nodes appended here must be distinguished from other kerns, lest
they be wiped away by the hyphenation algorithm or by a previous line break.

The two kerns are computed with (machine-dependent) |real| arithmetic, but
their sum is machine-independent; the net effect is machine-independent,
because the user cannot remove these nodes nor access them via \.{\\lastkern}.
-------------------------------------------------------------------------------

As far as I know, there's no way to insert such implicit kerns at the
.tex source level.

Cheers,
k