emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Charles Berry <ccberry@ucsd.edu>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Proposal/request for input: slidify export for html slides
Date: Fri, 7 Feb 2014 16:18:13 -0600	[thread overview]
Message-ID: <CA+M2ft-vnm8aZKEKmOgHsVab127Ru2pod7FR46Ohxxzqew-9zg@mail.gmail.com> (raw)
In-Reply-To: <loom.20140207T202459-501@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3976 bytes --]

On Fri, Feb 7, 2014 at 3:50 PM, Charles Berry <ccberry@ucsd.edu> wrote:
> John Hendy <jw.hendy <at> 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")`
>>
> [much deleted]
>
> John,
>
> You can put the header code into an MD export block (and ignore index.Rmd).
> You can add '#+MD: ---' keyword lines to mark new slides.
>

Awesome! Hadn't thought of that, and sounds great.

> Then you export to my.Rmd directly (using ravel) and run slidify("my.Rmd").
>
> Graphics 'just work', but you have to mind the spacing to be sure the slides
> render nicely.
>

Hmmm. Could you elaborate on this? I haven't experienced this with R +
ggplot. The presentation I'm working on for tomorrow is on geo-spatial
data with R and I generate a lot of maps. I find that something like
this doesn't produce properly scaled images:

#+header: :file .map.pdf
#+begin_src R :results output graphics :exports results

# install.packages("maps")
library(maps)
world <- map_data("world")

p <- ggplot(world, aes(x = long, y = lat, group = group))
p <- p + geom_polygon(colour = "white")
p

#+end_src

I often get something squarish, which makes the map look really
compressed (see attached). Thus, I seem to need both this (name,
header)

#+name: world-adj
#+header: :file map-adj.pdf :width 9 :height 6
#+begin_src R :results output graphics :exports results

# code from above

#+end_src

and this (right height for latex)

#+begin_center
#+attr_latex: :height 6cm
#+RESULTS: world-map
[[file: world-adj.pdf]]
#+end_center

I guess in this example, the heights are the same, however sometimes
this isn't the case as to use the right height for the slides can goof
with how proportionally big the axis, label, and legend text is and it
requires, in my opinion, waaaay more work to use the theme() arguments
in ggplot2 to tailor them correctly vs. just playing with
:width/:height options and then scaling the final image in the
#+RESULTS section.

I would love to avoid the above if you have more clarification on "just work" :)

> The file slidify-example.org at
>
>    https://github.com/chasberry/orgmode-accessories/
>
> produces a minimal slidify slideshow with code, computed results, and graphics.
>
> And it has some notes on org --> slidify using the md-knitr backend from
> ox-ravel.
>

I'll take a look at this. I wasn't aware of ox-ravel.

> Ideally, a `md-slidify' backend would get written to automagically
> produce the yaml header, separate slides based on headline levels, et
> cetera. But that is a low priority right now.
>

Understood, and inserting the yaml header is not an issue at all. The
#+md: --- code alone removes a good amount of effort.

One other question while we're at it... I noticed that
#+begin/end_center produces this in the output .md file:

<div class="center">
![nil](map.png)
</div>

This doesn't export with slidify. Do I need to define a center <div>
style? I googled around for the proper syntax to center images in
markup and didn't find much other than defining a .css style to go
along with the description. In this case, it seems Org defaults to
[nil] so I'd either replace all of those or .css style all of the
[nil].
- http://stackoverflow.com/questions/255170/markdown-and-image-alignment
(just change the =float : right= argument to centering syntax)


Thanks for the input,
John

>
> HTH,
>
> Chuck
>
>
>
>

[-- Attachment #2: world.pdf --]
[-- Type: application/pdf, Size: 132480 bytes --]

[-- Attachment #3: world-adj.pdf --]
[-- Type: application/pdf, Size: 132478 bytes --]

  reply	other threads:[~2014-02-07 22:18 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
2014-02-07 21:50         ` Charles Berry
2014-02-07 22:18           ` John Hendy [this message]
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=CA+M2ft-vnm8aZKEKmOgHsVab127Ru2pod7FR46Ohxxzqew-9zg@mail.gmail.com \
    --to=jw.hendy@gmail.com \
    --cc=ccberry@ucsd.edu \
    --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).