touying-typ / touying

Touying is a powerful package for creating presentation slides in Typst.
https://touying-typ.github.io/
MIT License
789 stars 18 forks source link

`new-section-slide` not working anymore #116

Closed kokkonisd closed 1 day ago

kokkonisd commented 1 day ago

Hi!

I am following the "Build Your Own Theme" tutorial using Toying 0.5.3 and Typst 0.12.0 (7add9b45). Unfortunately, I can't get the new-section-slide function to work: it produces an empty slide, missing the section title. Upon further inspection, it seems that this function receives no arguments (i.e., changing the function signature to new-section-slide(..args) and then simply returning args gives (none)).

Has there been a change in this functionality recently? Maybe the docs should be updated? Note that it is working as expected when I use Toying 0.5.2.

(I'm attaching the PDF produced by the main.typ and bamboo.typ files, using their final version at the very bottom of the tutorial, under the section "Custom Special Slides".) main.pdf

OrangeX4 commented 1 day ago

Yes, I forgot to update the docs, which have been updated now. Now you should use

#let new-section-slide(self: none, body) = touying-slide-wrapper(self => {
  let main-body = {
    set align(center + horizon)
    set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")
    utils.display-current-heading(level: 1)
  }
  touying-slide(self: self, main-body)
})
OrangeX4 commented 1 day ago

Thanks for the reminder.