Jupyter notebook iPython笔记本中的真正乳胶

Jupyter notebook iPython笔记本中的真正乳胶,jupyter-notebook,latex,pseudocode,Jupyter Notebook,Latex,Pseudocode,在iPython中,可以使用MathJax解释的latex语法编写方程 但现在我还想在iPython中做一些其他有趣的latex工作,比如用一些latex包编写伪代码。有没有可能在iPython中写这样的东西 例如: %%latex \usepackage[]{algorithmicx} \begin{algorithmic} \If {$i\geq maxval$} \State $i\gets 0$ \Else \If {$i+k\leq maxval$}

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

但现在我还想在iPython中做一些其他有趣的latex工作,比如用一些latex包编写伪代码。有没有可能在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}

遗憾的是,algorithmicx之类的外部latex包似乎不受支持()

在该环境中,可以扩展将latex组装在一起的能力的一种方法是IPython.display.latex。使用它,您可以动态创建字符串并将其显示为Latex。不像您正在寻找的那样方便,但对于某些用例可能已经足够了