3

I'm using this code to show that one element of the equation is greater than zero and the second element is less than zero.

\begin{align}
\overset{+}{\pi_{i}} + \overset{-}{w_{g}(S)} > 0
\end{align}

But the alignment of the plus and minus signs are uneven. The minus sign is quite a bit higher than the plus sign. I appreciate help getting the two at the same vertical placement.

Dr. Beeblebrox
  • 197
  • 1
  • 2
  • 11

1 Answers1

2

the most compact approach to this is to add \mathstrut:

\begin{align}
\overset{+}{\mathstrut\pi_{i}} + \overset{-}{w_{g}(S)} > 0
\end{align}

explanation:

  • the \overset adjustment is based on the tallest element in the expressions, namely the parentheses around the S.

  • \mathstrut is defined as {\vphantom(}.

a lot of comments contributed to this. mico's the one who finally came up with \mathstrut.