TeXShopConverting LaTeX to MS Word or OpenOffice

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

Converting LaTeX to MS Word or OpenOffice

Post by gypsruepelli »

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:

Code: Select all

! Argument of \index has an extra }.
<inserted text>
                \par
l.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 produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
! Paragraph ended before \index was complete.
<to be read again>
                   \par
l.2160 \pend:def\index{\leavevmode}
Some packages are used...

Code: Select all

\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.

Thank you very much in advance for your help,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: tex to MS word (or Openoffice .odt)

Post by Johannes_B »

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

Re: tex to MS word (or Openoffice .odt)

Post by gypsruepelli »

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.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Converting LaTeX to MS Word or OpenOffice

Post by Johannes_B »

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.
Post Reply