乳胶无法在Jupyter Notebook上正确渲染

时间:2020-08-17 17:51:56

标签: jupyter-notebook latex rendering

我在Jupyter Notebook上使用Latex遇到麻烦。

每当我尝试使用\ begin {} .. \ end {}形式的Latex表达时,代码均无法正确呈现。

当我使用内联表达式时,例如$ this里面的$,它确实起作用。

我已经在代码单元以及降价单元中尝试了神奇的%% latex。

以下是发生的情况的一个示例>

enter image description here

我读到很多人对此有疑问,但没有具体解决方案。有任何想法吗??提前谢谢。

编辑添加代码

在具有%% latex魔力的代码单元上

%%latex
\begin{tabular}{ | c | c   c   c | } \hline
        $k$ &   $x_1^k$  &   $x_2^k$  &    $x_3^k$   \\
         \hline
         0 & -0.30000000 & 0.60000000 &  0.70000000  \\
         1 &  0.47102965 & 0.04883157 & -0.53345964  \\
         2 &  0.49988691 & 0.00228830 & -0.52246185  \\
         3 &  0.49999976 & 0.00005380 & -0.52365600  \\
         4 &  0.50000000 & 0.00000307 & -0.52359743  \\
         5 &  0.50000000 & 0.00000007 & -0.52359885  \\
         6 &  0.50000000 & 0.00000000 & -0.52359877  \\
         7 &  0.50000000 & 0.00000000 & -0.52359878  \\
         \hline
\end{tabular}

在没有魔法的降价单元中

\begin{itemize}
\item Hello
\end{itemize}

但是以下代码正确地呈现为矩阵,所以就像表格或逐项被破坏了吗?

$$
\begin{pmatrix}
Var[X_1] & Cov[X_1,X_2] \\
Cov[X_1,X_2] & Var[X_2].
\end{pmatrix}
$$

1 个答案:

答案 0 :(得分:1)

选中此answer

Jupyter基于MathJax构建,并引用"MathJax doesn't implement tabular". The link还将推荐的数组环境显示为 表格替换。

我建议使用Markdown Cells