reddit / emacs

I am able to use pandoc from the CLI but I don’t understand how to use pandoc from within emacs. For example to turn a .org to a .docx document.

RevTomJohnson · 2022-03-16 19:34
Deep-Fox6860 · 2022-03-16 19:41
You need to install some package for that; have a look at [https://github.com/kawabata/ox-pandoc](https://github.com/kawabata/ox-pandoc) for example.
quiteasmallperson · 2022-03-16 19:52
As u/Deep-Fox6860 says, there is a package (ox-pandoc) to use pandoc with org-mode's built-in export system, and it works very well. If you mean more generally, i.e. outside of org-mode, you can always just have a shell (I use eshell) open within emacs and run it as you would from the CLI, or you can execute a shell command in the minibuffer with M-! and run it from there.
RevTomJohnson · 2022-03-16 20:01
Ok thanks
mclearc · 2022-03-16 20:14
In addition to ox-pandoc, which is specifically for using org with pandoc, there is [pandoc-mode](https://github.com/joostkremers/pandoc-mode). I personally use [multi-compile](https://github.com/ReanGD/emacs-multi-compile) with specific commands for each mode (markdown, html, org, beamer, etc). You can see how I set this up in my config files [here](https://github.com/mclear-tools/dotemacs/blob/a4701a59ea08d3d291c363c8d845aca5a1134b28/setup-config/setup-programming.el#L421).
RevTomJohnson · 2022-03-16 20:25
Thank you, very informative
jumpUpHigh · 2022-03-16 21:07
melpa is pointing to this https://github.com/emacsorphanage/ox-pandoc repo instead of the one you linked.
NoisyFrequency · 2022-03-16 22:35
I can also vouch for `pandoc-mode` it works well and it can be used from the menu bar as well if need be.
danderzei · 2022-03-17 01:30
To convert Org mode to Word use this: ;; Export org to MS-Word ;; Need to have LibreOffice on your computer (setq org-odt-preferred-output-format "doc") Org can natively export to Open Office, which will then convert it to Word for you.
TheSnowIsCold-46 · 2022-03-17 04:30
Oh cool! Never thought to look into this as I usually export to ODT then convert to Word in Word. This is great thanks for this!
flyin1501 · 2022-03-17 07:01
There is always the option to just launch eshell (which will start in the current buffer's directory) and call pandoc from there, if you just want to not have to open a terminal and manually cd to the right place.
Deep-Fox6860 · 2022-03-17 10:55
Even better.