Andrea Canidio wrote:
Can you use latex in wxpython? Can I set the window frame or a StaticText bot to, let's say, r'$\gamma_{max}$'?
the short answer in no.
However there are a few options:
Matplotlib (MPL) can optionally render TeX, and MPL can be embedded in wx (google wxmpl for a good way to do that). With MPL there are two options:
1) having MPL call LaTeX itself, which means you need a working TeX installaion, but get full LaTeX support.
2) using the built in, written in python, TeX implimentation, which is massibly more limted but will do basic simple math.
MPL is really a plotting package, and the TeX stuff is designed to support putting simple equations on a plot, so it's probably not going to do well if you want a lot of support.
Ideally, you could pull code out of MPL to do the same thing directly on a wxWindow.
PyX might be worth looking at:
http://pyx.sourceforge.net/
though it looks like it's really only designed for generating PS, which wont' help you much.
TeX ultimately produced DVI. It wouldn't be all that hard to write a DVI renderer for wx (and I think I've seen some mention of such a thing somewhere...), which would let you use TeX as a layout engine for a wxPython app -- it could be really nice. It would require a working TeX install, which is a major dependency, but TeX really isn't designed to be embedded.
Similarly, dvipng is a utility that comes with many TeX distributions that turns a dvi file into a PNG, that could then be rendered by wxPython. I think this is how MPL does it.
tkDVI looks promising -- it's for TCL/Tk, but the author appears to have written the core DVI handling code in C, with the idea that it could be wrapped for other languages:
http://ctan.binkerton.com/ctan.php?filename=dviware/tkdvi/tkdvi-etcl2K.pdf
pyTex:
http://www.pytex.org/
this looks like it hasn't been updated since 2005, but you might want to get in touch with the author and see what's up with it.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov