From d5b9065c7d3553767541f5b184f30121962c02c4 Mon Sep 17 00:00:00 2001 From: OrangeX4 <318483724@qq.com> Date: Mon, 24 Feb 2025 19:53:41 +0800 Subject: [PATCH 1/4] touying:0.6.1 --- packages/preview/touying/0.6.1/.gitignore | 4 + packages/preview/touying/0.6.1/LICENSE | 20 + packages/preview/touying/0.6.1/README.md | 376 ++++ packages/preview/touying/0.6.1/changelog.md | 316 +++ .../touying/0.6.1/examples/aqua-zh.typ | 43 + .../preview/touying/0.6.1/examples/aqua.typ | 38 + .../touying/0.6.1/examples/default.typ | 54 + .../touying/0.6.1/examples/dewdrop.typ | 63 + .../touying/0.6.1/examples/example.typ | 211 ++ .../touying/0.6.1/examples/metropolis.typ | 68 + .../preview/touying/0.6.1/examples/simple.typ | 38 + .../touying/0.6.1/examples/stargazer.typ | 66 + .../touying/0.6.1/examples/university.typ | 46 + packages/preview/touying/0.6.1/lib.typ | 43 + .../preview/touying/0.6.1/src/components.typ | 580 +++++ .../preview/touying/0.6.1/src/configs.typ | 723 +++++++ packages/preview/touying/0.6.1/src/core.typ | 1913 +++++++++++++++++ .../preview/touying/0.6.1/src/exports.typ | 38 + packages/preview/touying/0.6.1/src/magic.typ | 226 ++ packages/preview/touying/0.6.1/src/pdfpc.typ | 187 ++ packages/preview/touying/0.6.1/src/slides.typ | 109 + packages/preview/touying/0.6.1/src/utils.typ | 1288 +++++++++++ .../preview/touying/0.6.1/themes/aqua.typ | 344 +++ .../preview/touying/0.6.1/themes/default.typ | 60 + .../preview/touying/0.6.1/themes/dewdrop.typ | 392 ++++ .../touying/0.6.1/themes/metropolis.typ | 309 +++ .../preview/touying/0.6.1/themes/simple.typ | 207 ++ .../touying/0.6.1/themes/stargazer.typ | 469 ++++ .../preview/touying/0.6.1/themes/themes.typ | 7 + .../touying/0.6.1/themes/university.typ | 367 ++++ packages/preview/touying/0.6.1/typst.toml | 12 + 31 files changed, 8617 insertions(+) create mode 100644 packages/preview/touying/0.6.1/.gitignore create mode 100644 packages/preview/touying/0.6.1/LICENSE create mode 100644 packages/preview/touying/0.6.1/README.md create mode 100644 packages/preview/touying/0.6.1/changelog.md create mode 100644 packages/preview/touying/0.6.1/examples/aqua-zh.typ create mode 100644 packages/preview/touying/0.6.1/examples/aqua.typ create mode 100644 packages/preview/touying/0.6.1/examples/default.typ create mode 100644 packages/preview/touying/0.6.1/examples/dewdrop.typ create mode 100644 packages/preview/touying/0.6.1/examples/example.typ create mode 100644 packages/preview/touying/0.6.1/examples/metropolis.typ create mode 100644 packages/preview/touying/0.6.1/examples/simple.typ create mode 100644 packages/preview/touying/0.6.1/examples/stargazer.typ create mode 100644 packages/preview/touying/0.6.1/examples/university.typ create mode 100644 packages/preview/touying/0.6.1/lib.typ create mode 100644 packages/preview/touying/0.6.1/src/components.typ create mode 100644 packages/preview/touying/0.6.1/src/configs.typ create mode 100644 packages/preview/touying/0.6.1/src/core.typ create mode 100644 packages/preview/touying/0.6.1/src/exports.typ create mode 100644 packages/preview/touying/0.6.1/src/magic.typ create mode 100644 packages/preview/touying/0.6.1/src/pdfpc.typ create mode 100644 packages/preview/touying/0.6.1/src/slides.typ create mode 100644 packages/preview/touying/0.6.1/src/utils.typ create mode 100644 packages/preview/touying/0.6.1/themes/aqua.typ create mode 100644 packages/preview/touying/0.6.1/themes/default.typ create mode 100644 packages/preview/touying/0.6.1/themes/dewdrop.typ create mode 100644 packages/preview/touying/0.6.1/themes/metropolis.typ create mode 100644 packages/preview/touying/0.6.1/themes/simple.typ create mode 100644 packages/preview/touying/0.6.1/themes/stargazer.typ create mode 100644 packages/preview/touying/0.6.1/themes/themes.typ create mode 100644 packages/preview/touying/0.6.1/themes/university.typ create mode 100644 packages/preview/touying/0.6.1/typst.toml diff --git a/packages/preview/touying/0.6.1/.gitignore b/packages/preview/touying/0.6.1/.gitignore new file mode 100644 index 000000000..5e56ef32e --- /dev/null +++ b/packages/preview/touying/0.6.1/.gitignore @@ -0,0 +1,4 @@ +/local + +*.pdf +*.pdfpc \ No newline at end of file diff --git a/packages/preview/touying/0.6.1/LICENSE b/packages/preview/touying/0.6.1/LICENSE new file mode 100644 index 000000000..c8023939f --- /dev/null +++ b/packages/preview/touying/0.6.1/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2024 OrangeX4 +Copyright (c) 2024 Andreas Kröpelin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/preview/touying/0.6.1/README.md b/packages/preview/touying/0.6.1/README.md new file mode 100644 index 000000000..df2e9343c --- /dev/null +++ b/packages/preview/touying/0.6.1/README.md @@ -0,0 +1,376 @@ +# ![logo](https://github.com/user-attachments/assets/58a91b14-ae1a-49e2-a3e7-5e3a148e2ba5) + +[Touying](https://github.com/touying-typ/touying) (投影 in chinese, /tóuyǐng/, meaning projection) is a user-friendly, powerful and efficient package for creating presentation slides in Typst. Partial code is inherited from [Polylux](https://github.com/andreasKroepelin/polylux) like `#only()` and `#uncover()`. + +Touying provides automatically injected global configurations, which is convenient for configuring themes. Besides, Touying does not rely on `counter` and `context` to implement `#pause`, resulting in better performance. + +If you like it, consider [giving a star on GitHub](https://github.com/touying-typ/touying). Touying is a community-driven project, feel free to suggest any ideas and contribute. + +[![Typst Universe](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftypst.app%2Funiverse%2Fpackage%2Ftouying&query=%2Fhtml%2Fbody%2Fdiv%2Fmain%2Fdiv%5B2%5D%2Faside%2Fsection%5B2%5D%2Fdl%2Fdd%5B3%5D&logo=typst&label=universe&color=%2339cccc)](https://typst.app/universe/package/touying) +[![Book badge](https://img.shields.io/badge/docs-book-green)](https://touying-typ.github.io/) +[![Gallery badge](https://img.shields.io/badge/docs-gallery-orange)](https://github.com/touying-typ/touying/wiki) +![GitHub](https://img.shields.io/github/license/touying-typ/touying) +![GitHub release (latest by date)](https://img.shields.io/github/v/release/touying-typ/touying) +![GitHub Repo stars](https://img.shields.io/github/stars/touying-typ/touying) +![Themes badge](https://img.shields.io/badge/themes-6-aqua) + +## Document + +Read [the document](https://touying-typ.github.io/) to learn all about Touying. + +We will maintain **English** and **Chinese** versions of the documentation for Touying, and for each major version, we will maintain a documentation copy. This allows you to easily refer to old versions of the Touying documentation and migrate to new versions. + +**Note that the documentation may be outdated, and you can also use Tinymist to view Touying's annotated documentation by hovering over the code.** + +## Gallery + +Touying offers [a gallery page](https://github.com/touying-typ/touying/wiki) via wiki, where you can browse elegant slides created by Touying users. You're also encouraged to contribute your own beautiful slides here! + +## Special Features + +1. Split slides by headings [document](https://touying-typ.github.io/docs/sections) + +```typst += Section + +== Subsection + +=== First Slide + +Hello, Touying! + +=== Second Slide + +Hello, Typst! +``` + +2. `#pause` and `#meanwhile` animations [document](https://touying-typ.github.io/docs/dynamic/simple) + +```typst +#slide[ + First + + #pause + + Second + + #meanwhile + + Third + + #pause + + Fourth +] +``` + +![image](https://github.com/touying-typ/touying/assets/34951714/24ca19a3-b27c-4d31-ab75-09c37911e6ac) + +3. Math Equation Animation [document](https://touying-typ.github.io/docs/dynamic/equation) + +![image](https://github.com/touying-typ/touying/assets/34951714/8640fe0a-95e4-46ac-b570-c8c79f993de4) + +4. `touying-reducer` Cetz and Fletcher Animations [document](https://touying-typ.github.io/docs/dynamic/other) + +![image](https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc) + +5. Correct outline and bookmark (no duplicate and correct page number) + +![image](https://github.com/touying-typ/touying/assets/34951714/7b62fcaf-6342-4dba-901b-818c16682529) + +6. Dewdrop Theme Navigation Bar [document](https://touying-typ.github.io/docs/themes/dewdrop) + +![image](https://github.com/touying-typ/touying/assets/34951714/0426516d-aa3c-4b7a-b7b6-2d5d276fb971) + +7. Semi-transparent cover mode [document](https://touying-typ.github.io/docs/dynamic/cover) + +![image](https://github.com/touying-typ/touying/assets/34951714/22a9ea66-c8b5-431e-a52c-2c8ca3f18e49) + +8. Speaker notes for dual-screen [document](https://touying-typ.github.io/docs/external/pympress) + +![image](https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5) + +9. Export slides to PPTX and HTML formats and show presentation online. [touying-exporter](https://github.com/touying-typ/touying-exporter) [touying-template](https://github.com/touying-typ/touying-template) [online](https://touying-typ.github.io/touying-template/) + +![image](https://github.com/touying-typ/touying-exporter/assets/34951714/207ddffc-87c8-4976-9bf4-4c6c5e2573ea) + + +## Quick start + +Before you begin, make sure you have installed the Typst environment. If not, you can use the [Web App](https://typst.app/) or the [Tinymist LSP](https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist) extensions for VS Code. + +To use Touying, you only need to include the following code in your document: + +```typst +#import "@preview/touying:0.6.1": * +#import themes.simple: * + +#show: simple-theme.with(aspect-ratio: "16-9") + += Title + +== First Slide + +Hello, Touying! + +#pause + +Hello, Typst! +``` + +![image](https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2) + +It's simple. Congratulations on creating your first Touying slide! 🎉 + +**Tip:** You can use Typst syntax like `#import "config.typ": *` or `#include "content.typ"` to implement Touying's multi-file architecture. + + +## More Complex Examples + +In fact, Touying provides various styles for writing slides. For example, the above example uses first-level and second-level titles to create new slides. However, you can also use the `#slide[..]` format to access more powerful features provided by Touying. + +```typst +#import "@preview/touying:0.6.1": * +#import themes.university: * +#import "@preview/cetz:0.3.2" +#import "@preview/fletcher:0.5.4" as fletcher: node, edge +#import "@preview/numbly:0.1.0": numbly +#import "@preview/theorion:0.2.0": * +#import cosmos.clouds: * +#show: show-theorion + +// cetz and fletcher bindings for touying +#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) +#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) + +#show: university-theme.with( + aspect-ratio: "16-9", + // align: horizon, + // config-common(handout: true), + config-common(frozen-counters: (theorem-counter,)), // freeze theorem counter for animation + config-info( + title: [Title], + subtitle: [Subtitle], + author: [Authors], + date: datetime.today(), + institution: [Institution], + logo: emoji.school, + ), +) + +#set heading(numbering: numbly("{1}.", default: "1.1")) + +#title-slide() + +== Outline + +#components.adaptive-columns(outline(title: none, indent: 1em)) + += Animation + +== Simple Animation + +We can use `#pause` to #pause display something later. + +#pause + +Just like this. + +#meanwhile + +Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously. + +#speaker-note[ + + This is a speaker note. + + You won't see it unless you use `config-common(show-notes-on-second-screen: right)` +] + + +== Complex Animation + +At subslide #touying-fn-wrapper((self: none) => str(self.subslide)), we can + +use #uncover("2-")[`#uncover` function] for reserving space, + +use #only("2-")[`#only` function] for not reserving space, + +#alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. + + +== Callback Style Animation + +#slide( + repeat: 3, + self => [ + #let (uncover, only, alternatives) = utils.methods(self) + + At subslide #self.subslide, we can + + use #uncover("2-")[`#uncover` function] for reserving space, + + use #only("2-")[`#only` function] for not reserving space, + + #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. + ], +) + + +== Math Equation Animation + +Equation with `pause`: + +$ + f(x) &= pause x^2 + 2x + 1 \ + &= pause (x + 1)^2 \ +$ + +#meanwhile + +Here, #pause we have the expression of $f(x)$. + +#pause + +By factorizing, we can obtain this result. + + +== CeTZ Animation + +CeTZ Animation in Touying: + +#cetz-canvas({ + import cetz.draw: * + + rect((0, 0), (5, 5)) + + (pause,) + + rect((0, 0), (1, 1)) + rect((1, 1), (2, 2)) + rect((2, 2), (3, 3)) + + (pause,) + + line((0, 0), (2.5, 2.5), name: "line") +}) + + +== Fletcher Animation + +Fletcher Animation in Touying: + +#fletcher-diagram( + node-stroke: .1em, + node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), + spacing: 4em, + edge((-1, 0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), + node((0, 0), `reading`, radius: 2em), + edge((0, 0), (0, 0), `read()`, "--|>", bend: 130deg), + pause, + edge(`read()`, "-|>"), + node((1, 0), `eof`, radius: 2em), + pause, + edge(`close()`, "-|>"), + node((2, 0), `closed`, radius: 2em, extrude: (-2.5, 0)), + edge((0, 0), (2, 0), `close()`, "-|>", bend: -40deg), +) + + += Theorems + +== Prime numbers + +#definition[ + A natural number is called a #highlight[_prime number_] if it is greater + than 1 and cannot be written as the product of two smaller natural numbers. +] +#example[ + The numbers $2$, $3$, and $17$ are prime. + @cor_largest_prime shows that this list is not exhaustive! +] + +#theorem(title: "Euclid")[ + There are infinitely many primes. +] +#pagebreak(weak: true) +#proof[ + Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration + of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, + it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since + $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a + contradiction. +] + +#corollary[ + There is no largest prime number. +] +#corollary[ + There are infinitely many composite numbers. +] + +#theorem[ + There are arbitrarily long stretches of composite numbers. +] + +#proof[ + For any $n > 2$, consider $ + n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere + $ +] + + += Others + +== Side-by-side + +#slide(composer: (1fr, 1fr))[ + First column. +][ + Second column. +] + + +== Multiple Pages + +#lorem(200) + + +#show: appendix + += Appendix + +== Appendix + +Please pay attention to the current slide number. +``` + +![image](https://github.com/user-attachments/assets/b1dfc4d9-e263-46ff-8588-a0635870e370) + + +## Acknowledgements + +Thanks to... + +- [@andreasKroepelin](https://github.com/andreasKroepelin) for the `polylux` package +- [@enklht](https://github.com/enklht) for many fixes and improvements +- [@Enivex](https://github.com/Enivex) for the `metropolis` theme +- [@drupol](https://github.com/drupol) for the `university` theme +- [@pride7](https://github.com/pride7) for the `aqua` theme +- [@Coekjan](https://github.com/Coekjan) and [@QuadnucYard](https://github.com/QuadnucYard) for the `stargazer` theme +- [@ntjess](https://github.com/ntjess) for contributing to `fit-to-height`, `fit-to-width` and `cover-with-rect` + +## Poster + +![poster](https://github.com/user-attachments/assets/e1ddb672-8e8f-472d-b364-b8caed1da16b) + + +[View Code](https://github.com/touying-typ/touying-poster) + +## Star History + + + + + + Star History Chart + + \ No newline at end of file diff --git a/packages/preview/touying/0.6.1/changelog.md b/packages/preview/touying/0.6.1/changelog.md new file mode 100644 index 000000000..3d4598b55 --- /dev/null +++ b/packages/preview/touying/0.6.1/changelog.md @@ -0,0 +1,316 @@ +# Changelog + +## v0.6.1 + +Added support for the [theorion](https://github.com/OrangeX4/typst-theorion) package, and used it as the default math theorem environment. + +## v0.6.0 + +It's not a big update, but it's the first touying release since typst 0.13 was released. + +### Features + +- feat: add auto style for display-current-heading. + - For users, you can use `show heading: set text(blue)` to change color for heading in some themes like `dewdrop`. + - For theme creator, you can use syntax like `utils.display-current-heading(level: 1, style: auto)` to achieve the same result. +- feat: apply config-info information to `set document`. +- feat: set `stretch: false` by default for `alternatives` functions. This is **a minor breaking change**, but I think it would be more intuitive: no auto empty space. + +### Fixes + +- fix: fix error with uncover using semi-transparent-cover +- fix: fix type string comparison https://github.com/touying-typ/touying/pull/153 +- fix: fix horizontal-line bug in typst 0.13.0 +- refactor: fix display-current-short-heading + + +## v0.5.4 & v0.5.5 + +### Features + +- docs: improve param documentation and we have better hints for tinymist https://github.com/touying-typ/touying/pull/98 +- feat: fake frozon states support for `heading` https://github.com/touying-typ/touying/pull/124 +- feat: add alpha-changing-cover and color-changing-cover https://github.com/touying-typ/touying/pull/129 +- feat: add effect function https://github.com/touying-typ/touying/issues/111 + - Example: `#effect(text.with(fill: red), "2-")[Something]` will display `[Something]` if the current slide is 2 or later. +- feat: add argument `config: (..)` for `xxx-slide` functions +- feat: add `align` argument for university theme + +### Fixes + +- fix: also hide enum numbers with show-hide-set-list-marker-none https://github.com/touying-typ/touying/pull/114 +- fix: fixed progress bar not to break apart when global figure gutter is set nonzero https://github.com/touying-typ/touying/pull/120 +- fix: fixed frozen-counters bug with multiple #pause commands https://github.com/touying-typ/touying/pull/124 +- fix: fixed incorrect page num when draft is true https://github.com/touying-typ/touying/pull/125 +- fix: fix behaviors of fit-to-height and fit-to-width partially https://github.com/touying-typ/touying/pull/131 +- fix: duplicated footnotes in headings https://github.com/touying-typ/touying/pull/132 +- fix: do not hardcode page sizes https://github.com/touying-typ/touying/pull/134 +- fix: add default numbering for page https://github.com/touying-typ/touying/issues/100 +- refactor: move show-strong-with-alert to per-slide level https://github.com/touying-typ/touying/issues/123 +- refactor: remove unnecessary `config-page(fill: ...)` +- theme(metropolis): fix color of title page and fix https://github.com/touying-typ/touying/issues/103 +- theme(metropolis): fixed metropolis slide's header to return content if title is specified https://github.com/touying-typ/touying/pull/126 +- theme(metropolis): respect colors dict in metropolis theme https://github.com/touying-typ/touying/pull/133 +- fix: fix bug of `#effect` function + +Thanks for the contributions from [@enklht](https://github.com/enklht). + + +## v0.5.3 + +### Features + +- feat: add `stretch` parameter for `#alternatives[]` function class. This allows us to handle cases where the internal element is a context expression. +- feat: add `config-common(align-enum-marker-with-baseline: true)` for aligning the enum marker with the baseline. +- feat: add `linebreaks` option to `components.mini-slides`. https://github.com/touying-typ/touying/pull/96 +- feat: add `` label to skip a new-section-slide. +- feat: add `config-common(show-hide-set-list-marker-none: true)` to make the markers of `list` and `enum` invisible after `#pause`. +- feat: add `config-common(bibliography-as-footnote: bibliography(title: none, "ref.bib"))` to display the bibliography in footnotes. +- refactor: add `config-common(show-strong-with-alert: true)` configuration to display strong text with an alert. (small breaking change for some themes) +- refactor: refactor `display-current-heading` for preserving heading style in title and subtitle. https://github.com/touying-typ/touying/issues/71 +- refactor: make `new-section-slide-fn` function class can receive `body` parameter. We can use `receive-body-for-new-section-slide-fn` to control it. **(Breaking change)** + - For example, you can add `#speaker-note[]` for a new section slide, like `= Section Title \ #speaker-note[]`. + - If you don't want to append content to the body of the new section slide, you can use `---` after the section title. + +### Fixes + +- fix outdated documentation. +- fix bug of `enable-frozen-states-and-counters` in handout mode. +- fix unusable `square()` function. https://github.com/touying-typ/touying/issues/73 +- fix hidden footer for `show-notes-on-second-screen: bottom`. https://github.com/touying-typ/touying/issues/89 +- fix metadata element in table cells. https://github.com/touying-typ/touying/issues/77 https://github.com/touying-typ/touying/issues/95 +- fix `auto-offset-for-heading` to `false` by default. +- fix uncover/only hides more content than it should. https://github.com/touying-typ/touying/issues/85 +- theme(simple): fix wrong title and subtitle. https://github.com/touying-typ/touying/issues/70 + + +## v0.5.1 & v0.5.2 + +- Fix somg bugs. + + +## v0.5.0 + +This is a significant disruptive version update. Touying has removed many mistakes that resulted from incorrect decisions. We have redesigned numerous features. The goal of this version is to make Touying more user-friendly, more flexible, and more powerful. + +**Major changes include:** + +- Avoiding closures and OOP syntax, which makes Touying's configuration simpler and allows for the use of document comments to provide more auto-completion information for the slide function. + - The existing `#let slide(self: none, ..args) = { .. }` is now `#let slide(..args) = touying-slide-wrapper(self => { .. })`, where `self` is automatically injected. + - We can use `config-xxx` syntax to configure Touying, for example, `#show: university-theme.with(aspect-ratio: "16-9", config-colors(primary: blue))`. +- The `touying-slide` function no longer includes parameters like `section`, `subsection`, and `title`. These will be automatically inserted into the slide as invisible level 1, 2, or 3 headings via `self.headings` (controlled by the `slide-level` configuration). + - We can leverage the powerful headings provided by Typst to support numbering, outlines, and bookmarks. + - Headings within the `#slide[= XXX]` function will be adjusted to level `slide-level + 1` using the `offset` parameter. + - We can use labels on headings to control many aspects, such as supporting the `` and other special labels, implementing short headings, or recalling a slide with `#touying-recall()`. +- Touying now supports the normal use of `set` and `show` rules at any position, without requiring them to be in specific locations. + +A simple usage example is shown below, and more examples can be found in the `examples` directory: + +```typst +#import "@preview/touying:0.5.0": * +#import themes.university: * + +#show: university-theme.with( + aspect-ratio: "16-9", + config-info( + title: [Title], + subtitle: [Subtitle], + author: [Authors], + date: datetime.today(), + institution: [Institution], + logo: emoji.school, + ), +) + +#set heading(numbering: "1.1") + +#title-slide() + += The Section + +== Slide Title + +#lorem(40) +``` + +**Theme Migration Guide:** + +For detailed changes to specific themes, you can refer to the `themes` directory. Generally, if you want to migrate an existing theme, you should: + +1. Rename the `register` function to `xxx-theme` and remove the `self` parameter. +2. Add a `show: touying-slides.with(..)` configuration. + - Change `self.methods.colors` to `config-colors(primary: rgb("#xxxxxx"))`. + - Change `self.page-args` to `config-page()`. + - Change `self.methods.slide = slide` to `config-methods(slide: slide)`. + - Change `self.methods.new-section-slide = new-section-slide` to `config-methods(new-section-slide: new-section-slide)`. + - Change private theme variables like `self.xxx-footer` to `config-store(footer: [..])`, which you can access through `self.store.footer`. + - Move the configuration of headers and footers into the `slide` function rather than in the `xxx-theme` function. + - You can directly use `set` or `show` rules in `xxx-theme` or configure them through `config-methods(init: (self: none, body) => { .. })` to fully utilize the `self` parameter. +3. For `states.current-section-with-numbering`, you can use `utils.display-current-heading(level: 1)` instead. + - If you only need the previous heading regardless of whether it is a section or a subsection, use `self => utils.display-current-heading(depth: self.slide-level)`. +4. The `alert` function can be replaced with `config-methods(alert: utils.alert-with-primary-color)`. +5. The `touying-outline()` function is no longer needed; you can use `components.adaptive-columns(outline())` instead. Consider using `components.progressive-outline()` or `components.custom-progressive-outline()`. +6. Replace `states.slide-counter.display() + " / " + states.last-slide-number` with `context utils.slide-counter.display() + " / " + utils.last-slide-number`. That is, we no longer use `states` but `utils`. +7. Remove the `slides` function; we no longer need this function. Instead of implicitly injecting `title-slide()`, explicitly use `#title-slide()`. If necessary, consider adding it in the `xxx-theme` function. +8. Change `#let slide(self: none, ..args) = { .. }` to `#let slide(..args) = touying-slide-wrapper(self => { .. })`, where `self` is automatically injected. + - Change specific parameter configurations to `self = utils.merge-dicts(self, config-page(fill: self.colors.neutral-lightest))`. + - Remove `self = utils.empty-page(self)` and use `config-common(freeze-slide-counter: true)` and `config-page(margin: 0em)` instead. + - Change `(self.methods.touying-slide)()` to `touying-slide()`. +9. You can insert visible headings into slides by configuring `config-common(subslide-preamble: self => text(1.2em, weight: "bold", utils.display-current-heading(depth: self.slide-level)))`. +10. Finally, don't forget to add document comments to your functions so your users can get better auto-completion hints, especially when using the Tinymist plugin. + +**Other Changes:** + +- theme(stargazer): new stargazer theme modified from [Coekjan/touying-buaa](https://github.com/Coekjan/touying-buaa). +- feat: implemented fake frozen states support, allowing you to use numbering and `#pause` normally. This behavior can be controlled with `enable-frozen-states-and-counters`, `frozen-states`, and `frozen-counters` in `config-common()`. +- feat: implemented `label-only-on-last-subslide` functionality to prevent non-unique label warnings when working with `@equation` and `@figure` in conjunction with `#pause` animations. +- feat: added the `touying-recall(