The equations are in eqnarray and I want to underline only the last line. Is this possible?
Best Answer
The trick is to underline the parts to the left and the right of the & separately. The \mathstruts are used to vertically align the two halves and add extra space before the = and below the denominator. For large structures one can use \vphantom to equalize the depths.
As pointed out by @barbara beeton, the position of the equation number is ambiguous. This can be solved by using the subsidiary environment multlined provided by mathtools inside an equation (first proposed by @egreg). This approach also benefits from the improved spacing of the equation environment.
You'll notice that the equation is left-aligned, although not flush with the left margin. To achieve this, add \setlength{\mathindent}{0pt} to the document preamble as well.
Note that you don't need eqnarray for a single equation. For this, the equation environment is sufficient. However, since the spacing of eqnarray is inferior to the regular math spacing, it might be better for consistency.
Best Answer
The trick is to underline the parts to the left and the right of the
&
separately. The\mathstrut
s are used to vertically align the two halves and add extra space before the=
and below the denominator. For large structures one can use\vphantom
to equalize the depths.