9–11 Jul 2007
Vilnius, Lithuania
Europe/Zurich timezone

Integrating Python and TeX: MathTran and beyond

10 Jul 2007, 11:30
30m
Theta (Vilnius, Lithuania)

Theta

Vilnius, Lithuania

Python Language and Libraries Python Language and Libraries

Speaker

Dr Jonathan Fine (The Open University)

Description

This talk describes the MathTran system for translating mathematics from TeX to MathML and vice versa, and its use of TeX as a daemon. It surveys related Python and TeX software, and calls for the creation of standard Python library modules as a means of unifying and simplifying these projects. Finally, it shows how Python can be used to script TeX typesetting and use TeX as a callable function.

Summary

Last year JISC (a UK higher education funding body) and The Open University gave funds for the MathTran project, which uses Python and TeX to provide translation of mathematical formulas from TeX to MathML and vice versa, and to images. This translation is provided as a web service (from http://www.mathtran.org) and the open source translation software is available from Sourceforge. MathTran runs TeX as a daemon, which effectively makes it a callable function, and which gives high performance by removing the start-up costs.

In this talk we will demonstrate MathTran and describe its basic architecture. We will also survey other Python and TeX projects (such as PyX, TeXML, and PlasTeX), and argue for the creation and adoption of standard Python library modules for dealing with TeX's dvi file output, with MathML (the W3C dialect of XML for mathematics on web pages), with the (La)TeX input syntax, and with running TeX as a daemon.

Although MathTran is focussed on mathematical content, the same software can be used for text and tables as well. In particular, it can provide real-time typesetting and preview. Python's excellent documentation is built using TeX for print and the Perl script LaTeX2HTML for web pages. We will discuss developing a Python-based replacement, that will produce XML output if required.

Finally, we will describe how to use TeX as a callable function from within Python, thereby allowing Python to script typesetting, in the same way as tkinter and PyGtk allow Python to use the Tk and Gtk graphical toolkit libraries.

Primary author

Dr Jonathan Fine (The Open University)

Presentation materials

There are no materials yet.