1

This question already has an answer here:

I want to write an equation with one curly brace ({) on the right hand side and, next to the curly, two statements in two different lines. How can i do it using TeX or Latex? Thanks.enter image description here

marked as duplicate by Stefan Pinnow, CarLaTeX, Zarko, Werner, user13907 Jan 16 '17 at 19:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

I don't know about Noodle but, using the amsmath package you can simply use

\[
f(x) = 
\begin{cases}
 (x+2)^{2}\,, & x<-2 \\
 4-x^{2}\,, & x\ge -2
\end{cases}
\]
  • Why using \,? – Sigur Jan 16 '17 at 17:45
  • That adds a small amount of space before the comm to give some separation from the expressions. – Herb Schulz Jan 16 '17 at 18:22
1

I'll add a few other possibilities, defined by mathtools, an extension of amsmath which it loads, by empheq (which loads mathtools) or by the cases package. Some of them can be individually numbered:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage{empheq}
\usepackage{cases} %

\begin{document}


\begin{align*}
\shortintertext{With \texttt{cases} and \texttt{dcases}:}
    & f(x) = \begin{cases}
    (2x +1)^2& \text{if } x < - \frac{1}{2}\\
   1-4x^2 & \text{if } x \ge -\frac{1}{2}
   \end{cases}
    &  & f(x) = \begin{dcases}
    (2x +1)^2& \text{if } x < - \frac{1}{2}\\
   1-4x^2 & \text{if } x \ge -\frac{1}{2}
   \end{dcases}
\end{align*}

\begin{align*}
\shortintertext{With \texttt{rcases} and \texttt{drcases}:}
    & f(x) = \begin{rcases}
    (2x +1)^2& \text{if } x < - \frac{1}{2}\\
   1-4x^2 & \text{if } x \ge -\frac{1}{2}
   \end{rcases}
    &  & f(x) = \begin{drcases}
    (2x +1)^2& \text{if } x < - \frac{1}{2}\\
   1-4x^2 & \text{if } x \ge -\frac{1}{2}
   \end{drcases}
\end{align*}

With \texttt{numcases}:
    \begin{subnumcases}{f(x) = }
    (2x +1)^2& if $ x < - \frac{1}{2} $\\
   1-4x^2 & if $ x \ge -\frac{1}{2} $
   \end{subnumcases}

With \texttt{empheq};
\begin{subequations}
  \begin{empheq}[left = {f(x) = \empheqlbrace}]{alignat = 2}
      & (2x +1)^2 & \quad & \text{if } x < - \frac{1}{2}\\[1ex]
    & 1-4x^2 & & \text{if } x \ge -\frac{1}{2}
  \end{empheq}
\end{subequations}

    \end{document} 

enter image description here

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