Last year around this time, I was working on a paper and it was requested that I submit it to the professor in .docx format for easier commenting. I hadn’t really built this into my workflow at the time (always going from .org or .tex straight to .pdf ), and so I decided to figure out how to do it. Now exporting to .docx isn’t really too much of a problem with Org-mode, since you can export to an LibreOffice .odt format and convert it from there.

The trouble that I was having with the Org .odt exporter was that it wasn’t dealing with my biblatex citations. They would just show up as cite commands or something like that. The solution that I’ve found is to use pandoc and that works pretty well. But setting the options for this function was tedious, and so I created a function in my bash profile so that I could do this easily with a org2docx command. (Note: You can use this for other types of files (such as markdown), too. I just care about org files here.)

Here are the steps that I used:

First, you will need to install pandoc. This is easy with homebrew: brew install pandoc .

. You should also install pandoc-citeproc: brew install pandoc-citeproc

You should download the .csl files from Github and put them in an easy-to-access directory.

I think it is a good idea to create a reference.docx template for creating a custom style for your new .docx files. There is a short post on that here. You then need to play with the styles in the file to your liking and put it in an easy to reference place.

template for creating a custom style for your new files. There is a short post on that here. You then need to play with the styles in the file to your liking and put it in an easy to reference place. After that, you should open ~/.bash_profile in your favorite text editor and add the following function with the appropriate modifications (see below for a discussion of the options) for your setup:

org2docx() { pandoc --bibliography=/path/to/your/bibliographyfile.bib --csl=/path/to/your/csl/chicago-fullnote-bibliography.csl --reference-docx=/path/to/your/reference.docx -i $1 -o $1-pandoc.docx }

You will need to run source ~/.bash_profile to load the changes.

You can now convert documents like this: org2docx MyPaper.org fairly easily without having to bother with the options every time.

Here’s what the various options do: