[Tex/LaTex] Bad positioning of math accents for the beamer standard font

accentsbeamerfont-metricsmath-mode

With a recent TeX distribution, the easy answer to this question is "load the sansmathaccent package" (which is Ariel's implementation of my answer). Actually, the corrected font should be loaded automatically by beamer, but somehow this doesn't work at the moment.


I just went to a math conference where I saw lots of slides prepared with the beamer class that contained badly positioned math accents like these: . The LaTeX file is

\documentclass{beamer}
\begin{document}
\begin{frame}{}
$\tilde M$ $\dot u$ $\hat T$
\end{frame}
\end{document}

As you can see, the accents are centered over the bases of the corresponding letters, i.e., the skew of the letters isn't taken into account. I'm pretty sure that the reason for this is missing entries in the kerning table of the standard math font; see also the discussion of the \skewchar in this post.

I know that one option would be to try other fonts, but I don't like this for two reasons: Firstly, I otherwise do like the appearance of the standard fonts, and secondly, if I use different fonts, then I'll still have to live with looking at the slides of all the others who use the standard fonts. So my questions are: Does there exist a fix that gives me well-behaved standard fonts with beamer, and is there hope that the above LaTeX file will yield correctly positioned accents in some future version of beamer? (I think it wouldn't be a problem to make such a change in the fonts of the class as it won't affect the bounding box of, e.g. \dot u, so it wouldn't lead to any changes in spacing, line breaks and page breaks.)

Best Answer

You can use the \skew macro:

\skew{shift}{accent}{character}

Specifically, I would define macros for the symbols. So they can easily be adjusted later, especially if a font change occurs.

\newcommand*{\Mtilde}{\skew{5}{\tilde}{M}}
\newcommand*{\That}{\skew{3}{\hat}{T}}
\newcommand*{\udot}{\skew{3}{\dot}{u}}

Gives in beamer:

alt text