For changing the vertical position of \overline I have found the following macro:
\newcommand*\oline[1]{%
\vbox{%
\hrule height 0.5pt% % Line above with certain width
\kern0.4ex% % Distance between line and content
\hbox{%
\kern-0.1em% % Distance between content and left side of box, negative values for lines shorter than content
\ifmmode#1\else\ensuremath{#1}\fi% % The content, typeset in dependence of mode
\kern-0.1em% % Distance between content and left side of box, negative values for lines shorter than content
}% end of hbox
}% end of vbox
}
But it has bad effect in sub-/superscripts. E.g. see the following MWE:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\newcommand*\oline[1]{%
\vbox{%
\hrule height 0.5pt% % Line above with certain width
\kern0.4ex% % Distance between line and content
\hbox{%
\kern-0.1em% % Distance between content and left side of box, negative values for lines shorter than content
\ifmmode#1\else\ensuremath{#1}\fi% % The content, typeset in dependence of mode
\kern-0.1em% % Distance between content and left side of box, negative values for lines shorter than content
}% end of hbox
}% end of vbox
}
\begin{document}
\section{title}
\[\overline{h},\overline{h_t},\overline{h_{t_1}},\overline{h}_{t_1}\]
\[\oline{h}, \oline{h_t}, \oline{h_{t_1}}, \oline{h}_{t_1}\]
\end{document}
and its output:
How to fix this bad output of \oline?


