[Tex/LaTex] How to change horizontal alignment of \frac

fractionsmath-mode

Typing \frac{W+W^*}{2} gives a fraction in which the denominator appears to the eye to be in the wrong position. Is there a way to correct this, i.e. place the 2 in under the + (without using arbitrary negative spacing)?

Best Answer

I propose five possibilities:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
% no adjustment
\frac{W+W^{*}}{2}=
% push the denominator left by the width of the asterisk
\frac{W+W^{*}}{2\hphantom{^{*}}}=
% make the asterisk protrude to the right (and add a correction)
\frac{W+W^{\mathrlap{*}}}{2}\,=
% push the denominator a bit left
\frac{W+W^{*}}{\!2}=
% change the order
\frac{W^{*}+W}{2}
\]
\end{document}

enter image description here

Probably the middle one is the best, in this particular case.