3
$\begingroup$

Suppose we want to write about a function in a question that is defined by cases. In our note books we generally write "$f(x) =$" and then we give a big curly left bracket, and then define various values the function is to take in different domains. How to write this here? I mean can someone give me the syntax?

$\endgroup$
1
  • $\begingroup$ Specifically, this answer in the MathJax tutorial thread. $\endgroup$
    – user642796
    Dec 8, 2015 at 20:41

1 Answer 1

4
$\begingroup$

The environment for that is cases, you use it as

$$f(x) = \begin{cases} 0, & x < 0, \\
                   1, & 0 \leqslant x \leqslant 2, \\
                 -\pi, & x > 2.\end{cases}$$

(line breaks and indentation to be adjusted by personal preference, I chose an odd layout here to avoid scroll bars for the code sample) to produce

$$f(x) = \begin{cases} 0, & x < 0, \\ 1, & 0 \leqslant x \leqslant 2, \\ -\pi, & x > 2.\end{cases}$$

$\endgroup$
1
  • $\begingroup$ Extremely useful. Thank you very much @Daniel Fisher $\endgroup$
    – Qwerty
    Dec 8, 2015 at 20:45

Not the answer you're looking for? Browse other questions tagged .