如何在 Markdown 方程中编写案例

Ale*_*are 4 markdown mathjax

我怎样才能在markdown中写出这样的东西?

在此输入图像描述

以下是我不知道该怎么做的具体事情:

  • 带有两行的大花括号
  • 如果我知道上面之后需要的话,两行内的制表符分隔

如果我知道正确的语法,我会这样做:

$$
CE(p, y) = \curlytwo{-\log(p) \tab \text{if }y=1}{-\log(1-p) \tab \text{otherwise.}}
$$
Run Code Online (Sandbox Code Playgroud)

我发明的地方\curlytwo和\tab.

Li3*_*357 8

您可以使用MathJax支持的cases环境来编写案例:

$$
\mathrm{CE}(p, y) = \begin{cases}
    -\log(p) & \text{if } y = 1 \\ % & is your "\tab"-like command (it's a tab alignment character)
    -\log(1-p) & \text{otherwise.}
\end{cases}
$$
Run Code Online (Sandbox Code Playgroud)