Wikipedia:Reference desk/Archives/Mathematics/2007 June 7

= June 7 =

LaTeX question
Not sure if it belongs here or in the Computing Reference desk, but how do I label equations in LaTeX? Say I have this:


 * $$\, 5x+2y=3$$ ...(1)
 * $$\, 4x+7y=24$$ ...(2)

How do I get the labels ...(1) and ...(2) in LaTeX? x42bn6 Talk Mess 21:15, 7 June 2007 (UTC)


 * Do you mean genuine LaTeX or the hamstrung approximation used for Wikipedia? --KSmrqT 22:11, 7 June 2007 (UTC)
 * Genuine, although the latter could become useful in the future. x42bn6 Talk Mess  22:15, 7 June 2007 (UTC)

Try this kind of stuff:


 * \begin{equation}
 * \, 5x+2y=3
 * "\label{Equation1}
 * "\end{equation}%


 * \begin{equation}
 * \, 4x+7y=24 \label{MySecondEquation}
 * \end{equation}%

Of course, you can use these labels later to refer to these equations. Never tried this for wikipedia. deeptrivia (talk) 22:23, 7 June 2007 (UTC)
 * I'm using \begin{displaymath} rather than \begin{equation} because I am using lots of chunks of mathematics that don't need referring back, plus I don't want default numbering. I am a LaTeX newcomer, so I don't mind using \begin{equation} if I can remove the default numbering, and stick my own labels in.  x42bn6 Talk Mess  22:27, 7 June 2007 (UTC)

I've always liked:


 * \begin{eqnarray}
 * 5x + 2y & = & 3\\
 * 4x + 7y & = & 24
 * \end{eqnarray}

24.8.49.212 01:19, 8 June 2007 (UTC)


 * If you do what the anon above suggested, every equation will have a number on it (not always desirable). If you want some to have numbers and some not to have numbers, just append "\nonumber" to the ones you want to remain unlabeled. You must still "label" and "ref" them in the way described by deeptrivia above. –King Bee (&tau; • &gamma;) 12:59, 9 June 2007 (UTC)


 * By the way, to avoid the numbering situation in general, you can use \begin{eqnarray*} and \end{eqnarray*}. It turns off numbering completely. Also, the asterisk has the same effect on \begin and \end {figure} and so forth. Try it out! –King Bee (&tau; • &gamma;) 13:16, 13 June 2007 (UTC)