emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: Proposal/request for input: slidify export for html slides
Date: Fri, 07 Feb 2014 08:58:06 +0100	[thread overview]
Message-ID: <878utntkvl.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: CA+M2ft8uUfbG_6u+ERx195kL1YnrrA-5P_vrRs3C6oseqOos-Q@mail.gmail.com

Hi John,

John Hendy <jw.hendy@gmail.com> 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

  reply	other threads:[~2014-02-07  7:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30  0:05 Proposal/request for input: slidify export for html slides John Hendy
2014-01-30  0:57 ` Ahmadou Dicko
2014-01-30  1:45   ` Rick Frankel
2014-01-30  4:26     ` John Hendy
2014-02-07  1:26       ` John Hendy
2014-02-07  7:58         ` Andreas Leha [this message]
2014-02-07 21:50         ` Charles Berry
2014-02-07 22:18           ` John Hendy
2014-02-08  1:04             ` Charles Berry
2014-02-08  5:38               ` John Hendy
2014-02-08  5:51                 ` John Hendy
2014-02-08 17:18                   ` Charles Berry
2014-02-09 22:26                     ` John Hendy
2014-02-10  4:16                       ` Charles Berry
2014-02-10  4:54                         ` John Hendy
2014-02-08  9:33             ` Nicolas Goaziou
2014-02-08 14:11               ` John Hendy
2014-02-08 14:52                 ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878utntkvl.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).