6
$\begingroup$

This is a "asking a question so I can answer it" question, hope no one minds.

As you may know, LaTeX provides two versions of most of its equation-like environments: One which updates the equation-numbering-counter and displays the equation number, and one which does not; for minor equations which you don't want to number. For example, this is the difference between multline and multline*.

Since math.SE doesn't provide equation numbering, I habitually type the starred versions of these commands when using math.SE. This then causes all kinds of bugs, which frustrate me until I rewrite the equation in another manner. What should I do?


Here is a list of environments to which this question might be relevant (cribbed from Figure 5.1 in Gratzer's book):

equation, gather, multline, align, flalign, alignat

I only checked equation and multline.

$\endgroup$
5
$\begingroup$

I don't see any problems.

Equation

Here is an example without the star:

\begin{equation} X = Y \end{equation}

\begin{equation} X = Y \end{equation}

Here is an example with the star:

\begin{equation*} X = Y \end{equation*}

\begin{equation*} X = Y \end{equation*}

Align

Here is an example without the star:

\begin{align} X &= Y \\\\ Y &= Z \\\\ \therefore X &= Z \end{align}

\begin{align} X &= Y \\ Y &= Z \\ \therefore X &= Z \end{align}

Here is an example with the star:

\begin{align*} X &= Y \\\\ Y &= Z \\\\ \therefore X &= Z \end{align*}

\begin{align*} X &= Y \\ Y &= Z \\ \therefore X &= Z \end{align*}

Aligned

Aligned is meant to be used in mathmode, and so avoids needing the doubled backslashes:

$$\begin{aligned} X &= Y \\ Y &= Z \\ \therefore X &= Z \end{aligned}$$

$$\begin{aligned} X &= Y \\ Y &= Z \\ \therefore X &= Z \end{aligned}$$

$\endgroup$
  • $\begingroup$ Note the difference: You include the align and align* environments in double dollars. If you don't use these double dollar signs, the line breaks \\ should be replaced triple backslashes \\\ (one backslash is an escaping character). $\endgroup$ – t.b. Jun 2 '11 at 17:54
  • $\begingroup$ @Theo: already fixed. :-) In latex, it is an error to use align in mathmode, so I switched to aligned. $\endgroup$ – Jack Schmidt Jun 2 '11 at 17:56
  • 1
    $\begingroup$ Huh. I'm confused, because I definitely had examples with multline* breaking, and I was very happy when this fixed it. But now I can't replicate them. $\endgroup$ – David E Speyer Jun 2 '11 at 19:06
1
$\begingroup$

If you omit the star, there will be no equation number, and everything works fine.

$\endgroup$
  • 1
    $\begingroup$ It might work if you escaped the star with a backslash. $\endgroup$ – Qiaochu Yuan Jun 2 '11 at 16:13
  • $\begingroup$ @qia this shouldn't be necessary, as we modified the source code to explicitly ignore anything inside $$ blocks a while ago. $\endgroup$ – Jeff Atwood Jun 3 '11 at 9:37
  • $\begingroup$ @Jeff: In TeX, you use \begin{equation} with no dollar signs, so people are probably trying to use it without dollar signs here. I always use dollar signs and aligned (I had to edit my answer to make my code work not only on math.SE but also in latex). The non-dollar signed snippets in my answer are (now) all valid tex (except for doubled backslashes in the align example). To my mind, the double dollar is good enough. $\endgroup$ – Jack Schmidt Jun 3 '11 at 23:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .