LaTeX to RTF

So for a while, I’ve been using LaTeX to write up my work but every now and then someone wants a copy of my work in Word so they can edit it or mark it up and they cant use a PDF editor. This means converting my PDF into a Word document or my LaTeX file into a RTF document.

The PDF route was probably the easiest as everything was nicely laid out already and set out as it should be and various services on the web manage to convert PDF’s relatively well to Word documents such as Zamzar Offsite Link

However, the LaTeX to RTF option is also a possibility using the linux2rtf program Offsite Link however, that seems to be awkward at the best of times and annoyingly problematic at times. And it won’t run on OS X Lion because of the lack of Rosetta support (unless you build it in Macports but that requires a full LaTeX install via Macports as well!)

it shouldn’t have come as a surprise that the answer was staring me in the face all this time. I’d blogged about Pandoc before here and it’s ability to turn Markdown into LaTeX code. Well, it does that and more. Turns out it can output to RTF as well (that’ll teach me to RTFM!) so a simple command of:

<code>pandoc -s LaTeX.tex -o Output.rtf
</code>

gives me a very well formatted RTF document that matches the LaTeX document style pretty well.

For example, in the document in question, I was making use of the url package and the verbatim package quite regularly – Pandoc understands these and formatted them as described in the RTF! Excellent! I don’t know how well it would come with Tables, References and floats but that’s to try another day but considering it handled verbatim and url fine, I have high hopes. latex2rtf is dead, long live LaTeX to RTF!

So once again, top marks to Pandoc for it’s fantastic ability to read and convert documents!