As the title says, I have an orgmode file I have been using with ess and exporting to TeX which has been going very well. However, I need to now export to html for reasons out of my control, and was wondering if there is a clean way to obtain an Rmd file from the org file.

Note that this is not the same as obtaining a markdown file.

To clarify the workflow as requested from the comments. The situation is as follows:

  1. I have a set of orgmode files which were used to analyze data (via ess)
  2. Typically I would export these to hugo-markdown for html output downstream (with ox-hugo, e.g. this file) and polymode-org-mode for TeX which works great

However, now I do need to edit the files in an .Rmd setting (hiding code chunks and adding some more analysis). Currently one approach is to export to markdown and then copy out what I need, but that seems inefficient. Similarly, the idea of manually messing with my html files is also not appealing.

The current issue is that orgmode export isn't clean enough to work as an Rmd file (though the pandoc-orgmode one is close).

The workflow I'm looking for is then:

  1. Load an R-session and work in an orgmode file
  2. Tangle (??) to an .Rmd so other people can muck around

I'm not really interested in the inverse route, since I don't really mind working in Rmd either (and I can connect to the same R-session), I'd just rather not hand-convert my existing files.

Note that in the current setup, the orgmode file has a lot of extra LATEX_HEADER options, since I was mostly just exporting to TeX. These options also mess with the output when working with the standard exporters.

  • Can you explain your workflow? It's definitley possible to export org -> html and org -> md. Unless you actually need to edit the Rmd, maybe one of these would work for you?
    – Tyler
    Commented Oct 19, 2020 at 13:43
  • Sure, I've added some more context.
    – HaoZeke
    Commented Oct 19, 2020 at 13:51
  • 1
    I understand. That would be useful for me as well, as I prefer org mode but have a lot of collaborators that only use RStudio
    – Tyler
    Commented Oct 19, 2020 at 13:54
  • 1
    This is an interesting question. Could you provide a link to a sample Org file that causes problems. I assume you have tried pandoc and/or ox-pandoc? If so, what is it exactly that doesn't get translated correctly?
    – gregoryg
    Commented Oct 21, 2020 at 14:41

1 Answer 1


The best way to generate an Rmd file from an org file is to use ox-ravel.

I use it all the time to generate the Rmd and then the html file using rmarkdown::render. It is great to share results with non-emacs users. It handles inline images, code, inline tables, you can add interactive images with plotly, interactive networks with networkviz etc.

The one thing that I don't like is that it can become very slow in some situations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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