Inserting MathMl , Tex or LaTex equation in MS word .docs?
Asked Answered
I

2

6

I've been looking for some dll for .Net in C# for inserting any of MathMl , Tex or LaTex equations in MS Word, I tried some like DocX but they failed, do you know any? or any hint how to it? thanks

International answered 13/8, 2012 at 17:11 Comment(1)
Which version of word are you using? Word 2007/2010 (.docx files). Or do you also use the old Word 2003 (.doc files)?Mcquade
V
7

Word (2007+) can accept MathML off the clipboard. The Windows 7 Math Input Panel for example, on its "insert" button simply puts the generated MathML on the clipboard and then sends a simulated control-v key event to the next active application which hopefully inserts the mathml at the current point.

Internally Word 2007 does this by running an XSLT stylesheet of the MathML to generate OOML markup which it then inserts to make a math zone in the docx file.

The stylesheet is typically installed as something like

/Program Files/Microsoft Office/Office12/OMML2MML.XSL

so an alternative approach which gives you more control is to use the .NET XSLT processor to transform the MathML to OMML and then either directly in the ooxml xml files or via the office API add the ooMML to the document's content xml.

Villatoro answered 19/8, 2012 at 11:9 Comment(0)
T
0

Following simple procedure works:

  1. Configure MathType to copy/paste preferences to: "Mathml" (suitable version to be chosen)
  2. Paste your Mathml equation into Mathtype panel : the equation appears and can be edited/modified -> Fine adjust your equation.
  3. Reconfigure copy/paste preferences of Mathtype to "Equation Object (Windows OLE Graphic)" - Copy paste now the equation from MathType to Word
Tirza answered 16/1, 2022 at 16:32 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.