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

5
  • 1
    \begin{cases} from amsmath package (mathjax also supports this) Commented Jan 21, 2014 at 21:14
  • In LaTeX, this is done using the cases environment from amsmath. I have no idea whether or not this would work with MathJaX since although MathJaX's syntax is based on LaTeX, MathJaX does not use TeX itself. In fact, pure MathJaX questions are off-topic on this site. You could ask "I want to do this in MathJaX, I know that MJ is based on LaTeX. How do I do this in LaTeX so I know what to try in MJ?". That might keep it on-topic. Commented Jan 21, 2014 at 21:14
  • 1
    this is the cases environment (requires amsmath}. see, for example, Alignment in cases and How to write conditional equations with one-sided curly brackets Commented Jan 21, 2014 at 21:15
  • Second case sounds like the same question I have asked. Commented Jan 21, 2014 at 21:16
  • MathJax does support the cases environment. Commented Jan 22, 2014 at 11:30

1 Answer 1

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

3
  • "(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? Commented Jan 21, 2014 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
    Commented Jan 21, 2014 at 21:29
  • I posted that comment mainly to express my feelings to people that use placeholder answers. Because I'm always "here"... Commented Jan 21, 2014 at 21:49

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