Alignmentcases

casesEnvironment

Used for piecewise-defined expressions with a left brace and two aligned columns

\begin{cases} x & \text{if } x > 0 \\ 0 & \text{otherwise} \end{cases}
Topic
Alignment
Available in
ams
Allowed mode
math
Body mode
math
Frequency
1.42% of corpus formulasrank 10 of 31
Commonality
high
Tags
matrix, nestable
Renderer support
PackageMathJaxKaTeXXeTeX
amsMathJax: FullKaTeX: FullXeTeX: Full
About the test scope

Syntax#

\begin{cases}…math body\end{cases}

Takes no arguments. Reading argspecs

Common tasks#

How to write a piecewise function#

\begin{cases} x & x\ge 0 \\ -x & x<0 \end{cases}

How to write a piecewise definition with text#

f(x)=\begin{cases} 1 & \text{if } x\in\mathbb{Q} \\ 0 & \text{otherwise} \end{cases}

How to write a system as cases#

A single column is enough when there is no condition to align.

\begin{cases} x+y=1 \\ x-y=0 \end{cases}

In TeXForm#

TeXForm reads the environment body in math mode.

See also#

Test cases#

ams
InputCaseMathJaxKaTeXXeTeX
\begin{cases} a & b \\\\ c & d \end{cases}Positive · baselinePassPassPass
All 25 in Alignment