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 define a macro command for it.


When I type


Latex reports error: "Extra }, or forgotten $."

I wonder if anyone can help me solve the problem. Thanks.

share|improve this question
(Yes, I can see @Werner's answer). Package amsmath has an environment cases, which might be useful in a future. – Przemysław Scherwentke Jul 4 '14 at 6:19
Thank @PrzemysławScherwentke for broadening my horizon. Probably I will use cases soon. – Sam Jul 4 '14 at 6:25
up vote 6 down vote accepted

The second argument to \curleq is placed inside a braced group. And, since groups can't span cells or rows inside an array (or tabular), LaTeX reports an error. Just remove the braced group around the second argument #2:

enter image description here

share|improve this answer
Thank you so much, Werner. Thank you for re-editing and perfectly solved my problem. – Sam Jul 4 '14 at 6:11
One can do away with the curly braces around #1 as well, right? – Mico Jul 4 '14 at 6:26
@Mico: Technically, yes. But in general you could call \curleq{lr}{...} which would cause r to be the first entry of the array's first cell if you do not enclose #1 in braces. – Werner Jul 4 '14 at 6:32
Hello, @Mico, your suggestion is only true for my current example. If I want $\curleq{ll}{a+b=c&x>0\\c+d=e&x<0}$, then the curly braces around #1 are required. – Sam Jul 4 '14 at 6:36
Thanks for providing this clarification. I had indeed focused to much on the example given by the OP. – Mico Jul 4 '14 at 7:29

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.