Monday, 30 January 2012

Org-mode and Microsoft Word

One of my less enjoyable tasks is to produce a weekly status report following a particular look. This then gets emailed off and compiled with others. Unsurprisingly the format has to be Microsoft Word and no one ever gets the use of format styles correct.

Editing the pro-forma always has me cursing: delete one character too many and fonts change, bullets appear or disappear, all the usual joys of Word.

Emacs, and more specifically org-mode to the rescue. Org has had the ability to export in several formats (typically LaTeX and HTML) for quite some time but now boasts support for OpenDocument format too.

So my status reports are now written using Emacs with a line setting org-export-odt-styles-file to point at a hand handcrafted OpenDocument template file. That sorts out the presentation aspects of the final document. C-c C-e o exports my text to OpenDocument then open that in LibreOffice and save as Microsoft Word format. The conversion from ODT to docx format can be automated: soffice --headless --convert-to docx myfilename.

I wouldn't say that I actually enjoy writing my status reports now, but at least it's considerably less painful, I can just get on with writing information and not with fighting the tools.

1 comment:

  1. This is cool, please s=hare more details. I am just getting my feet wet with Emacs and am looking to implement a solution like this.