如何在 Markdown 方程式中编写案例
How to write cases in Markdown equations
如何在 markdown 中写这样的东西?
以下是我不知道该怎么做的具体事情:
- 两行的大花括号
- 如果我知道以上内容后需要,两行内的制表符分隔
如果我知道正确的语法,我会这样做:
$$
CE(p, y) = \curlytwo{-\log(p) \tab \text{if }y=1}{-\log(1-p) \tab \text{otherwise.}}
$$
我发明了 \curlytwo
和 \tab
。
您可以使用 cases
环境编写案例 supported in MathJax:
$$
\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}
$$
\begin{equation}
(p, y) =
\begin{cases}
-\log(p) & \text{if }~~ y = 1 \
-\log(1-p) & \text{otherwise.}
\end{cases}
\end{equation}
向here学习并使用数组
$$
CE(p,y)=\left\{
\begin{array}{ll}
-\log(p) &\text{if }y=1 \
-\log(1-p) &\text{otherwise}.
\end{array}
\right.
$$
如何在 markdown 中写这样的东西?
以下是我不知道该怎么做的具体事情:
- 两行的大花括号
- 如果我知道以上内容后需要,两行内的制表符分隔
如果我知道正确的语法,我会这样做:
$$
CE(p, y) = \curlytwo{-\log(p) \tab \text{if }y=1}{-\log(1-p) \tab \text{otherwise.}}
$$
我发明了 \curlytwo
和 \tab
。
您可以使用 cases
环境编写案例 supported in MathJax:
$$
\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}
$$
\begin{equation}
(p, y) =
\begin{cases}
-\log(p) & \text{if }~~ y = 1 \
-\log(1-p) & \text{otherwise.}
\end{cases}
\end{equation}
向here学习并使用数组
$$
CE(p,y)=\left\{
\begin{array}{ll}
-\log(p) &\text{if }y=1 \
-\log(1-p) &\text{otherwise}.
\end{array}
\right.
$$