8

Is there such a thing as a small, self-contained library that will render an equation written in a text-based format (e.g. LaTeX or MathML) to an image (either vector or raster)?

It would be preferable if it's in Python or Python-friendly.

(One possibility that I've found: Matplotlib has Python code to parse and display LaTeX equations, using gl2ps. If I don't find anything else it seems possible to extract all the relevant bits into a separate library.)

EDIT: by "self-contained" I mean they can't use TeX/LaTex itself since unfortunately I can't rely on it being installed

dF.
  • 74,139
  • 30
  • 130
  • 136

5 Answers5

5

You can try to convert MathML to SVG.

Toni Ruža
  • 7,462
  • 2
  • 28
  • 31
  • Thanks! This seems to be the only one that doesn't depend on LaTeX, I'll probably end up using it. – dF. Mar 06 '09 at 20:29
  • 2
    @AntiEarth: The site appears to be down. Here is the sourceforge link http://sourceforge.net/projects/svgmath/ – Toni Ruža Jan 03 '13 at 19:18
1

There's mimetex a stand alone program for rendering latex math... it's not a library however

http://www.forkosh.com/mimetex.html

Spudd86
  • 2,986
  • 22
  • 20
0

Try ReforMath (http://reformath.webnode.com). It is C++ based and runs under both Windows and Linux. Although unfinished, it can render a number MathML elements.

slugster
  • 49,403
  • 14
  • 95
  • 145
user732592
  • 247
  • 1
  • 7
0

A versatile program and Python module to allow conversion of LaTeX math equations in to PNG images: http://code.google.com/p/latexmath2png/ (MIT license, relies on dvipng).

Sophie Alpert
  • 139,698
  • 36
  • 220
  • 238
0

I don't know if this meets your requirements, but I knew MoinMoin has had latex extensions for a while so I looked again and found this:

MoinMoin Latex Support

You should be able to take this code and re-use it in your app.

Van Gale
  • 43,536
  • 9
  • 71
  • 81