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

Fix uncover bug with list items in 0.12 #186

Closed
TimotheAlbouy opened this issue Oct 18, 2024 · 10 comments · Fixed by #190
Closed

Fix uncover bug with list items in 0.12 #186

TimotheAlbouy opened this issue Oct 18, 2024 · 10 comments · Fixed by #190

Comments

@TimotheAlbouy
Copy link

Hello,

In typst 0.12, when we uncover a list item, its bullet already appears in the previous slides.

Example:

#import "@preview/polylux:0.3.1": *

#set page(paper: "presentation-16-9")
#set text(size: 25pt)

#polylux-slide[
  This is a list:
  - this is the first item
  #uncover(2)[
  - this is the second item
  ]
]

First slide:
image

@andreasKroepelin
Copy link
Collaborator

Oh here we go again... I think this problem appeared in the early days of Polylux already. Might be worth to investigate whether it's an regression within Typst.

@andreasKroepelin
Copy link
Collaborator

No wait I think it's always been like that? If you #hide a bullet list item, the bullet point is still shown. Are you sure this issue is new in Typst 0.12?

@TimotheAlbouy
Copy link
Author

TimotheAlbouy commented Oct 18, 2024

Hum when I switch back to 0.11.1 I get the correct output:

image

I'm on the webapp, and I switch between the compiler versions "Latest (Typst 0.11.1)" and "Typst 0.12.0 Testing" in the settings. I use the exact same code I posted here.

@andreasKroepelin
Copy link
Collaborator

Can you try out

- abc
#hide[- def]

?

@TimotheAlbouy
Copy link
Author

Can you try out

- abc
#hide[- def]

?

This also produces the bug of my first message (I'm on 0.12).

@andreasKroepelin
Copy link
Collaborator

But does it behave the same on earlier Typst versions?

@TimotheAlbouy
Copy link
Author

You're right, #hide[- def] also produces the bug on 0.11.1.

@rmburg
Copy link
Contributor

rmburg commented Nov 12, 2024

Workaround:

#show hide: it => {
  set list(marker: none)
  set enum(numbering: n => [])

  it
}

I'm interested in integrating this fix into polylux.
@andreasKroepelin I looked around the code for a bit and could not find a good place to put such a global show rule, the best i could find was inside the polylux-slide function.
Do you have a better idea on where to put this?
Touying uses a global show rule, templates use something like #show: touying-slides.with(...)

@andreasKroepelin
Copy link
Collaborator

Workaround:

#show hide: it => {
  set list(marker: none)
  set enum(numbering: n => [])

  it
}

I'm interested in integrating this fix into polylux.

Clever idea! Let's use that.

@andreasKroepelin I looked around the code for a bit and could not find a good place to put such a global show rule, the best i could find was inside the polylux-slide function.

That sounds like a good place to put it.

Do you have a better idea on where to put this?
Touying uses a global show rule, templates use something like #show: touying-slides.with(...)

Yeah for Polylux it's the same with templates (Touying started as a fork of Polylux) that they each have a "global" show rule. But I envision Polylux to work more like a library than as a framework so core functionality should work without such show rules.

@rmburg
Copy link
Contributor

rmburg commented Nov 12, 2024

Alright, I'll open a PR for this. Thanks for the insight!
To clarify, the touying-slides function is called by the templates, and provided by touying.
That's where they put show rules that apply across all themes.

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

Successfully merging a pull request may close this issue.

3 participants