LaTeX forum ⇒ TeXShopConverting 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

Postby gypsruepelli » Tue May 19, 2015 7:19 pm

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:
  1. ! Argument of \index has an extra }.
  2. <inserted text>
  3. \par
  4. l.2160 \pend:def\index{\leavevmode}
  5.  
  6. I've run across a `}' that doesn't seem to match anything.
  7. For example, `\def\a#1{...}' and `\a}' would produce
  8. this error. If you simply proceed now, the `\par' that
  9. I've just inserted will cause me to report a runaway
  10. argument that might be the root of the problem. But if
  11. your `}' was spurious, just type `2' and it will go away.
  12.  
  13. Runaway argument?
  14. ! Paragraph ended before \index was complete.
  15. <to be read again>
  16. \par
  17. l.2160 \pend:def\index{\leavevmode}


Some packages are used...

  1. \usepackage[english,ngerman,french,greek,spanish]{babel}
  2. \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,

User avatar
Johannes_B
Site Moderator
Posts: 3671
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed May 20, 2015 2:14 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

Postby gypsruepelli » Wed May 20, 2015 7:37 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.

User avatar
Johannes_B
Site Moderator
Posts: 3671
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed May 20, 2015 7:59 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.


Return to “TeXShop”

Who is online

Users browsing this forum: No registered users and 1 guest