With a recent TeX distribution, the easy answer to this question is "load thesansmathaccentpackage" (which is Ariel's implementation of my answer). Actually, the corrected font should be loaded automatically bybeamer, 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

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.)

+1 Yeah! That also annoys me to no end. My personal "solution" to it has been to avoid math accents as much as possible when using Beamer. I would love it if someone has an answer.
–
Willie WongOct 16 '10 at 14:09

1

@Willie Wong: Since avoiding math talks as much as possible is not a viable solution, I'll probably notify the beamer maintainers, as proposed by Khaled.
–
Hendrik VogtOct 17 '10 at 7:59

@Willie: I went ahead and talked to Joseph Wright; you can find a preliminary result below.
–
Hendrik VogtDec 22 '10 at 14:40

Thanks, that's not a bad workaround. I'll still have to guess the amount of the skew, but at least the macro is easy to use. What a pity that other people won't use the workaround and I'll still have to see all these talks with misaligned accents.
–
Hendrik VogtDec 21 '10 at 16:10

OK, after talking to Joseph Wright I went ahead and wrote a patch for cmssi, which is the standard math font in beamer. The problem is that this font (computer modern sans serif italics) is designed as a text font, so it doesn't contain any information about positioning of accents. Compare these for before and after patching:

Now the answer (hopefully) is in its final version and ready for use. However, what I'm going to write will only work on Unix type systems. Strangely enough, the patch I initially wrote for 10pt works also great for the other sizes.

Here's what you have to do in order to obtain nicely positioned accents. No change to the actual TeX files is needed, and nothing in the output will change except the accent positions. OK, create some testing directory and run the following script. (If you have root rights on your system, you probably want to replace the updmap command with updmap-sys; thanks, Herbert! Moreover, the map file that gets deleted in the end should probably be stored at some proper location, but I'm not sure where.)

This creates six files: five tfm files named cmssmi<n>.tfm , which contain the patched font metrics, and beamerbasefont.sty, which will be used instead of the original beamerbasefont.sty. (I thought that cmssmi is nice for "computer modern sans serif math italics".) Now you're ready to go and test the following example TeX file. This should go into the same testing directory since the above six files are only available there. Feedback is highly appreciated!

Hendrik: Your solution works beautifully on UNIX-type systems. Would you mind if I turned it into a fonts package and uploaded it to CTAN?
–
user13668Apr 25 '12 at 23:53

@Ariel: I'd be happy if you do that. My original hope had been that this would just be included into the standard beamer package, but my report on the beamer issue tracker has been unresolved for more than a year now. So please go ahead and upload it to CTAN, that would be a great step in the right direction!
–
Hendrik VogtApr 26 '12 at 11:07

Done; it is on CTAN under the name "sansmathaccent" (ctan.org/pkg/sansmathaccent). (I apologize for posting this in the wrong place, but as far as I can tell, I haven't been using stackexchange long enough to actually make comments.)
–
user13668Apr 29 '12 at 16:56

Apparently the default beamer font is not suitable font for quality math typesetting (lacking proper accent positioning is one aspect, but I suspect there are more).

There is no way to fix this except by using a proper math font, see this for samples of different math fonts with beamer. Of course, it would be much better if beamer maintainers were notified to set a better font by default.

I don't think Beamer does set a particular font. It just sets the font family to sans serif, so you get CMSS. I'm not sure it's good practice for a general-use document class to pick a nonstandard (and hence, not guaranteed to exist) font for the user. The class does offer an option \usefonttheme[onlymath]{serif} to revert to normal math.
–
frabjousOct 16 '10 at 14:20

This is a "particular font" in my book, CM is the default LaTeX font, so CMSS is the default sans serif font; it is not just a random sans serif font. And since the question is about the default behaviour, which is a legitimate request IMO, I think some one have to discuss this beamer maintainers. Of course fixing the actual font is much better, but I don't think one is allowed to touch CM and keep calling it CM.
–
Khaled HosnyOct 16 '10 at 14:36

@frabjous: I think I was in some talks where people did use \usefonttheme[onlymath]{serif}, and I would say that the normal serif math font does not go well with the sans serif text font.
–
Hendrik VogtOct 16 '10 at 16:58

The pdf file you give in your link has an interesting list of fonts, but the only sans serif math font with proper accent positioning I found there is CMBright, which seems too thin to me (as also mentioned on page 6 of the pdf file). What a pity!
–
Hendrik VogtOct 16 '10 at 17:32

I find sans-serif fonts ugly for talks. They are hard to read in books, so I don't see any reason to use them in talks, either. The following looks reasonably good to me. (I also slightly adjusted the accenting commands.)

In the moment I can't give a particular reason for using sans serif fonts in talks, but that's what people recommend, and I like it. By the way, the positioning of the accents in your example file is only slightly better than in mine. (Regarding adjusted accenting commands: I used \tilde and \hat above since this is what I saw in the talks.)
–
Hendrik VogtOct 18 '10 at 5:36

Sans-serif are recommended (by some) for short texts, like headlines, logos etc. So it makes sense to use them for presentations, which don't have much running text usually.
–
Martin Scharrer♦Apr 26 '12 at 6:32