TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to have a cases environment with some cases that are too long to fit on one line. I tried this:

    long expression \\ second line of long expression
  \end{split} & condition \\

but I get the warning

Package amsmath Warning: Cannot use 'split' here; trying to recover with 'aligned' on input line 201.

It automatically replaces the split with an aligned environment, which looks like this: alt text

Is there any way to get these long expressions to behave like they were in split or multline environments, with the top line flush left and the next line indented a little?

share|improve this question
Wouldn't it be nicer to define a short(er) notation such that the separate cases would fit on a single line? – Taco Hoekwater Nov 10 '10 at 13:12
@Taco Hoekwater, Yes. – ptomato Nov 10 '10 at 15:17
The solutions below work fine, but they change the size of the math. It seems that cases changes to textstyle, but aligned changes back to displaystyle (so you get bigger fractions and sums, etc.). As explained in this answer, you can get back to textstyle by defining a new environment talign that redefines displaystyle as textstyle. (You could also do that manually in a group, if you prefer.) – Mike May 4 at 15:29
up vote 17 down vote accepted

Well, I'd follow amsmath's suggestion to use aligned instead of split:


  \text{left hand side} =
       & \text{a very long expression} \\
       & + \text{that continues on the next line}
    \end{aligned}           & \text{1st condition} \\%[1ex]
    \text{short expression} & \text{2nd condition}

Does this yield the output you want? (Note that the \! in front of aligned is needed since that environment adds a \, we have to cancel out.)

EDIT: If you want to achieve alignment and spacing as Niel suggests (@Niel: I would want that; good catch), then just remove the two % in the code.

share|improve this answer
Ah, I didn't realize that aligned could take arguments for vertical alignment with things around it! Semantically speaking, that makes your answer better. – Niel de Beaudrap Nov 10 '10 at 14:32
@Niel: I didn't know that either, I just put it there and it worked :-) – Hendrik Vogt Nov 10 '10 at 14:34
Thanks, it was the &'s at the beginning of each line that did what I wanted! To get multline-like indenting, I put \quad in between the second & and the +. – ptomato Nov 10 '10 at 15:16
@Niel: It seems that I did already know that and forgot it again ... – Hendrik Vogt Nov 20 '10 at 10:01
The spacing/alignment at the beginning of the line is wrong though (compared to Niel's answer). The a is preceded by a bigger space than the s of short on the third line. – letmaik Nov 14 '12 at 9:52

Here is an alternative construction to Hendrik's, which aligns the 1st condition with the bottom-most line of the long expression (which I would suggest as good practise generally for readability). I also add vertical space between the two formulae to make it easier to separate the two visually.


  \text{left hand side} =
       & \text{a very long expression} \\
       & + \text{that continues on the next line} && \text{1st condition}
       & \text{short expression}                  && \text{2nd condition}

I omit the cases environment here, as all of the alignment work that it does is now better performed by aligned. The alignment tabs are chosen to get uniform alignment of the conditions, and left-alignment for everything involved; they can be changed to obtain right-alignment where desired.

share|improve this answer
+1 for improving alignment and spacing – Hendrik Vogt Nov 11 '10 at 9:35
Using aligned still results in inconsistent alignment at the beginning of each line. The beginning is not fully left-aligned unlike with the cases env. See my example: pastie.org/5376249 – letmaik Nov 14 '12 at 10:09
@neo: do you mean just that there is a little extra space in between the brace and the formulae? I've often deliberately added space in cases environments in order to obtain a comparable amount of space. – Niel de Beaudrap Nov 14 '12 at 13:32
No, have a close look at the "r" in my example, it's a bit too far right compared to "z". Using only cases, the left corner of both letters align correctly. – letmaik Nov 14 '12 at 17:22
@neo: I see, it would seem to be precisely because \operatorname{r} is gives r the spacing appropriate to operators (which the tab-stops of the align environments try to accomodate specially). If we use {\operatorname{r}} (which is ugly), the problem goes away. – Niel de Beaudrap Nov 14 '12 at 19:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.