jupyter多行公式不能正确地以html格式导出

2024-09-28 17:21:16 发布

您现在位置:Python中文网/ 问答频道 /正文

突然,我的ipynb没有正确编译成html,留下了多行方程。就在昨天,一切都很好,我不知道到底会发生什么

我试过两种版本:

    \begin{equation}
        y_{out} = f({y_{in}}) =
        \begin{cases}
            1, & \text{if $y_{in} > 0$} \\
            0, & \text{if $y_{in} \leq 0$}
        \end{cases}
    \end{equation}

    $$
        y_{out} = f({y_{in}}) =
        \begin{cases}
            1, & \text{if $y_{in} > 0$} \\
            0, & \text{if $y_{in} \leq 0$}
        \end{cases}
    $$

我的编译行如下所示:

jupyter nbconvert MyFile.ipynb --to slides --post serve --SlidesExporter.reveal_theme=simple --SlidesExporter.reveal_scroll=True --SlidesExporter.reveal_transition=none

知道这是怎么回事吗


Tags: textinifhtmloutend方程reveal
1条回答
网友
1楼 · 发布于 2024-09-28 17:21:16

根据Equation Numbering and References

  • 在Jupyter的降价牢房里

enter image description here

$$
y_{out} = f({y_{in}}) =
\begin{cases}
1, & \text{if $y_{in} > 0$} \\
0, & \text{if $y_{in} \leq 0$}
\end{cases}
$$
  • 将笔记本导出为HTML,生成以下内容:

enter image description here

如果您的笔记本以前工作过:

  • 试试新笔记本上的方程式,看看它们是否有效
  • 当笔记本工作时,尝试回滚到保存的版本
    • 笔记本可能已损坏

相关问题 更多 >