How do I convert a document from Latex into Microsoft Word 2003? [closed]
Asked Answered
C

8

31

I need to find a way to quickly convert a latex document into a Microsoft Word 2003 document.

I'm using Kile to edit latex documents on Ubuntu at present.

I can do it the following way:

latex filename.tex
tex4ht filename.tex
mk4ht oolatex filename.tex

then I have to open the resulting filename.odt document in OpenOffice and save as a Word Document.

Is there anyway I do this in a single step?

I can write a program to run the initial three lines, I'm more interested in the conversion from odt to doc without using openoffice.

It would be even better if I could find a way to convert straight from filename.tex to filename.doc

Coulomb answered 13/4, 2009 at 21:3 Comment(0)
A
17

All programs that allegedly convert a document from LaTeX to some word-processing format will lose some information that was there in the original, but apparently you're willing to live with that.

Here's one trick that may or may not be suitable for your purposes: if latex2rtf does a good enough conversion (I have no idea how it compares to the converter you are using), just rename its output from whatever.rtf to whatever.doc, and Word will open it just fine. Now if the recipient of the document wants to edit it, she may notice that it is actually not in the usual Word format, but, hey, Word behaves strangely all the time anyway.

Another trick is to convert the output of TeX into images of pages and embed them in a Word document one by one - this preserves the exact layout from TeX and will obviously be useless for anything other than printing (and the print quality will likely be worse than you get by just printing the original), but technically it is a Word document.

Aquaplane answered 14/4, 2009 at 7:41 Comment(1)
Thanks, latex2rtf is the solution I think. I found out that you can convert rtf to doc use abiword. The conversion seems ok so I've come up with the following bash script: #!/bin/bash base=${1%%.*} latex2rtf $1 abiword --to=doc $base.rtf rm $base.rtf Usage is ./tex2doc.sh phdthesisnotes.texCoulomb
W
3

I haven't used it, so I cannot comment on it, but this looks somewhat like what you're looking for: tex2word and LaTeX-to-Word (the latter one looks better).

Wheelhouse answered 13/4, 2009 at 21:13 Comment(6)
Ah! Supporting the input language in Word macros. Slick, but not much help if he needs to export because he doesn't have word. We shall see.Curare
It's possible that I overlooked something, but I'm guessing he has Word. Just doesn't know how to get .tex in it. What is your interpretation ? That he wants to convert .tex->.doc but he doesn't have word ?Wheelhouse
I needed to send a document in Word format when I didn't have Word, once upon a time. You could be right just as easily, and these tools are cool either way.Curare
I do have Word on a spare computer, but the question is really about getting it working on my main machine which runs Linux not Windows. I'm going to try your suggestions with WINECoulomb
@Coulomb - If you do, could you let us know how it turns out ? I've never used it, but the 2nd link looks like a mature product, and I'd love to know how well it works on an average .tex document. If it works ok, then it would be like getting the best of both worlds.Wheelhouse
Unfortunately they both have to run in Word, which is what I'm trying to avoid. I'm writing in latex in the moment for university work and I need to convert to a word document without using microsoft wordCoulomb
B
3

What is you open it in OpenOffice (with OOoLaTex) and saves as .doc?

As Tormod said, it would be nice with one step: may using OOo from command line like here.

Biography answered 13/4, 2009 at 21:20 Comment(3)
If you read the question more carefully, you'll notice that he already knows of that possibility, but wants to do the process in a single step.Cathodoluminescence
Right, I'll extend my answer.Biography
OOoLatex only converts Latex fragments, not whole documentsCoulomb
H
2

I'm using tex4ht to produce an HTML file. I open the resulting .html in Word. Afterwords, I save it as .docx. Gives good results.

Based on that, there is the latex2docx project.

Henriettehenriha answered 6/10, 2011 at 15:40 Comment(1)
For OSX users. I found this software, that worked for me. GUI for tex4ht. simpletex4ht.free.frFanning
C
1

I tried many free solutions, but my LaTeX document was too complicated. In the end, commercially available GrindEQ did the best job by far. If you only need to do this once, you can use the demo version.

Choosy answered 19/1, 2011 at 10:30 Comment(0)
C
0

Lyx bundles away some of the command-line stuff so that you can export straight to the ODT file (assuming you have tex4ht installed on the path), so that might save you a few keystrokes. I'd be surprised if Kile doesn't have similar output helpers.

Choosy answered 9/9, 2009 at 3:44 Comment(0)
R
0

I've just installed GrindEQ. And it didn't convert any of my figures. I suspect that it ignores \graphicspath . latex2rtf doesn't like \autoref .

oolatex (tex4ht) failed to convert jpg images for me, though they work fine with both latex and pdflatex under MikTeX 2.9. Other images are not centered as requested by \centering.

oolatex and GrindEQ flatten \marginpar by embeding it in the main text with slightly different font. latex2rtf simply ignores \marginpar.

I guess there is no perfect tool for somewhat complex document:(

Racing answered 23/3, 2011 at 20:45 Comment(1)
I've just noticed that GrindEQ ignores \begin{description} by making separate paragraph with description and completely ignoring all terms themselves.Racing
C
0

If you want to use this commands in one unique line of call, could write a single bash script for that:

  • Create a new file named tex2odt.sh
  • Write this lines in:

    #!/bin/bash
    latex $1.tex
    tex4ht $1.tex
    mk4ht oolatex $1.tex
    
  • Make the file executable: chmod +x tex2odt.sh

  • call the script with the name of tex file without the extension: tex2odt.sh FiletoConvert

Hope this still helps

Namastê

Centring answered 7/4, 2012 at 18:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.