Embedding Python in LaTeX by Kjell Magne Fauske, Friday, October 24, 2008 | Comments: 19 Recently, while browsing the archives of the matplotlib mailing list, I stumbled upon the small python.sty package written by Martin R. Ehmsen. The package allows you to embed Python code in your document. When the document is compiled the code will be automatically run and its output included in the document.