Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse Search

Direc­tory tex-archive/macros/latex/contrib/python

This package enables you to embed Python code (www.python.org) in LaTeX and insert the output into your LaTeX document.

In you LaTeX document insert:

\usepackage{python}
...
\begin{python}[optional.py]
print("42")
\end{python}

The file optional.py is included together with the code between \begin{python} and \end{python}. Hence, you can extract common code to a shared file.

Compile the document with the shell escape option and of course Python installed:

% latex -shell-escape document.tex

or insert/change "shell_escape = t" in your texmf.cnf

If you have any comments, suggestions, or patches please email them to me.

Please note that this material is subject to the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
See http://www.gnu.org/copyleft/gpl.html for the details of that license.

Martin R. Ehmsen
martin@ehmsen.org

Files

Name Size Date Notes
README 934 2012-06-11 19:33
python.sty 3180 2012-06-11 19:24

Down­load the con­tents of this pack­age in one zip archive (2.3k).

python – Embed Python code in LaTeX

The pack­age en­ables you to em­bed Python code in LaTeX, and in­sert the script’s out­put in the doc­u­ment.

Pack­age De­tailspython
Ver­sion0.21
Li­censeGNU Gen­eral Public Li­cense
Main­tainerMartin R. Ehm­sen
Con­tained inTeXlive as python
MikTeX as python
Topics call ex­ter­nal code and pro­cess the re­sult
Guest Book Sitemap Contact