8

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)?

2
  • Are you using inline-mode or display-mode?
    – Johannes_B
    Dec 18, 2013 at 8:38
  • Welcome to TeX.SX! Dec 18, 2013 at 8:54

2 Answers 2

6

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.

7

Use \hphantom:

\documentclass{article}
\begin{document}
  \[
  \frac{W+W^*}{2\hphantom{^{*}}}
  \]
\end{document}

enter image description here

The idea is to exploit the fact that ^{*} is the extra parameter in W + W. Adding a horizontal space of extra ^{*} to the denominator (after 2) does the work to bring 2 to the centre of W + W

2
  • Shouldn't it be \hphantom{^{*}}?
    – egreg
    Dec 18, 2013 at 8:44
  • I got a different answer in another latex group: use \frac{W+W^{\rlap{$\scriptscriptstyle*$}}{2} with the slight advantage that the horizontal line only reaches until the second W. But your answer is more elegant. Dec 18, 2013 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .