# Starred multiline environments don't work

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.

• Hmmm... I usually use \begin{align*}....\end{align*} and have no problem. However, if I don't go into math mode first, then there are all sorts of problems, requiring escape characters (e.g., \\ for end of lines, etc). – Arturo Magidin Jun 2 '11 at 18:22
• – Tobias Kienzler Oct 24 '13 at 6:53

I don't see any problems.

## Equation

Here is an example without the star:

$$X = Y$$


$$X = Y$$

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}

• 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). – t.b. Jun 2 '11 at 17:54
• @Theo: already fixed. :-) In latex, it is an error to use align in mathmode, so I switched to aligned. – Jack Schmidt Jun 2 '11 at 17:56
• 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. – David E Speyer Jun 2 '11 at 19:06

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

• It might work if you escaped the star with a backslash. – Qiaochu Yuan Jun 2 '11 at 16:13
• @qia this shouldn't be necessary, as we modified the source code to explicitly ignore anything inside  blocks a while ago. – Jeff Atwood Jun 3 '11 at 9:37
• @Jeff: In TeX, you use 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. – Jack Schmidt Jun 3 '11 at 23:08