7

In the following posts and many other besides [0] [1], I've seen people use \vec{\mkern0mu x}, \vec{{} x}, and variants thereof to adjust the vector arrow's kerning.

How do these work? What's the difference?

12

\vec is defined as a "math accent", just like \hat and others. A math accent placed on a single character will have its position adjusted horizontally to sit over the visual top-center of the character. The amount of adjustment or "skew" is encoded in the kerning information of the font that x comes from as a kern between the character (x in the question) and another character identified by \skewchar. (If the \skewchar for the font is high above the baseline, like an accent character, then the kerns will be useful for ordinary typesetting also.)

A math accent placed over a composite math object is not adjusted horizontally. That is the point of the invisible bits used in the question -- converting a single character to a combined math list. Try the tests with the letter f for a clearer demonstration of the difference.

The accents and amsmath packages have definitions that attempt to adjust the positioning even over composite arguments.

Aside: \vec{\/x} is identical to \vec{\kern0pt x} but is quicker to type.


And another aside that probably provides too much detail . . .

The italic letter f in math has a lot of slope, so there is a big difference between \vec{f} and \vec{\/f}. To my eye, with the computer modern math italic fonts, the unskewed \vec{\/f} is clearly bad, but the automatically-adjusted \vec{f} is excessively skewed.

There is a plain-TeX macro \skew, which is inherited by LaTeX, that provides manual adjustment, replacing the automatic positioning based on kerning values:

\skew ⟨mu-factor⟩ ⟨accent⟩ ⟨symbol(s)⟩

The ⟨mu-factor⟩ gives the adjustment in terms of math units (mu, like the \mkern0mu in the question). A value of 3 or 4 looks right to me for f. This looks like

$\vec{f} - \vec{\/f} = \skew{3.5}\vec{f}$

Three f vectors

You wouldn't want to be typing \skewcommands before all your math accents, but for particular cases you may want to define new abbreviations like

\newcommand\vecf{\skew{3.5}\vec{f}}

if that is important notation in your work, and you are responsible for good presentation (as opposed to submitting to a journal where it will be re-typeset).

Note that \hat{f} looks great with its automatic positioning.

2
  • If no better answer pops up this week, I'll accept this. I still have one question though: What's a combined math list?
    – 0az
    Oct 13 '20 at 2:16
  • 1
    Ah! That's not any official terminology. Well, "math list" is, referring to a whole section of math or a portion inside { }. I was just trying to say that the argument (a math list) becomes not a single character, but a combination of multiple things (defeating the skew adjustment). Oct 13 '20 at 3:36

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.