The following code
$X^D \overline{X}^D$ Versus $X^{^D} \overline{X}^D$
I would like to have alignment and same size of D.
Thanks
The following code
$X^D \overline{X}^D$ Versus $X^{^D} \overline{X}^D$
I would like to have alignment and same size of D.
Thanks
I'd avoid \overline: \bar is more elegant. If you really think it's too short, you may try \widebar (see https://tex.stackexchange.com/a/391193/4427)
\documentclass{article}
\usepackage{amsmath,amssymb}
% for \widebar
\DeclareFontFamily{U}{mathx}{}
\DeclareFontShape{U}{mathx}{m}{n}{ <-> mathx10 }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{\mathalpha}{mathx}{"73}
% fixed overline
\newcommand{\foverline}[1]{\smash[t]{\overline{#1}}\vphantom{#1}}
\begin{document}
Bar: $X^D+\bar{X}^D$
Widebar: $X^D+\widebar{X}^D$
Overline: $X^D+\foverline{X}^D$
\end{document}
\bar{X}will do, with a more elegant output. – egreg Sep 08 '22 at 19:49$X\vphantom{\overline{X}}^D$. – barbara beeton Sep 08 '22 at 19:56