5

Platform: Windows 7, Emacs 24.2, Pandoc 1.17.2

Scenario: I am writing a markdown file in Emacs. I need to use pandoc to render the output, because it supports citations (using pandoc-citeproc).

Question: How can I preview a pandoc-rendered version (probably html) in another buffer simultaneously?

7

After a while, I found the answer myself:

In a nutshell: Use a combination of Eww and markdown mode, and configure markdown mode to render markdown with pandoc.

Alas, easier said than done.

  • Update to Emacs 24.5
  • Eww is the built-in browser since Emacs 24.5 It can be used to display html output. Eww does not run out of the box in Emacs 24.5 for windows. The libxml2 library has to be downloaded and copied manually into Emacs' bin folder.
  • In order to install markdown mode through the built-in package-manager, you first need to fix the package manager. It relies on TLS. However, Emacs' 24.5 TLS implementation does not work out of the box in windows. To make it work:
  • Now you can install markdown mode by invoking M-x install-package markdown-mode.
  • Configure the rendering engine by invonking M-x customize-mode in the active markdown buffer. Set this to pandoc with your preferred flags and options.
  • Press C-C-l inside the markdown buffer to see the rendered results in a Eww buffer next to your markdown file.

...et voilà.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.