5

When doing practical math, you often fork your calculation due to some conditions, eg. when doing equations with absolute value.
There is a symbol for this, and I wonder if mathJax can render this one or not. And if it can, I'd like to know the command.

Here is an image of what I mean: enter image description here

1 Answers1

8

The amsmath package provides the cases environment:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$f(x) = \begin{cases} x^{2} \sin \left( \frac{1}{x}\right) & \text{if } x\neq 0 \\
                      0                                    & \text{if } x=0      %
        \end{cases}$
\end{document}

compiled code

Stephen
  • 14,890
  • "(full answer follows)" What if I told you that I will accept the best response not the first one, so the placeholder is not necessary? – Tomáš Zato Jan 21 '14 at 21:15
  • 1
    @TomášZato: OK, I just wanted to give you an answer while being sure that you are still "here", but needed some minutes to type, compile, screen-shoot, and upload. As Barbara Beeton commented, your question had already been answered elsewhere, thus this answer had not been necessary anyway. – Stephen Jan 21 '14 at 21:29
  • I posted that comment mainly to express my feelings to people that use placeholder answers. Because I'm always "here"... – Tomáš Zato Jan 21 '14 at 21:49