views:

1557

answers:

4

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

+2  A: 

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

ldigas
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.
dmckee
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 ?
ldigas
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.
dmckee
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 WINE
joshuascotton
@joshuascotton - 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.
ldigas
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 word
joshuascotton
+2  A: 

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.

boj
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.
Tormod Fjeldskår
Right, I'll extend my answer.
boj
OOoLatex only converts Latex fragments, not whole documents
joshuascotton
+2  A: 

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.

Jouni K. Seppänen
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/bashbase=${1%%.*}latex2rtf $1abiword --to=doc $base.rtfrm $base.rtfUsage is ./tex2doc.sh phdthesisnotes.tex
joshuascotton
A: 

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.

Chinasaur