JS based equation editor

1,368 views
Skip to first unread message

gnaegi

unread,
Dec 16, 2010, 10:59:21 AM12/16/10
to MathJax Users
Hi all

I migrated your old jsMath based equation in the open source learning
management system OLAT to the cool MathJax library. I'm impressed I
have to say, it is so much better than jsMath (which was great at its
time as well).

Now my second task is to integrate a WYSIWYG editor. I found some
sources, but most of them are flash based which I don't like too much
for several reasons.

Does anybody know of a JavaScript based product? Id does not
necessarily have to be open source, although that would of course be
better.

And when flash is the only option, which editor would you as experts
recommend to use? It should output MathML, not LateX.

Thanks for any hints.

Regards
Florian

pyba

unread,
Dec 17, 2010, 1:58:42 PM12/17/10
to MathJax Users
Hello,
some links that could give you some ideas : http://sixthform.info/steve/wordpress/?p=59
.

Regards
Chrsitophe

jstatus

unread,
Jan 5, 2011, 3:31:55 PM1/5/11
to MathJax Users
I'm also looking for a JS editor. I'm looking at Wiris right now --
have you found anything yet?

On Dec 16 2010, 8:59 am, gnaegi <florian.gna...@gmail.com> wrote:
> Hi all
>
> I migrated your old jsMath based equation in the open source learning
> management system OLAT to the cool MathJax library. I'm impressed I
> have to say, it is so much better than jsMath (which was great at its
> time as well).
>
> Now my second task is to integrate a WYSIWYGeditor. I found some
> sources, but most of them are flash based which I don't like too much
> for several reasons.
>
> Does anybody know of a JavaScript based product? Id does not
> necessarily have to be open source, although that would of course be
> better.
>
> And when flash is the only option, whicheditorwould you as experts

gnaegi

unread,
Jan 6, 2011, 10:35:43 AM1/6/11
to MathJax Users
I finally used the flash based fmath editor (http://www.fmath.info/).
I found the connexions MathML editor quite impressive (made with
ExtJS, http://cnx.org/matheditor), but it is not production ready.
Watch this closely when you have some time to wait in your project!


However, I ended up not using MathJax at all because at some point I
realized that the MathML markup that was produced by fmath was not
100% compatible with what can be displayed by MathJax. It seems that
both products do implement different subsets of the standard. I did
not have enough time to investigate if this somehow could be
configured, the problem was that depending on the browser not all
formulas created with the editor could be displayed by MathJax.
Sometimes I got error messages. We use now an ugly image solution and
use the MathML code only as the editor source. This is totally stable
in every browser and with every equitation the editor can generate.

Another problem was that I wrote a plugin for TinyMCE (a WYSIWYG
editor) for fmath. There is already a plugin available, but not one
that added MathML into the HTML source code. I had other issues there
like that IE just removes the entire MathML elements when in design
mode, probably because it does not know those elements. The result was
that I could not use this embedded approach with IE, although it
worked great with all other browsers.

The last problem was that since we want the MathML code to be
generated on the client so I needed a cross-site-scriping filter to
make sure the MathML code does not contain dangerous stuff like
JavaScript event handlers and such. I had to write an AntiSami
Profile for MathML which turned out to be a night mare since you have
to declare every single MathML element and attribute that is allowed.
Since I'm no MathML guru I had to rely on some docs I found on the net
but it was very time consuming and I was never sure if I got
everything right.

All in all I must say that your old LateX based solution has many
advantages over MathML. Maybe you can express things with MathML that
you can't with LateX, but in the end it is just much simpler to have a
simple string in a span tag than deal with this whole XML mess. It's
not the first time I was asked to implement the 'standard', probably
because it sounds somehow more professional to use such a 'standard'.
However, in real world the non-'standard' approach is often much
better suited and well tested.


Cheers
Florian
Reply all
Reply to author
Forward
0 new messages