【问题标题】:Real LaTeX in iPython notebookiPython 笔记本中的 Real LaTeX
【发布时间】:2014-03-14 00:28:07
【问题描述】:

在 iPython 中,可以使用由 MathJax 解释的 Latex 语法编写方程。

但现在我还想在 iPython 中做其他花哨的乳胶东西,比如用一些乳胶包编写伪代码。有没有可能在 iPython 中写这样的东西?

例子:

%%latex
\usepackage[]{algorithmicx}
\begin{algorithmic}
   \If {$i\geq maxval$}
      \State $i\gets 0$
   \Else
      \If {$i+k\leq maxval$}
         \State $i\gets i+k$
      \EndIf
   \EndIf
\end{algorithmic}

【问题讨论】:

    标签: jupyter-notebook latex pseudocode


    【解决方案1】:

    遗憾的是,似乎不支持诸如 algorithmicx 之类的外部乳胶包 (https://github.com/ipython/ipython/issues/6524)。

    在那种环境中扩展你对 Latex 的能力的一种方法是 IPython.display.Latex。有了它,您可以动态创建一个字符串并将其显示为 Latex。不如您所寻找的方便,但对于某些用例可能就足够了。

    【讨论】:

      猜你喜欢
      • 2013-05-28
      • 2015-12-10
      • 2018-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-02
      相关资源
      最近更新 更多