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

  • Are you using inline-mode or display-mode? – Johannes_B Dec 18 '13 at 8:38
  • Welcome to TeX.SX! – Claudio Fiandrino Dec 18 '13 at 8:54
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.

| improve this answer | |
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

| improve this answer | |
  • Shouldn't it be \hphantom{^{*}}? – egreg Dec 18 '13 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. – Chrystomath Dec 18 '13 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.