LaTex 不会在 VS Code 的 jupyter notebook 中呈现,但会 运行 jupyter notebook

LaTex won't render in jupyter notebook in VS Code but does running jupyter notebook

我今天安装了 VS Code 并创建了一个非常简单的 jupyter notebook,运行s 没有任何错误,但即使安装了 LaTex Workshop[= 也不会在 VS Code 中渲染 LaTex 29=] 扩展。

当我直接在 jupyter 中 运行 同一个笔记本时,它呈现得很好。

这是来自相关降价单元格的代码:

### This is another markdown cell with Latex

This equation defines eigenvalues and eigenvectors: $Mx = \lambda x$

another equation:
$\begin{align*}
(a+b)^2 = a^2+2ab+b^2
\end{align*}$

在 jupyter 中,单元格如下所示:

在 VS Code 中,单元格如下所示:

我找到了为什么会这样。答案是 vscode 的 Python 扩展(允许在其中打开 jupyter notebooks 的扩展)目前不支持离线功能。他们甚至为此开了一个issue

编辑 [2021 年 6 月 16 日]

此问题已在 vscode 和 jupyter 扩展的最新版本中修复。