touying-typ / touying

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

How to display the outline of dewdrop theme in two columns? #54

Open Clark-Young opened 3 weeks ago

Clark-Young commented 3 weeks ago

When we have more sections, a single-column table of contents can easily exceed one page. However, the section titles are usually short, so it is a good idea to have a double-column table of contents. I have try my best to figure out how to achieve this but failed, so I open an issue here. Hope to get your reply soon.

OrangeX4 commented 3 weeks ago

a hack way:

#let s = themes.dewdrop.register(aspect-ratio: "16-9")
#(s.methods.outline-slide = (self: none, ..args) => {
  (self.methods.slide)(self: self, setting: columns.with(2), heading(level: 2, self.outline-title) + parbreak() + (self.methods.touying-outline)(self: self, cover: false))
})
#(s.methods.touying-new-section-slide = (self: none, section) => {
  (self.methods.slide)(self: self, setting: columns.with(2), section: section, heading(level: 2, self.outline-title) + parbreak() + (self.methods.touying-outline)(self: self))
})
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, outline-slide, new-section-slide, focus-slide) = utils.slides(s)
#show: slides

I'll find a way to simplify it in the future.