From: Paul T. <pau...@gm...> - 2012-02-28 01:20:28
|
On 2/27/12 6:18 AM, Guenter Milde wrote: > On 2012-02-19, Paul Tremblay wrote: > >> I've written a library that converts ASCII Math to Mathml: >> https://sourceforge.net/projects/asciimathpython/ > Good news. > > How is this related to ASCIIMathML_? > > .. _ASCIIMathML: http://pypi.python.org/pypi/asciimathml/ > > >> It would take only 10 or 15 lines of code to actually use this library. >> One would only have to include a visit for the math_block and math >> elements in the writers/docutils_xml.py, and likewise include a few in >> the HTML writer. > How would the math input format be recognized? > > My asciitomathml is much more complete than the ASCIIMathML in your link. I originally started working on the ASCIIMathML project, but found the code inscrutable and not easily changed. My own library is complete, and handles all cases of ASCII math. I imagine it handles nearly all types of math markup. A lot has changed since the thread in 2008. Firefox can handle MathML without any special plugins; it simply works. Likewise, FOP, the Java converter that converts FO to PDF, handles MathML without any fuss. You download an extra jar, put it in a directory, and then the MathML gets converted to PDF. In order for the math input to be recognized, the rst2xml.py script could simply accept two options. Other scripts could likewise accept these options: --math-input ascii --math-output mathml The default for both, without any option, would be latex. Paul |