Literate Programming in LaTeX This package allows to include Python code directly in a LaTeX document. Upon compilation, the Python code is replaced with its output. To compile the test example: pdflatex -shell-escape example.tex