Is there a way to open TexMaths equations (.odt) in MS Word?

3

2

For writing documents with equations, I use LibreOffice with TexMaths.

The majority of collaborators use MS Word 2007, so I am forced to save into .docx so that they can read the equations and edit the text (but not edit equations, they are saved as images when this plug in is used and saved to .docx).

If MS Word opens the .odt file directly then the equations appear as jibberish, but the TeX data is obviously saved somehow since I can continue to edit my equations in LibreOffice.

Is there some easy extension or equivalent that I can tell them to install if they want to edit my equations and then pass them the .odt document? How is the TexMaths data stored in the .odt file?

(Note: question was also posted on tex.se and deemed off-topic)

xyz

Posted 2014-05-17T10:13:35.503

Reputation: 141

Answers

2

I am not familiar with this area, but for this part of your question:

How is the TexMaths data stored in the .odt file

The answer appears to be that TexMaths (and/or LibreOffice) creates an SVG format drawing in a draw:g element, and stores the original TeX oexpression in an svg:desc element (wrapped up a bit).

I cannot get the .odt file to open at all (Microsoft Word 10 thinks it is corrupt), i.e. the only way I could open it in Word would be to use the "recover text from any file" feature, which probably would result in gibberish. It sounds as if you are at least able to open your documents in Word. But Word does not have any facility to import SVG format directly or convert them, and I do not know of any useful extension, sorry. I notice that LibreOffice saves the SVG when exporting to the older .sxw format, and Word opens that but discards the image.

When LibreOffice exports to .docx, it inserts the picture using Word's legacy VML format inside a w:pict element. As far as I can tell the informaiton in svg:desc is discarded, so there is no possibility of round-tripping. I do not know whether LibreOffice could, in theory, store the TeX from the svg:desc element inside the w:pict or VML diagram.

user181946

Posted 2014-05-17T10:13:35.503

Reputation:

Thanks for the info. I also noticed that if the .odt is opened in TextEdit that something in the form of "TexMaths11§display§N \rightarrow \infty§svg§600§FALSE" appears for the equation $N \rightarrow \infty$. I wonder what the complete syntax is (e.g. what the FALSE tag is for)... I suppose if I will go dig around in the extension's source code when I have some free time to try and make a work around, but probably a bit above my current skill level. – xyz – 2014-05-21T15:02:04.340

FWIW you can find the code used by looking inside the .odt, which is a .zip containing some XML files. Or you could save as the single-file .fodt file and look at that. On Windows I tend to use the free XML Notepad editor (it's a Microsoft download) to look at such stuff. But no, I don't know what the extra stuff surrounding the TeX does, although I expect it all means something to TexMaths. – None – 2014-05-21T17:38:08.850