From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: Proposal/request for input: slidify export for html slides Date: Sat, 8 Feb 2014 01:04:39 +0000 (UTC) Message-ID: References: <20140130014552.GA8980@eyeBook> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBwM5-00051F-6N for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 20:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBwM0-0006sr-2D for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 20:05:13 -0500 Received: from plane.gmane.org ([80.91.229.3]:49266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBwLz-0006oL-P6 for emacs-orgmode@gnu.org; Fri, 07 Feb 2014 20:05:08 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WBwLv-0008Ay-KA for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 02:05:03 +0100 Received: from 169.228.157.113 ([169.228.157.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Feb 2014 02:05:03 +0100 Received: from ccberry by 169.228.157.113 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Feb 2014 02:05:03 +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 John Hendy gmail.com> writes: > > On Fri, Feb 7, 2014 at 3:50 PM, Charles Berry ucsd.edu> wrote: > > John Hendy gmail.com> writes: > > > >> > >> An interesting update on this. Aside from some image and code block > [snip - how John turn org to Rmd to md] > > > > 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) > This is a problem that results from rendering in a square rather than something proportional to what Mercator used: 202cm x 124cm, I think. slidify wants to have png files for images, so I think you are stuck having to set up the size of the device as well as the displayed size to get nice looking results. > #+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" :) I wasn't thinking about the case you just demonstrated. I have to use a line that gives out.width, out.height, fig.width, and fig.height, which slidify ('knitr' under the hood) uses to render the png and the page as you did to make something that looks like the Mercator map and still have the text look OK. See http://yihui.name/knitr/options if the options listed are not familiar. (knitr chunk options can be put in #+ATTR_RAVEL: lines for ravel exports to use them.) [more deleted] > > One other question while we're at it... I noticed that > #+begin/end_center produces this in the output .md file: > >
> ![nil](map.png) >
> > This doesn't export with slidify. [snip more details] Right. IMO, using the knitr tools for dealing with such issues beats wrestling with the babel and md exporter. i.e. fig.align="center" handles this. A good part of my motivation for ox-ravel is that I can deal with fine tuning output from knitr more easily than I can w/ babel exports. HTH, Chuck