GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • CTAN Comprehensive TeX Archive Network
  • Packages
  • pythontex

This view

  • Original page
  • New address

GeezerVison is showing ctan.org — CTAN: Package PythonTeX

PythonTeX

Run Python from within a document, typesetting the results

The package allows you to enter Python code within a LaTeX document, execute the code, and access its output in the original document. There is also support for Bash, JavaScript, Julia, Octave, Perl, R, Raku (Perl 6), Ruby, Rust, and SageMath.

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.

The package provides a depythontex utility. This creates a copy of the document in which all Python code has been replaced by its output. This is useful for journal submissions, sharing documents, and conversion to other formats.

Sources/macros/latex/contrib/pythontex
Documentation
README
Gallery of use
Package documentation
Quick start documentation
Repository
https://github.com/gpoore/pythontex
Version0.19 2026-02-15
Licenses3-clause BSD License
The LaTeX Project Public License 1.3
Copyright2012–2026 Geoffrey M. Poore
MaintainerGeoffrey Poore
Contained inTeX Live as pythontex
MiKTeX as pythontex
TopicsTagged PDF – incompatible
Callback
See alsoPerlTeX

Download the contents of this package in one zip archive (1.7M).

Community Comments

Loading...

Announcements

  • 2026-02-17 CTAN update: pythontex
  • 2021-06-08 CTAN update: pythontex
  • 2019-09-25 CTAN update: pythontex

more

Suggestions

Maybe you are interested in the following packages as well.

  • perltex: Define LaTeX macros in terms of Perl code
  • nucleardata: Provides data about atomic nuclides for documents
  • rterface: Access to R analysis from within a document
  • runcode: Execute foreign source code and embed the result in the pdf file

more

Package Links

Repository
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.