Comprehensive TeX Archive Network

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

                  The PythonTeX Package

:Author:  Geoffrey Poore
:Version:  0.13 (2014/07/14)
:License:  LPPL v1.3 or later (LaTeX code) and BSD 3-Clause (Python code)
:Development:  https://github.com/gpoore/pythontex
:Requirements:  Python 2.7 or 3.2+; Pygments

The PythonTeX package allows you to enter Python code within a LaTeX 
document, execute the code, and access its output in the original document.
It also supports the Ruby, Julia, and Octave languages.

PythonTeX provides fast, user-friendly access to Python from within LaTeX.
Python code is only executed when it has been modified, or when it meets 
user-specified criteria.  Code may be divided into user-defined sessions,
which automatically run in parallel.  Errors and warnings are synchronized 
with the LaTeX document, so that they refer to the document's line numbers.  
External dependencies can be tracked, so that code is re-executed when the 
data it depends on is modified.  PythonTeX also provides syntax highlighting 
for code in LaTeX documents via the Pygments syntax highlighter.

PythonTeX includes a "depythontex" utility that creates a copy of a document
in which all Python code has been replaced by its output.  This can be
convenient for journal submissions, sharing documents, and converting to 
other formats.

Consult pythontex_quickstart.pdf and pythontex_gallery.pdf to get
started and for examples of what PythonTeX can do.

Compiling a PythonTeX document involves three steps:

1. Run latex (all Python code is saved to an auxiliary file)
2. Run pythontex.py (all code is executed)
3. Run latex again (Python output is inputted)

See the main documentation in pythontex.pdf for detailed installation 
instructions.  An installation script is provided for TeX Live and MiKTeX.
Files should be installed in the directories indicated below.  In summary, 
all files must be installed, and symlinks or launching wrappers should be 
created for pythontex.py and depythontex.py.

* /doc/latex/pythontex/

  - pythontex.pdf
  - pythontex_quickstart.tex
  - pythontex_quickstart.pdf
  - pythontex_gallery.tex
  - pythontex_gallery.pdf

* /scripts/pythontex/

  - pythontex.py, pythontex2.py, and pythontex3.py
  - pythontex_engines.py
  - pythontex_utils.py
  - depythontex.py, depythontex2.py, and depythontex3.py
  - syncpdb.py

* /source/latex/pythontex/

  - pythontex.dtx
  - pythontex.ins

* /tex/latex/pythontex/

  - pythontex.sty


Name Size Date Notes
NEWS 29763 2014-07-17 11:48
README 2576 2014-07-17 11:43
de­python­tex.bat 28 2014-07-17 11:43
de­python­tex.py 804 2014-07-17 11:43
de­python­tex2.py 71255 2014-07-17 11:43
de­python­tex3.py 71261 2014-07-17 11:43
python­tex.bat 26 2014-07-17 11:43
python­tex.dtx 358227 2014-07-17 11:43
python­tex.ins 2341 2014-07-17 11:43
python­tex.pdf 917227 2014-07-17 11:43
python­tex.py 3029 2014-07-17 11:43
python­tex2.py 131774 2014-07-17 11:43
python­tex3.py 131778 2014-07-17 11:43
python­tex_2to3.py 2893 2014-07-17 11:43
python­tex_en­gines.py 41823 2014-07-17 11:43
python­tex_gallery.pdf 382442 2014-07-17 11:43
python­tex_gallery.tex 9626 2014-07-17 11:43
python­tex_in­stall.bat 76 2014-07-17 11:43
python­tex_in­stall.py 21197 2014-07-17 11:43
python­tex_quick­start.pdf 179367 2014-07-17 11:43
python­tex_quick­start.tex 9455 2014-07-17 11:43
python­tex_utils.py 20751 2014-07-17 11:43
syncpdb.py 56659 2014-07-17 11:43

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

python­tex – Run Python from within a doc­u­ment, type­set­ting the re­sults

The pack­age al­lows you to en­ter Python code within a LaTeX doc­u­ment, ex­e­cute the code, and ac­cess its out­put in the orig­i­nal doc­u­ment.

Python code is only ex­e­cuted when it has been mod­i­fied, or when it meets user-spec­i­fied cri­te­ria. Code may be di­vided into user-de­fined ses­sions, which au­to­mat­i­cally run in par­al­lel.

Er­rors and warn­ings are syn­chro­nized with the LaTeX doc­u­ment, so that they re­fer to the doc­u­ment's line num­bers. Ex­ter­nal de­pen­den­cies can be tracked, so that code is re-ex­e­cuted when the data it de­pends on is mod­i­fied. PythonTeX also pro­vides syn­tax high­light­ing for code in LaTeX doc­u­ments via the Pyg­ments syn­tax high­lighter.

The pack­age pro­vides a de­python­tex util­ity, that cre­ates a copy of the doc­u­ment in which all Python code has been re­placed by its out­put. This is use­ful for jour­nal sub­mis­sions, shar­ing doc­u­ments, and con­ver­sion to other for­mats.

Pack­age De­tailspython­tex
Ver­sion0.13 2014-07-14
Li­censeThe LaTeX Project Public Li­cense 1.3
Copy­right2012–2014 Ge­of­frey M. Poore
Main­tainerGe­of­frey Poore
Con­tained inTeXlive as python­tex
Topics call ex­ter­nal code and pro­cess the re­sult
See also perltex
Guest Book Sitemap Contact