[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Proposal/request for input: slidify export for html slides

From: John Hendy
Subject: Re: [O] Proposal/request for input: slidify export for html slides
Date: Sun, 9 Feb 2014 22:54:22 -0600

On Sun, Feb 9, 2014 at 10:16 PM, Charles Berry <address@hidden> wrote:
> John Hendy <jw.hendy <at> gmail.com> writes:
>> On Sat, Feb 8, 2014 at 11:18 AM, Charles Berry <ccberry <at> 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,

>> 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

> [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
<img > 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:

#+attr_latex: :height 6cm
#+attr_html: :height 400px
#+attr_ravel: :height 400px

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?


> HTH,
> Chuck

reply via email to

[Prev in Thread] Current Thread [Next in Thread]