tags:

views:

215

answers:

4

I have a function I am consuming that returns a string of latex code. I need to generate an image from this. Most of the methods I have seen for doing so suggest calling an external application via say the subprocess module which will generate the image for me.

However, management is not keen on this as it will require external users to install additional software in addition to our own which, with our user base, is not something we can assume to be a simple task.

So are there any python libraries that will accomplish the task of taking latex into a format (such as an image file) which is displayable in a GUI?

A: 

You're going to need to use LaTeX to process to string. The process of rendering LaTex/TeX is very involved (it generally takes a 100+MB package to do the work), you're just not going to be able toss in a little python module to get the work done.

D'Nabre
A: 

Maybe you could use an online service such as this one: http://www.codecogs.com/components/equationeditor/equationeditor.php.

Bastien Léonard
A: 

If it is just math equations that you need, you will probably have better luck finding a mathml renderer in python. This page might provide some clues, including some latex-mathml translators.

Eduardo Leoni
+1  A: 

Take a look at mathtex.

Jouni K. Seppänen