Last year, I wrote about converting Org to DOCX with pandoc. Well, that particular method has needed some improvements. I needed to also support converting Markdown files, and more vitally, I needed to support the new-ish org-cite citation format.
For citations to work, you need to have a Citation Style Language (CSL) file. Zotero comes with a ton of them, so check your Zotero installation for examples.
In the updated fish shell function below, you will want to update both
csldoc to point to your reference DOCX file and your CSL file, respectively.
function org2docx --description 'Generate a DOCX file using a custom reference document' set -l refdoc "$PATH_TO_REFERENCE_DOCX" set -l csldoc "$PATH_TO_CSL" set -l fromfmt (string match -r '(?:org|md)$' $argv) set -l base (basename -s .$fromfmt $argv) echo Generating $base.docx ... pandoc --from "$fromfmt"+citations \ --citeproc --csl $csldoc \ --reference-doc $refdoc -o $base.docx $argv end
And there you have it! Now you can convert both Org files and Markdown files to DOCX. And I am sorry that you have to use DOCX!