latex - 用于 Latex Minted 包的 IPython 语法词法分析器

标签 latex ipython tex

有没有办法使用例如 minted 包 ( https://github.com/gpoore/minted ) 将带有语法突出显示的 IPython session 集成到 latex 文档中?

我见过许多使用 nbconvert 将笔记本转换为 tex 文件的方法。但是我不想在笔记本环境中编写整个文档。但是,我想将 IPython 示例合并到我的论文中。

就像是:

\begin{minted}{ipython ....}
IN[1]: import pandas as pd
...
\end{minted}

最佳答案

这就是我所做的,只是将 IPython 控制台编写器注入(inject) Pygments。

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

关于latex - 用于 Latex Minted 包的 IPython 语法词法分析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20579095/

相关文章:

python - 如何插入大正斜杠来标记 matplotlib 轴

latex - sphinx doc 为长表或图表生成横向页面

latex - Multicol 和页面顶部的 float 框,文本环绕在它周围

pdf - 使用Latexpdf输出Sphinx PDF

正则表达式在 Latex 环境之间查找和替换

python - Ipywidgets 在交互式而不是小部件上观察方法

tex - Sweave 到 LaTeX "undefined control sequence"错误

python - MATPLOTLIB:如何提供字体规范文件以通过 TeX 呈现文本?

python - 求和对 python map 的预期效果

jupyter-notebook - Voila for Jupyter 引发错误 : raise NotImplementedError