Converting LaTeX to Word (Pandoc)

I was preparing a journal article for a medical journal, and the only formats they accepted were Word DOC and RTF.

Oh the horror of having to use Word to write a journal paper


I was horrified because I use LaTeX, where one can produce beautifully typeset documents containing millions of figures, tables, references, and subsections, all without having to worry about referencing each of these items manually in the document. I once tried to write a paper with lots of references and sections in Word, and gave up after a week – every time I made a single change by – for example, reordeing the references or adding a new section – all my inline references would get totally destroyed. So I was definitely not looking to repeat this experience.

So then what?

Once I decided I wasn’t going to touch Word with a 1000-foot pole, it was just a matter of finding some software that could convert from latex or pdf to Word. Easier said than done. While I did find a few options, I eventually settled on Pandoc. It was smooth sailing from there on. Well, not so much.

How to actually use Pandoc

Once I had everything installed, I figured it would be quite simple to convert from LaTeX to Word. In the end it wasn’t that difficult at all, it was just a matter of getting the syntax right. There were also some issues with references, but since I couldn’t see any error messages, it took some trial and error to figure things out. (See the bottom of this post for example code that actually works).

Pandoc can actually convert to/from quite a number of formats. This post focuses only on latex -> word. See the Pandoc page to find out the many other formats you can use!

Here are the ingredients you need:

Here are some lessons I learned:

Other tricks & tips:

Example code for this workflow (minimum working example, if you prefer) available here as a zip file. Program files like Pandoc not included.

Enjoy, and let me know if these tips were helpful in your quest to write more journal papers!

…I can now finally continue with writing the paper. Unless I can find another source of productive procrastination, such as, say, starting a blog?…………