locked
How to convert word 2007 equation to MathML ? RRS feed

  • Question

  • Hi All

    I am trying to convert a MS Word 2007 equation to MathML. I am able to do it copy / paste the equation object from word. But I want to do it programmatically. Also please let me know if OMath XML and MathML are same or different.

     

    Thanks

    Vittal

     


    M.S.Vittal TechMahindra Ltd
    Thursday, October 27, 2011 1:15 AM

Answers

  • Vittal, OMath XML and MathML are different, but that shouldn't keep you from converting OMML equations (aka Word 2007 equations) to MathML. If what Cindy suggested didn't work, there are hooks in the MathType SDK to do this. Not sure about the mechanics of doing this programmatically, but from an end user's perspective, the MathType Convert Equations command can convert OMML equations directly into MathML, without them ever being MathType equations. The MathType SDK is a free download.

    Bob Mathews
    Design Science


    Bob Mathews Director of Training Design Science, Inc. Twitter: @afwings, @MathType www.dessci.com ~ Makers of MathType, MathFlow, MathPlayer, MathDaisy, Equation Editor ~
    • Proposed as answer by afwings Sunday, October 30, 2011 10:07 PM
    • Marked as answer by M S Vittal Monday, October 31, 2011 12:40 AM
    Sunday, October 30, 2011 10:07 PM

All replies

  • Hi Vittal

    I'm not quite sure how to interpret your question, but I can tell you that the equations you insert from the Word 2007 interface should be the same as you insert from the Word 2010 interface. And both of these are basically the same "OMath" XML - part of the Office Open XML that was introduced with the new file formats in Office 2007.

    So, theoretically, you should be able to get the "MathML" of an equation in a document opened in Word like this:

    string s = ActiveDocument.OMaths(1).Range.WordOpenXML;

    It will be embedded in OPC flat-file OOXML that defines a Word document. But you should have no trouble extracting it from that.


    Cindy Meister, VSTO/Word MVP
    Thursday, October 27, 2011 12:34 PM
  • Vittal, OMath XML and MathML are different, but that shouldn't keep you from converting OMML equations (aka Word 2007 equations) to MathML. If what Cindy suggested didn't work, there are hooks in the MathType SDK to do this. Not sure about the mechanics of doing this programmatically, but from an end user's perspective, the MathType Convert Equations command can convert OMML equations directly into MathML, without them ever being MathType equations. The MathType SDK is a free download.

    Bob Mathews
    Design Science


    Bob Mathews Director of Training Design Science, Inc. Twitter: @afwings, @MathType www.dessci.com ~ Makers of MathType, MathFlow, MathPlayer, MathDaisy, Equation Editor ~
    • Proposed as answer by afwings Sunday, October 30, 2011 10:07 PM
    • Marked as answer by M S Vittal Monday, October 31, 2011 12:40 AM
    Sunday, October 30, 2011 10:07 PM
  • Thanks Cindy & Bob for the suggestions.

     

    Regards

    Vittal

     


    M.S.Vittal TechMahindra Ltd
    Monday, October 31, 2011 12:41 AM
  • Hi Bob

    Ah, now I get it. MathML is what your app uses. OK, I didn't know that. Of course Word provides no automatic conversion for that :-) Thanks for jumping in and setting things straight.

    Open source and proprietary names for things - I'm not sure things are any less confusing than they used to be!


    Cindy Meister, VSTO/Word MVP
    Monday, October 31, 2011 7:02 AM