用于Latex Minted包的IPython语法Lexer

san*_*tle 5 latex tex ipython

是否有一种方法,例如使用铸造的包(https://github.com/gpoore/minted),将语法高亮显示的IPython会话集成到乳胶文档中?

我已经看到了许多使用nbconvert将笔记本转换为tex文件的方法。但是,我不想在笔记本环境中编写整个文档。但是,我想将IPython示例纳入我的论文中。

就像是:

\begin{minted}{ipython ....}
IN[1]: import pandas as pd
...
\end{minted}
Run Code Online (Sandbox Code Playgroud)

san*_*tle 2

这就是我所做的,将 IPython Console Writer 简单地注入到 Pygments 中。

https://github.com/sanguineturtle/pygments-ipython-console