I stumbled over a problem, which I assume should be quite common, but I couldn't find a satisfying answer (e.g. this and this are not what I am looking for).
I'd like to get an overline over a symbol, but not over its subscript. Though this is no problem, the grouping destroys the kerning of the subscript. Consider the example:
How can I get the overline just over f like in the second line, but the kerning of the subscript of the first line?
Of course I could adjust it manually with negative spacing, but I wonder if there is a more generic solution.
MWE
\documentclass{article}
\usepackage{amsmath}
\usepackage{helvet}
\usepackage{sansmathfonts}
\begin{document}
without overline:
\[f_t\]
with overline and subscript outside:
\[\overline{f}_t\]
with overline and subscript inside:
\[\overline{f_t}\]
\end{document}


\bar) – David Carlisle Jan 03 '17 at 11:04\bar(unlike\overline) is a fixed font glyph the length does not depend on the width of the base. But I added a macro version for\overlineto the answer. – David Carlisle Jan 03 '17 at 11:12