From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Proposal/request for input: slidify export for html slides Date: Sun, 9 Feb 2014 22:54:22 -0600 Message-ID: References: <20140130014552.GA8980@eyeBook> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCisy-0006R8-Lf for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 23:54:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCisx-0002Fo-Af for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 23:54:24 -0500 Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:56170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCisx-0002Fk-3n for emacs-orgmode@gnu.org; Sun, 09 Feb 2014 23:54:23 -0500 Received: by mail-ob0-f171.google.com with SMTP id wp4so6730064obc.30 for ; Sun, 09 Feb 2014 20:54:22 -0800 (PST) In-Reply-To: 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: Charles Berry Cc: emacs-orgmode On Sun, Feb 9, 2014 at 10:16 PM, Charles Berry wrote: > John Hendy gmail.com> writes: > >> >> On Sat, Feb 8, 2014 at 11:18 AM, Charles Berry ucsd.edu> wrote: >> > [snip] > >> >> Ah. I think I follow this. If you knit the exported .org -> Rmd file >> in the same R session that Org is using, if you change the .org and >> re-export to .Rmd, knitr is smart enough not to re-run the code? Is >> that what you mean? > > Almost. ox-ravel does not call knitr. The ravel backends advice > `org-babel-exp-do-export' when a ravel backend runs so R code src blocks > are not run, but are turned into chunks (for knitr, Sweave, or ...) and > exported as such. > > When you want to actually process the resulting document, you have to call > on knitr or some other R report generator to do the work. > I think I stated it ambiguously before. I think we're on the same page. Org -> Rmd. Then process Rmd in an Emacs R session. If you re-export from Org -> Rmd, only new code block changes are re-run, correct? >> That also must imply that export to .Rmd doesn't >> execute any of the Org babel code, right (otherwise there would be no >> benefit to your workflow since you'd be waiting for Org anyway)? > > Correct for R src blocks. But emacs-lisp and other languages are treated as > under the parent backends. > >> >> If that's the case, I think I could roll with that -- I'd just have >> :eval yes if exporting to .Rmd -> knitr, and do a replace-string to >> :eval no if I was going to export to Beamer. >> > > In R scr blocks, :eval is ignored by ravel and so need not change when > ravel is run. Ah, that makes more sense. I guess I had all mine set to :eval no and never experienced that ox-ravel doesn't actually run them. Thanks for that. > > [snip] > >> I'm a bit hung up on including non-code-generated images. I'm working >> through one of my presentations to convert to slidify (and may write >> up a Worg tutorial or just one on my blog to add to collective >> knowledge) but am not sure of the right "universal Org syntax" that >> will work with multiple backends. I'm most used to something like >> this: >> >> #+begin_center >> #+attr_backend :height {6cm, 400px, etc.} >> [[./path/to/image.png]] >> #+end_center >> >> That's not seeming to work with ox-ravel thus far. I'd love not to >> have to change the Org image syntax to straight markdown just for my >> occasional use of slidify. >> > > It's not related to ox-ravel, which uses the same transcoders as the parent > backends for everything except inline src and src blocks. > > I'm not sure how to get what you seem to want. > What I mean is how do I just add an image via existing Org syntax and get it sized correctly in the Org -> Rmd -> html process? None of the attributes seem to be carried through to markdown with ox-md or ox-ravel. So my question might be more clear if I said, "Say you have an image that's 1600x900px and you want it in your slidify deck at 400px tall. How would you do that?" ox-ravel works fine by just specifying knitr fig.height/width if you're going to generate your plots during the process of knitting. You create the plot at exactly the size you want. But how might you resize an existing plot depending on the format? If you want an html equivalent to the latex article class, you might want a different plot size than if you want to export to slidify. Would one have to go through and replace all the fig.height/width arguments and re-run all the plot code just to get proper image sizing? Once there are perfectly good images laying around... it doesn't seem like one should have to re-generate them just because a different size is desired. > Maybe use a custom link > > http://orgmode.org/org.html#Adding-hyperlink-types > > or ask about html/md links in a fresh thread? I posted another ML post along these lines earlier today. Since markdown is just a middle destination onto html, I'm interested in getting Org's built-in image attributes passed along for the whole trip. I don't see a way to even center an image at present. The direct tag could be put in Org... but that breaks the spirit of keeping Org's syntax flexible enough to let me export to another backend if I want. Thus, the ideal goal would be something like: #+begin_center #+attr_latex: :height 6cm #+attr_html: :height 400px #+attr_ravel: :height 400px [[./img.png]] #+end_center Thus I get a centered image at some appropriate size for each backend. Otherwise I'll be having to do #+begin/end_latex and #+begin/end_html for every image in my document. Does that make more sense? John > > HTH, > > Chuck > >