我怎样才能在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.
您可以使用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)