I have a Microsoft Word document in DOCX format. I need to import it into Mathematica as a String preserving all formatting (font, size, bold/italic style, colors, etc), tables and embedded images with highest possible fidelity (Mathematica strings support formatting and arbitrary embedded expressions including images). All text should remain editable, so it should not be converted to an image. Is there a way to do this?

I can convert the document to RTF, PDF, XPS, MHT or ODT format before importing, if it helps.

  • 1
    $\begingroup$ RTF would be a likely candidate - but what have you tried so far? $\endgroup$ – cormullion Jun 22 '13 at 10:22
  • $\begingroup$ There is one plugin about MathType and Word Called Word2Tex, maybe also helpful for formulas. $\endgroup$ – HyperGroups Jun 23 '13 at 2:09
  • 1
    $\begingroup$ I DID it 6 months after you asked, see here: mathematica.stackexchange.com/a/65687/1056 $\endgroup$ – WolframFan May 6 '18 at 3:32

David Carlisle wrote about it back in 2007. The process seems to be rather cumbersome and I have not checked myself if it is reliable working but here are some links that might help you on your specific problem:

XHTML and MathML from Office 2007

Going Wordless at the Advanced Mathematica Summer School

| improve this answer | |
  • $\begingroup$ Hi Stefan, can you show me a little about how to obtain the formulas in Word(maybe Mathtype form) in Notebook? I've tried a little, and Import .xml file(obtain form word) to Notebook. $\endgroup$ – HyperGroups Jun 23 '13 at 2:08
  • $\begingroup$ @HyperGroups sorry about my late answer. Embarrassingly no :(. I have no windows and on my mac I do have (astonishingly) Word 2011, but the equation editor is different from the windows version. I've tried it out, but the equations are immediately converted into jpg after exporting...sorry about that. I only had those links and posted them as an answer (concealing the fact, that I'm hopelessly clueless about any Office related question; failing even using these applications) $\endgroup$ – Stefan Jun 23 '13 at 11:35
  • 1
    $\begingroup$ I DID it 6 months after it was asked, see here: mathematica.stackexchange.com/a/65687/1056 $\endgroup$ – WolframFan May 6 '18 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.