2

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 Oct 19 at 13:43
  • Sure, I've added some more context. – HaoZeke Oct 19 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 Oct 19 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 Oct 21 at 14:41

Your Answer

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

Browse other questions tagged or ask your own question.