Maths in Moodle using MathML

Maths in Moodle using MathML

by Zbigniew Fiedorowicz -
Number of replies: 7

Attached is a very rough first attempt at a MathML-->gif filter.  It uses the xsl style sheets downloaded from http://www.raleigh.ru/MathML/mmltex together with the Xalan XSLT processor from the Apache XML Project at http://xml.apache.org/xalan-c/ to transform the MathML to TeX, then uses mimetex.cgi to convert the TeX to gif files.  Everything used is open source, except for a library from the Intel C compiler used by Xalan. The Intel C compiler is not open source, but it there is a free (as in beer) download for Linux (sans support).

PS to Martin: weblib.php is missing the MathML tag <msup>

Average of ratings: -
In reply to Zbigniew Fiedorowicz

Re: Maths in Moodle using MathML

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Cool! cool Pop it into cvs:/contrib, my good man, and let's have some people trying this out! approve

I've fixed the missing tag (there are probably more).
In reply to Zbigniew Fiedorowicz

Re: Maths in Moodle using MathML

by Bruno Vernier -
Thanks Zbigniew,

I got it to work by changing the paths in mathml_filter.php (near the top) and making the paths in mmltex.php be relative (i.e. i took out the path portion and just left the filenames)

This is a nice piece of work... a critical piece of the puzzle we are working on. Displaying Math on the web has always been a frustrating proposition ... however with these three math filters which we have produced in as many days, we go a long way to make math notation available to students.

in summary: students and teachers can now (beta) display real math notation using any combination of algebra, TeX and Mathml input almost anywhere where it matters in moodle.

Nonetheless, the math frustration is not entirely gone:

- a system admin needs to setup external non-php programs
(perl, ocaml, xalan)

- GIF files are still intellectual-property landmines

- there is some fine-tuning left to program

- there are some "gotchas" to be aware of when inputting; for example unless I go into HTML view/edit mode, I often end up with un-intentionally broken XML elements ... also mixing modes can produce "interesting" side effects
In reply to Bruno Vernier

Re: Maths in Moodle using MathML

by Zbigniew Fiedorowicz -

I don't think filenames, as opposed to pathnames, in mmltex.xsl will work. I tried it.

The bug you noticed in my algebra filter also occurs here. See http://moodle.org/mod/forum/discuss.php?d=4742&parent=22039

As for the gif patent, I believe it has already expired everywhere except in Canada, where it is due to expire this year.

In reply to Zbigniew Fiedorowicz

Re: Maths in Moodle using MathML

by Bruno Vernier -
Thanks for the info on GIF legality. Here is a bit more detail, especially for non-US moodle users:

quoting from http://www.kuro5hin.org/story/2003/6/19/35919/4079

> the US patent has expired. What does this leave?

* The European patent EP0,129,439 covers Germany, France, Britain and Italy and expires on the 18th June 2004.

* The Canadian patent CA1,223,965 expires on the 6th June 2004.

* The Japanese patents 2,123,602 and 2,610,084 expire on the 20th June 2004.

This creates an interesting legal situation where LZW-based sofware is legal to distribute in the United States, but risks patent infringement claims in or when exported to Europe, Canada and Japan.

==================================================================

note that http://burnallgifs.org/ recommends continuing the boycott presumably until patent claims on GIF end for the entire world (not just the countries listed above) ... also patents that are derivatives of the original LZW algorithm might exist for many ears to come.

Since I bothered to follow up on this, I thought you might be interested in the current situation even if it sounds like splitting hairs. smile
In reply to Bruno Vernier

Re: Maths in Moodle using MathML

by Zbigniew Fiedorowicz -
- a system admin needs to setup external non-php programs (perl, ocaml, xalan)

This is especially problematic for Moodlers who have their installations hosted by a service provider.

Also it struck me that it might be more convenient to have all these Maths discussions in a single forum. Perhaps the current WeBWorK forum could be renamed to something like "Moodle Maths Tools" and these discussions could be moved there.

In reply to Zbigniew Fiedorowicz

Re: Maths in Moodle using MathML

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, as far as I'm concerned these are all temporary solutions until a pure PHP solution can be found.

Does anyone have a student/slave they can get to port some of these other packages line-by-line into PHP? smile

I'll make a Maths forum and move all this stuff there.