## LaTeX forum ⇒ TeXShop ⇒ Converting LaTeX to MS Word or OpenOffice

Information and discussion about TeXShop, an integrated LaTeX environment for Mac OS X
gypsruepelli
Posts: 2
Joined: Tue May 19, 2015 7:12 pm

### Converting LaTeX to MS Word or OpenOffice

Hi, I 'just' want to transform file.tex into file.doc (or file.odt (for treating it with openoffice))

I work on Mac OS X Yosemite 10.10.3 (terminal or gui , no problem).

The file.tex used as input comes from a Windows Tex editor and I've run it on Mac. PDF output is perfect. But I need it in MS word.

1. I've tried tex2rtf but no success

2. I've tried SimpleTex4ht asking for *.odt as output

Many "! error messages" obtained in *.log

Errors begin in this way:
`! Argument of \index has an extra }.<inserted text>                 \parl.2160 \pend:def\index{\leavevmode} I've run across a `}' that doesn't seem to match anything.For example, `\def\a#1{...}' and `\a}' would producethis error. If you simply proceed now, the `\par' thatI've just inserted will cause me to report a runawayargument that might be the root of the problem. But ifyour `}' was spurious, just type `2' and it will go away. Runaway argument?! Paragraph ended before \index was complete.<to be read again>                    \parl.2160 \pend:def\index{\leavevmode}`

Some packages are used...

`\usepackage[english,ngerman,french,greek,spanish]{babel}\usepackage[LGR,T1]{fontenc}`

​And so on...

Curly braces {} are all checked throughout the whole *.tex file

Any first clue or suggestion?? I'm obviously new to Tex and the reason for 'transforming into Word' is not my choice, it is mandatory.

Johannes_B
Site Moderator
Posts: 4004
Joined: Thu Nov 01, 2012 4:08 pm
Hi and welcome,

i have never used TeX4ht or tex2trf before. Depending on the complexity of your document, conversion tools don't give the very best results.

Have you tried pandoc for the conversion? I have tested it for a few simple things and the result was quite good.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

gypsruepelli
Posts: 2
Joined: Tue May 19, 2015 7:12 pm
Thanks, yes I've tried many things.
With pandoc...

pandoc -f latex -t odt -o myfile.odt myfile.tex

I obtain this error...

pandoc: Cannot decode byte '\xf3': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream

Maybe it's a simple issue, but I haven't managed to solve it. My file is calling other *.tex sub-files within a directory, and it is using many *.sty files because of formatting issues... everything is OK when loading it with TeXShop... PDF exactly written... mixing greek, spanish, english, french, german fonts, etc...

Thanks again.

Johannes_B
Site Moderator
Posts: 4004
Joined: Thu Nov 01, 2012 4:08 pm
I haven't done much as i said. I would believe the error log and suggest to look out for that string. Quickest way to find it is described in Creating a minimal working example, in short: Make the document minimal by commenting parts out (or in) till the reason is obvious. Whis will still be time consuming.

How to fix it once found? Sorry, i don't know. We'll have to wait till someone with more knowledge comes around. You can attach the minimal example to the forum server, leaving the perfect test case for helpers.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.