andreasKroepelin / polylux

A package for creating slides in Typst
https://polylux.dev/book
MIT License
1.13k stars 51 forks source link

[Bug] Colon triggers a new "line" in `line-by-line` #139

Open KronosTheLate opened 8 months ago

KronosTheLate commented 8 months ago

The following code:

#slide(title: "title")[
  #line-by-line[
    test:theese:words
  ]
]

Ends up producing subslides that reveal one word or colon at a time: image

So it seems like a colon introduces a new "line" both before and after itself. This makes it impossible to write "The solution: more duct tape" in a line-by-line environment (with each line actually revealed one at a time).

KronosTheLate commented 8 months ago

Interestingly, when putting the same content into a bullet, this does not happen. Code:

#slide(title: "title")[
  #line-by-line[
    - test:these:words
    - also:these:words
  ]
]

Output: image

andreasKroepelin commented 8 months ago

#line-by-line is implemented in quite a hacky way, so this failure is not surprising. It actually one-by-ones the children of the given sequence. Often, those are the lines, but not always. So yeah, use #one-by-one for a more robust behaviour.

KronosTheLate commented 8 months ago

Fair. I have also found just using #pause quite perfect. I will keep this issue around for a future fix.