jupyter 笔记本中有序列表中的数学方程

问题描述 投票:0回答:1

我正在尝试在 Jupyter 笔记本中格式化数学方程。具体来说,我想在有序列表中添加嵌入文本中的数学方程,类似于 egin{enumerate} 在 Latex 中的工作方式。据我了解,我应该使用 html 进行格式化,但在 MathJax 中编写数学。

这是我想要的示例 like

这是我尝试过的示例。

<ol type="a">
<li> It should look something like this $b= \begin{pmatrix} 2\\ 2\\ -1 \end{pmatrix}$<\li>
<li> and be able to start an equation in between as well
$$
A= \begin{pmatrix}\epsilon & 1\\ 1 & 1\end{pmatrix}
$$
</ol>
jupyter-notebook latex markdown
1个回答
0
投票

您只需要使用结合两件事的降价单元:

  • 指定 Markdown 元素的编号列表(如此处所指出,请参阅 Tom Willis 的回答中的 Markdown 规范指南)
  • 使用行内和段落排版风格的MathJax渲染,请参阅这里这里

不需要您已包含的 HTML。
您可以通过 Jupyter

.ipynb
文件中的 Markdown 单元中的以下文本来实现您的既定目标:

1. It should look something like this $b= \begin{pmatrix} 2\\ 2\\ -1 \end{pmatrix}$

1. and be able to start an equation in between as well:
$$
A= \begin{pmatrix}\epsilon & 1\\ 1 & 1\end{pmatrix}
$$

结果:

幸运的是,使用居中方程不会中断编号,因此您甚至可以继续添加到列表中。我发现使用其他一些格式会将内容踢出并且不继续编号。然而,现在这有效:

1. It should look something like this $b= \begin{pmatrix} 2\\ 2\\ -1 \end{pmatrix}$

1. and be able to start an equation in between as well:
$$
A= \begin{pmatrix}\epsilon & 1\\ 1 & 1\end{pmatrix}
$$

1. It will even continue the numbering correctly after that $b= \begin{pmatrix} 201\\ 84\\ -19 \end{pmatrix}$

结果:

© www.soinside.com 2019 - 2024. All rights reserved.