Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 216
ePezhman Avatar asked Aug 13 '12 17:08

ePezhman


People also ask

Can you use LaTeX in Microsoft Word?

Word users can also write directly in LaTeX syntax, and then click to convert it into a formatted equation. Microsoft says that “most” LaTeX expressions are supported, although its website lists 20 keywords that are not (such as \degree, the degree symbol).

Can I import LaTeX to Word?

A way around this hurdle is to use Pandoc to convert Latex files to Word documents. If using Linux and want to use apt-get, you should run sudo apt-get install pandoc pandoc-citeproc . To run Pandoc on a Latex document: Open a terminal (on Windows, hold the Windows key and press “r,” then type “cmd” in the command bar)


1 Answers

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.

like image 77
David Carlisle Avatar answered Sep 18 '22 17:09

David Carlisle