gpt4 book ai didi

python - latex jupyter 笔记本不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 08:33:11 26 4
gpt4 key购买 nike

我开始在 jupyter notebook 上使用 python,问题是打印不像标准的 LaTeX我的手机:

%%latex
\begin{center}
$(a+b)^{2} = a^{2}+2ab+b^{2}$
\end{center}

笔记本中的结果如下图所示: enter image description here

最佳答案

来自 jupyter docs :

The subset of latex which is supported depends on the implementation in the client. In the Jupyter Notebook, this magic only renders the subset of latex defined by MathJax here.

您可以使用 markdown 来显示您的公式:使用单个 $ 表示 latex ,或使用两个 $$ 将其居中。您需要将单元格格式化为 ma​​rkdown 而不是 code

您的单元格成为以下两行之一:

$$(a+b)^{2} = a^{2}+2ab+b^{2}$$
$(a+b)^{2} = a^{2}+2ab+b^{2}$

您必须运行单元格才能显示 Markdown 。

关于python - latex jupyter 笔记本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51296060/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com