[ESS] Interaction with Sweave, knitr, pandoc, polymode et al.

Lionel Henry ||one|@hry @end|ng |rom gm@||@com
Mon Apr 4 18:12:38 CEST 2016

Just FYI, I've been using an org-mode based workflow with good
success. I use Lentic to switch from Org to R-mode. The lentic config
is there: https://github.com/phillord/lentic/issues/38#issuecomment-138870303

Then to compile the org file to an html or pdf:

- A custom ox exporter transforms the org file into a Rmd file. I
  don't recommend using ox-ravel for that as it doesn't integrate well
  with org-mode and is unnecessarily complex.

  I also have another derived exporter for scholdoc markdown.

  The reason I export to Rmd is to be able to run knitr which has much
  more features than org-mode when it comes to configuring chunks.

- When the exporter is done, knitr is called asynchronously on the Rmd
  file to get a regular md file. All knitr jobs run with a R inferior
  process that is specific to each org file.

- When knitr is finished, either pandoc or scholdoc is automatically
  run (depending on the file) via pandoc-mode. I don't use rmarkdown
  to run pandoc because I find it easier to configure pandoc/scholdoc
  from Emacs.

That's a lot of moving parts but it works surprisingly well. I
currently don't have the time to make it a proper Emacs package but I
should at least upload the ox exporters to a Github repo some time.
Ideally the knitr and pandoc steps should be accomplished with the
polymode weaving functions rather than my custom tools.


More information about the ESS-help mailing list