# Incoherent spacing with Libertine and math-mode

My problem when using math in a beamer presentation: The space between a $f$ and the following questionmark is way too small (the glyphs intersect). When switching the code (MWE) to an article, the problem is gone, yet now the spacing between a math "f" and the following letters is too big. The problem is absent with LuaTeX (using libertineotf) but occurs with XeTeX (same).

MWE:

\documentclass{beamer} % try article in comparison and note the gap between "ef..." and "...gh"

\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\begin{document}

$f$? $efgh$

\end{document}

-

Use the professionalfont option if you want to load other math fonts to prevent beamer from changing the math setup. The gap after the f is normal for math fonts. If you want to write words switch to text mode:

\documentclass[professionalfont]{beamer}

\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\begin{document}

$f$? $efgh \text{\itshape efgh}$

\end{document}

-
Thanks. What exactly is the reason for the special spacing of "f"? It's common to use it for "function" but I don't see how that requires the gap. –  NauC Jul 23 '12 at 13:29