Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython Syntax Lexer for Latex Minted Package

Tags:

ipython

latex

tex

Is there a way to get IPython sessions with syntax highlighting integrated into a latex document using, for example, the minted package (https://github.com/gpoore/minted)?

I have seen many ways of converting a notebook using nbconvert to a tex file. However I don't want to write the whole document within the notebook environment. I would however like to incorporate IPython examples into my thesis.

Something like:

\begin{minted}{ipython ....}
IN[1]: import pandas as pd
...
\end{minted}
like image 980
sanguineturtle Avatar asked Dec 14 '13 02:12

sanguineturtle


1 Answers

This is what I have done to simply inject the IPython Console Writer into Pygments.

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

like image 169
sanguineturtle Avatar answered Oct 21 '22 09:10

sanguineturtle