Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show two cells at once, without fragments? #593

Closed
drscotthawley opened this issue Apr 26, 2021 · 4 comments
Closed

How to show two cells at once, without fragments? #593

drscotthawley opened this issue Apr 26, 2021 · 4 comments

Comments

@drscotthawley
Copy link

drscotthawley commented Apr 26, 2021

(This is a cross-post and elaboration of the question I asked on Gitter:) Wonderful utility RISE is!

There's something I'm not understand, and not seeing described in the documentation: How do we get two or more cells to appear at the same time on the same slide, without having to advance through fragments?

Most of my slides are two parts, from two cells: A Markdown header with the slide title and a bit of text, and then below that a figure (picture/chart) generated by a code cell.

Currently I'm setting the Markdown header as "slide" and the code cell as "fragment", but that means that I always have to press the space bar to reveal the slide and -- more importantly -- the "w" overview doesn't show any of my figures, making it harder to navigate.

How can we get two cells to display at the same time without having to step through "fragments"? Perhaps there's an "auto-advance fragments" customization? (but I didn't see any such thing mentioned. )

(Or, I'd settle for fragments displaying in overview if not in the main-display mode.)

@drscotthawley
Copy link
Author

drscotthawley commented Apr 26, 2021

From this reveal.js issue hakimel/reveal.js#1784, it's possible to have it auto-show the first fragment (good enough for me!) by adding this to a "skipped" code cell at the top:

%%html
<script>
Reveal.addEventListener( 'slidechanged', function( event ) {
    Reveal.nextFragment();
} );
</script>

...this works! Closing.

@drscotthawley
Copy link
Author

drscotthawley commented Apr 26, 2021

...I spoke too soon. That seems to work some of the time, but it's intermittent. Some first fragments auto-show, others don't and you still have to press the space bar to see them. The intermittancy seems to be from errors in the (Brave) browser:

Uncaught ReferenceError: Reveal is not defined
    at <anonymous>:2:1
    at b (main.min.js:2)
    at Pe (main.min.js:2)
    at S.fn.init.append (main.min.js:2)
    at OutputArea._safe_append (main.min.js:35319)
    at OutputArea.append_display_data (main.min.js:35526)
    at OutputArea.append_output (main.min.js:35206)
    at OutputArea.handle_output (main.min.js:35117)
    at output (main.min.js:36943)
    at Kernel._handle_output_message (main.min.js:38704)

Update: Think I might have figured out a process that works:

  1. Start the slideshow
  2. Exit the slideshow
  3. Then execute the HTML/javascript to add the event listener
  4. Re-run the slideshow. Now the first fragments will autoload.

If you ever reload the browser page serving the notebook, you'll need to repeat this process.

@drscotthawley drscotthawley reopened this Apr 26, 2021
@parmentelat
Copy link
Collaborator

As mentioned on gitter, just don't add fragments at all and iiuc you will get the behavior that you want

@drscotthawley
Copy link
Author

@parmentelat Thank you! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants