Breaking lines in equations

I had an equation that was too long. It got cut off, so I modified it with the split environment inside an equation environment:

$$\begin{split} & I_{ribbon} = \frac{1}{2} M(a^2 +b^2) \\ &= \frac{1 }{2}\times3.8\times0.001kg\times\Big(\frac{12.49\times0.001m}{2} + \frac{20.79\times0.001m}{2}\Big)^2 = 2.794\times10^{-7} kg\cdot m^2 \end{split}$$


The only issue now is that the equation number is on the line between the two lines of the equation, i.e. vertically centered across the two lines, rather that on the last line where I think it should be. How can I fix this?

-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or hit Ctrl+K. –  Claudio Fiandrino Apr 7 '13 at 8:01

You can use the following:

\documentclass{article}

\usepackage{amsmath}
\usepackage[
product-units=single,
output-product=\times,
inter-unit-product=\ensuremath{{}\cdot{}}
]{siunitx}

\begin{document}

\begin{align}
I_\text{ribbon}
&= \frac{1}{2} M(a^2 +b^2)\notag\\
&= \frac{1}{2} \times \SI{3.8 x 0.001}{\kg} \times \left(\frac{\SI{12.49 x 0.001}{\mm}}{2} + \frac{\SI{20.79 x 0.001}{\m}}{2}\right)^2\notag\\
&= \SI{2.794e-7}{\kg\square\m}
\end{align}

\end{document}


Edit (after suggestions from egreg and daleif)

\documentclass{article}

\usepackage[
tbtags % puts the equation number at the last line of an equation split over multiple lines
]{amsmath}
\usepackage[
product-units=single,
output-product=\times,
inter-unit-product=\ensuremath{{}\cdot{}}
]{siunitx}

\begin{document}

$$\begin{split} I_{\textup{ribbon}} &= \frac{1}{2} M(a^2 +b^2)\\ &= \frac{1}{2} \times \num{3.8} \times \SI{0.001}{\kg} \times \left(\frac{\num{12.49} \times \SI{0.001}{\mm}}{2} + \frac{\num{20.79} \times \SI{0.001}{\m}}{2}\right)^2\\ &= \SI{2.794e-7}{\kg\square\m} \end{split}$$

\end{document}


P.S. When typesetting physical quantities, i.e., numbers and units, siunitx by Joseph Wright is definitely the way to go.

-
I'd rather use split inside an equation environment, that would place only one equation number taking into account options such as leqno, reqno, centertags or tbtags. –  egreg Apr 7 '13 at 9:53
Good point, egreg! I'll edit my answer. –  Svend Tveskæg Apr 7 '13 at 10:01
\text is not really a good idea for "ribbon", as far as I know it is not all constructions that can actually suffice with _\text{}..., in the just for the archives adding extra {} might be a good idea. Also at least on the first line \tfrac would look better –  daleif Oct 31 '13 at 9:20
@daleif How would you typeset "ribbon"? (I'll change the first fraction later today when I get home.) –  Svend Tveskæg Oct 31 '13 at 11:56
Probably using \textup, I_{\textup{ribbon}}. Would of course make a macro if used often. \textup has the advantage that things like æøå then works. \text is a bad idea if the context is italic –  daleif Oct 31 '13 at 17:59