locked
Displaying editable mathematical expressions in Microsoft Expression RRS feed

  • Question

  • The following link is an image of the sole content of a Microsaoft Word 2010 document:

    https://skydrive.live.com/redir.aspx?cid=40accf915c1155d3&resid=40ACCF915C1155D3!750&parid=40ACCF915C1155D3!116

    While it is possible to copy the mathematical expression from Word 2010 and paste it into a textbox in Blend project, it is not editable. It appears to be a raster graphic.

    Is it possible to get editable mathematical expressions in Blend?

    The Microsoft Word 2010 document can be saved as a XML file; however, I cannot get it into Blend without it balking about unsupported namespaces. Is there a difference between the XML implementations?

    Is it possible to get the relevant XML code from the Word 2010 created XML file, get it into Blend and have the mathematical expression displayed?

    For my purposes, the Blend project can be any type. I'll probably be using WPF, though, if it matters.

    What I would like to do is make use of a list (database) of mathematical expressions in my project.

    As an example: the expression "1+2=3" would be used. I want to be able to change the color, in turn, of the expression's individual elements, such that "1" is red, then the "+", then the "2," etc.

    Thanks for any help with this.

    Tuesday, March 20, 2012 2:06 PM

Answers

All replies

  • Dmyers,

    Do you by chance have Microsoft Access?  And if so would it be possible to put your word data into a table there and then save that table as an XML file?

    The reason I ask is that, while it has been some time since I've tried, in the past I used Access to create my xml files fom long lists of data.  And I seem to remember Word would turn out some crazy looking XML file that had a whole bunch of extra properties attached to it that I did not need.  Perhaps I'm wrong.

    If you are wanting to edit strings once in your application, have you tried TextBox instead of TextBlock? Or even a RichTextBlock.

    As far as using the strings or text you put in those boxes for calculations, I know of no other way that going to code behind and breaking apart those strings in your TextBlocks or TextBoxes to substrings.

    Here is a link to formatting strings and there is a link on that page for substrings... http://msdn.microsoft.com/en-us/library/26etazsy.aspx

    ~Christine

    Tuesday, March 20, 2012 4:11 PM
  • This is the best info I could find:

    http://stackoverflow.com/questions/5012543/library-for-visualizing-mathematical-equations-like-an-equation-editor

    The short answer is that no, there is no direct way to do this. The equation editor code is built into the office apps, not into WPF/SL or Blend. The formats are not directly compatible (except through graphics as you tried).

    • Marked as answer by dmyers2k Tuesday, March 20, 2012 7:33 PM
    Tuesday, March 20, 2012 4:34 PM
    Moderator
  • Christine,

    Yes, I do have Access 2010;however, I do not think this solves my dilema. Word 2010 was being used because it has an outstanding capability for creating mathematical expressions that have the same typesetting characteristics as Tex. The RichTextBlock will only show a raster representation of the expression when I copy/paste from Word into Blend. 

    The link you gave concerning formatting strings may be utilized once I can figure out how to get the mathematical expressions into Blend.

    Derek A Myers


    Derek A Myers

    Tuesday, March 20, 2012 6:16 PM
  • Ahhh... I hadn't looked at your Skydrive image... I see now.

    I was looking at the 1 + 2 = 3... :D  Which is more my speed.

    ~Christine

    Tuesday, March 20, 2012 6:33 PM
  • Chuck,

    The link you provided led to a possible solution for what I'm trying to accomplish. Indeed, Microsoft Word 2010 has an outstanding and very capable equation editor. This is the application that I am using to create my library of mathematical expressions.

    Once I have the library, the next step is to take each expression and change the color of each element within the expression and cause certain elements to be hidden/unhidden, mimicking the blinking of an element on and off.

    I was successful in creating the concept of what I wanted by creating a sort of flip-book, using a large PowerPoint slide deck. Perhaps I can just do the same thing with a large raster graphic image bank. This would be a very direct and easy solution.

    MathTex.NET,  https://launchpad.net/mathtexdotnet is something that I'll have to look into more. In the meantime, thanks for sending me down the right rabbit hole.

    Derek A Myers


    Derek A Myers

    Tuesday, March 20, 2012 6:37 PM