$\left\{ \begin{array}{l} a+b=c\\ c+d=e \end{array} \right.$


I define a macro command for it.

\newcommand{\curleq}[2]{\left\{\begin{array}{#1}{#2}\end{array}\right.}


When I type

$\curleq{l}{a+b=c\\c+d=e}$


Latex reports error: "Extra }, or forgotten $." I wonder if anyone can help me solve the problem. Thanks. - (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 at 6:19 Thank @PrzemysławScherwentke for broadening my horizon. Probably I will use cases soon. – Sam Jul 4 at 6:25 ## 1 Answer 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: \documentclass{article} \newcommand{\curleq}[2]{% \left\{\begin{array}{#1}#2\end{array}\right.} \begin{document}$\curleq{l}{a+b=c\\c+d=e}$\end{document}  - Thank you so much, Werner. Thank you for re-editing and perfectly solved my problem. – Sam Jul 4 at 6:11 One can do away with the curly braces around #1 as well, right? – Mico Jul 4 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 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 at 6:36
Thanks for providing this clarification. I had indeed focused to much on the example given by the OP. –  Mico Jul 4 at 7:29