andreasKroepelin / polylux

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

#label breaks Polylux slide header #181

Closed maucejo closed 2 months ago

maucejo commented 2 months ago

Hi, I have a strange issue with the label given to a dedicated slide. Indeed, when a label is given to a slide, the (custom) header of the next slide disappears.

As you can see in the following MWE, the first, second and fourth slides have their headers. I put a label to the second slide, which makes the header of the third slide disappear.

#import "@preview/polylux:0.3.1": *
#import themes.metropolis: *

#show: metropolis-theme

#set text(font: "Fira Sans", weight: "light", size: 20pt)
#set strong(delta: 100)
#set par(justify: true)

#title-slide(
  author: [Authors],
  title: "Title",
  subtitle: "Subtitle",
  date: "Date",
  extra: "Extra"
)

#slide(title: "First title")[
  #lorem(20)
]

#slide(title: "Second title")[
  #lorem(20)
]<app>

#slide(title: "Third title")[
  #lorem(20)
]

#slide(title: "Fourth title")[
  #lorem(20)
]

Is there a workaround to solve this issue ? Thank you.

andreasKroepelin commented 2 months ago

That's strange indeed! Looks rather like a Typst bug. Why would you want a label on a slide though?

maucejo commented 2 months ago

A typical use case would be a slide with some content that is detailed in an appendix slide. Except the problem mentioned in this issue, it works smoothly.

andreasKroepelin commented 2 months ago

So you want to make a reference to a slide?

maucejo commented 2 months ago

Yes, exactly.

andreasKroepelin commented 2 months ago

Currently, you can only make references to figures and a few bespoke Typst elements in Typst. So referencing slides cannot really work by itself.

maucejo commented 2 months ago

Actually except this problem of header, using #label + #link works (I swear ! :)).

maucejo commented 2 months ago

I think I find how to do this. To make a reference between slides, we just have to add the lable into the slide and make a link in another slide to jump to it.