1

I'd like to use ATTR_REVEAL: :frag (roll-in) to display images in a reveal.js slideshow that are created using dot source blocks.

So far I've tried source block headings of:

#+BEGIN_SRC dot :file test.png :results show :exports results This shows the test.png in the slideshow, but doesn't roll it in

#+BEGIN_SRC dot :file test.png :results none :exports results This does not show test.png in the slideshow

#+BEGIN_SRC dot :file test.png :exports none This does not show test.png in the slideshow either.

Is what i'm trying to do here possible? If so, what heading parameters should I use to export to the reveal.js slideshow?

Here is the slideshow source if it helps you understand things:

#+REVEAL_THEME: sky
#+OPTIONS: toc:nil num:nil
#+TITLE: Cool title
#+AUTHOR: That guy

* Slide 1
#+ATTR_REVEAL: :frag (roll-in)
- List item 1
#+BEGIN_SRC dot :file test1.png :results show :exports results
digraph auth {
rankdir=LR;
node [shape=record];
1->2;
2->3;
3->1 [label="bleh!", fontcolor=red];
}
#+END_SRC

#+RESULTS: [[file:test1.png]]

- List item 2
#+BEGIN_SRC dot :file test2.png :results none :exports results
graph pres {
rankdir=LR;
node [shape=record];

1--2--3--4;
}
#+END_SRC

* Slide 2
* Slide 3
1
  • just a question, would removing the space between the src_block and the results change anything? Try checking the exported html for hints. Maybe the space makes the file land in another element?
    – Daniel
    Oct 31, 2017 at 0:19

1 Answer 1

2

Figured out the solution. To get the #+RESULTS to roll-in during the exported presentation, I had to add additional #+ATTR_REVEAL :frag (roll-in) headings above each.

Corrected source:

#+REVEAL_THEME: sky
#+OPTIONS: toc:nil num:nil
#+TITLE: Cool title
#+AUTHOR: That guy

* Slide 1
#+ATTR_REVEAL: :frag (roll-in)
- List item 1

#+BEGIN_SRC dot :file test1.png
digraph auth {
rankdir=LR;
node [shape=record];
1->2;
2->3;
3->1 [label="bleh!", fontcolor=red];
}
#+END_SRC

#+ATTR_REVEAL: :frag (roll-in)
#+RESULTS: [[file:test1.png]]

#+ATTR_REVEAL: :frag (roll-in)
- List item 2

#+BEGIN_SRC dot :file test2.png
graph pres {
rankdir=LR;
node [shape=record];
1--2--3--4;
}
#+END_SRC

#+ATTR_REVEAL: :frag (roll-in)
#+RESULTS: file:test2.png

* Slide 2
* Slide 3

Hope this helps someone else too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.