From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Proposal/request for input: slidify export for html slides Date: Fri, 07 Feb 2014 08:58:06 +0100 Message-ID: <878utntkvl.fsf@med.uni-goettingen.de> References: <20140130014552.GA8980@eyeBook> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBgKO-0003DS-Rp for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 02:58:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBgKJ-0001I9-45 for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 02:58:24 -0500 Received: from plane.gmane.org ([80.91.229.3]:45951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBgKI-0001I5-Qg for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 02:58:19 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WBgKG-0000HK-Lc for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 08:58:16 +0100 Received: from vpn-2122.gwdg.de ([134.76.2.122]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Feb 2014 08:58:16 +0100 Received: from andreas.leha by vpn-2122.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Feb 2014 08:58:16 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi John, John Hendy writes: > An interesting update on this. Aside from some image and code block > stuff, the following works surprisingly well! > - Export Org -> markdown (md) > - Start an R session and `setwd("/path/to/file.md")` > - Run `library(slidify)` and `author("deck") > - Copy the deck/assets folder into the parent directory > - Copy the header code from the resultant deck/index.Rmd file into > exported .md file > - Add three hyphens before each heading (headings are # Slide title) > - Save the file as file.Rmd (vs. file.md) > - From the R session, do `setwd("../")` (running `author("deck")` > changes the working directory to deck/ > - Run `slidify("file.Rmd")` > > I was coming from Beamer, so all of my generated plots are .pdfs. I > plan to create a new directory and use imagemagic to convert them all > to png or jpg, and then modify my original .org file tailored for > Beamer to use the images vs. pdfs, as well as adding #+attr_html > headings instead of the existent #+attr_latex ones in my current file. Are your pdf plots generated (by R) through babel? In that case (and given that you do not rely on absolute positioning) you can make Org /do the right thing/ for you without the need to call imagemagick manually in the end. Making images export correctly across multiple backends is a lot of work (#+attr_latex and #+attr_html should live happily together), so I'll stick to a simple example ;-) --8<---------------cut here---------------start------------->8--- * R plot for multiple backends You might even consider tikz for the LaTeX route instead of pdf. #+name: demoplot #+header: :exports results #+header: :results graphics #+header: :file (by-backend (latex "demoplot.pdf") (html "demoplot.svg") (t "demoplot.png")) #+begin_src R ## taken from ?plot plot(table(rpois(100, 5)), type = "h", col = "red", lwd = 10, main = "rpois(100, lambda = 5)") #+end_src #+results: demoplot [[file:demoplot.png]] --8<---------------cut here---------------end--------------->8--- This relies on the by-backend macro from Eric Schulte: --8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp (defmacro by-backend (&rest body) `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body)) #+end_src --8<---------------cut here---------------end--------------->8--- > > I'll post a test file and the process if anyone is interested in replicating! Please do so. I guess that somehow such a process should be automatable in the end. [ ... ] Regards, Andreas