Skip to content

Codly code blocks invisible when using alternatives #227

@laikq

Description

@laikq

Hello! I'm not 100% sure if this is the right place to ask… I've observed the following unexpected behavior:

This code produces two white slides. The do contain selectable code/text, but the formatting is messed up (white text on white background, line numbers not where they belong).

#import "@preview/polylux:0.4.0": *
#import "@preview/codly:1.3.0": *

// ↓ remove this line and the slides show
//   `foo` and `bar` as expected
#show: codly-init.with()

#slide[
  #alternatives[
    ```
    foo
    ```
  ][
    ```
    bar
    ```
  ]
]

Code blocks are correctly shown:

  • outside of alternatives (they are shown in uncover and only as expected)
  • when using Touying instead of Polylux (hence why I put this issue here)
  • when disabling codly

Maybe this has something to do with codly modifying state? But even when using codly's local function, the problem persists and empty slides are shown.

Use case: I wanted to highlight different lines of a code block depending on the subslide using alternatives-fn and noticed that no code was showing.

  • using typst 0.14.2 (b33de9de)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions