Picture of Kok Han Yeow
How to include math exported as Math ML from MSWord?
by Kok Han Yeow - Tuesday, 31 May 2016, 8:36 AM
 

Hi,

I use MathType in Microsoft Word for my math expressions. MathType allows me to output to clipboard a math expression formatted in Math ML like:

<math>
<mrow>
<mi>&#x0394;</mi><mover accent='true'>
<mi>p</mi>
<mo>&#x21C0;</mo>
</mover>
<mo>=</mo><msub>
<mover accent='true'>
<mi>p</mi>
<mo>&#x21C0;</mo>
</mover>

<mi>f</mi>
</msub>
<mo>+</mo><mo stretchy='false'>(</mo><mo>&#x2212;</mo><msub>
<mover accent='true'>
<mi>p</mi>
<mo>&#x21C0;</mo>
</mover>

<mi>i</mi>
</msub>
<mo stretchy='false'>)</mo></mrow>
</math>

Inside Adapt's text editor, I turned on 'source' to see the content in html format. Then I pasted the Math ML content like the one above but when I go back to normal view, the math expression doesn't get displayed correctly.

Does anyone know how to insert math expressions from MS Word?

Thanks.

 

Picture of John Niezen
Re: How to include math exported as Math ML from MSWord?
by John Niezen - Tuesday, 31 May 2016, 9:32 AM
 

Shouldn't you declare the namespace where it can find the Math ML?

If this is not standard declared in Adapt, then your browser has no idea what to do with it.

Might want to consider changing it to a real figure for the time, and ind out how to make a component doing this.

Or lookif you can use https://github.com/cgkineo/adapt-mathJax

Picture of Ken Petri
Re: How to include math exported as Math ML from MSWord?
by Ken Petri - Wednesday, 1 June 2016, 12:20 PM
 

Not sure about the Adapt editor and JavaScript library in particular, but the only web browser that has full native capability of rendering MathML as math (rather than a bunch of inline characters) is Firefox (Safari does some too, but its implementation is broken in important ways).

Most of the nicely rendered MathML you see on the web is the result of usage of MathJax, which compensates for lacking support in web browsers.

Question: when you go view the source again in the editor, did the Adapt editor mangle it? If not, on the rendered page, try viewing the source as the DOM sees it: open up the inspector tool, which is F12 in most browsers, and find the MathML island and see if it still looks like MathML. If it does, then it's the lack of browser support and/or that Adapt is not using MathJax for math rendering.

MathML (and also MathJax) is fundamental for accessibility of math on the web. I hope Adapt can do something about this.

- ken

Picture of Kok Han Yeow
Re: How to include math exported as Math ML from MSWord?
by Kok Han Yeow - Thursday, 2 June 2016, 3:08 PM
 

Thanks John and Ken for your suggestions. I don't fully understand how the Math ML works. After I pasted the Math ML into the Adapt editor(source view) and return to normal view and ten go back to source view, the math ML tags all disappeared (got thrown away by the adapt editor?).

My checks online seems to suggest that I need to look at using MathJax like you guys suggested because not all browsers support it (e.g. Chrome).

So I'll read up some more and see if can figure out something.

Regards,

Kok Han

 

Picture of Robert Peek
Re: How to include math exported as Math ML from MSWord?
by Robert Peek - Thursday, 2 June 2016, 3:58 PM
 

Hi

Noticed you mentioned MathJax, not sure if it's relevant but Kineo seem to have looked at this:

https://github.com/cgkineo/adapt-mathJax