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

Reveal.js incremental option doesn't apply to Latex formulas #99

Closed
rleyvasal opened this issue Aug 16, 2021 · 7 comments
Closed

Reveal.js incremental option doesn't apply to Latex formulas #99

rleyvasal opened this issue Aug 16, 2021 · 7 comments
Labels
pandoc concerns upstream pandoc question general questions - not an issue

Comments

@rleyvasal
Copy link

Issue

Latex in slide static when using incremental option - bullets still appear incremental.

## Slide 1
- fraction

$$\frac{a}{b}$$

Expected

Latex should be incremental same as bullet points

@cderv
Copy link
Collaborator

cderv commented Aug 17, 2021

What is exactly the behavior you expect ?
Is it the equation inside the first bullet point and to appear with the bullet point ?

For that, you need to make sure that the equation is indented correctly to be part of the bullet point.

Try this

---
title: "Untitled"
output: 
  revealjs::revealjs_presentation:
    incremental: true
---

## Slide 1

- fraction

  $$\frac{a}{b}$$

reveal-increment

@rleyvasal
Copy link
Author

rleyvasal commented Aug 17, 2021

Expected output: same as an R presentation (code below), bullet first, then the Latex)

Rpresentation
========================================================
author: 
date: 
autosize: true
incremental: true

Slide 1
========================================================

- fraction

  $$\frac{a}{b}$$   

@cderv
Copy link
Collaborator

cderv commented Aug 18, 2021

I believe this is not supported by Pandoc directly. The feature is called incremental list: https://pandoc.org/MANUAL.html#incremental-lists
So I believe that unless you also use a list item for the math element, it won't work. You cannot make any paragraph line incremental with this feature.

It is powered by Pandoc directly and it is unlikely we will change that in revealjs directly.

@rleyvasal
Copy link
Author

Just as a side note, I was able to override the behavior in slidy_presentation with <ul> and <li> tags as shown below; however, this code does not work in revealjs_presentation

# Slide with Bullets

<ul class="incremental">

<li>
fraction
</li>

<li>
  $$\frac{a}{b}$$ 
</li>

</ul>

@rleyvasal
Copy link
Author

rleyvasal commented Aug 18, 2021

Adding - infront of the Latex formula makes Latex incremental with a bullet point - It would be better if it appeared without bullet point, like R presentation, but this works for now.

# Slide with Bullets

- fraction
- $$\frac{a}{b}$$ 

slide

@cderv
Copy link
Collaborator

cderv commented Aug 18, 2021

Yes I said if you use a list item for the math element it works. So adding the dash is the easy solution. Thanks for sharing that it works ok.

You could try custom css to remove (hide) the marker maybe.

If you want to use HTML directly this is a solution. You just need to use the syntax compatible with revealjs, which is probably different from slidy. You can inspect the resulting HTML code to see what it looks like to set the correct classes on the node.

@cderv
Copy link
Collaborator

cderv commented Sep 17, 2021

Now looking closer on how reveal.js is working and knowing better Pandoc feature, here is the way to do incremental revealing of content on a slide: Use pausing !

---
title: Incremental reveal
output: 
  revealjs::revealjs_presentation: default
---

# Pausing in slide content

fraction will come next 

. . .

$$\frac{a}{b}$$ 

# Next slide

Conclusion

. . . is a special Pandoc syntax (https://pandoc.org/MANUAL.html#inserting-pauses) that will transform into reveal fragment features. See #120 for more experiment on supported syntax using reveal.js fragment class.

I'll close this now because it seems like a suitable answer that does not rely on Incremental List where list are not desired here.

@cderv cderv closed this as completed Sep 17, 2021
@cderv cderv added pandoc concerns upstream pandoc question general questions - not an issue labels Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pandoc concerns upstream pandoc question general questions - not an issue
Projects
None yet
Development

No branches or pull requests

2 participants