diff --git a/docs/docs/build-your-own-theme.md b/docs/docs/build-your-own-theme.md index de2b6a586..4ad1326ba 100644 --- a/docs/docs/build-your-own-theme.md +++ b/docs/docs/build-your-own-theme.md @@ -18,6 +18,28 @@ Creating your own theme with Touying might seem a bit complex initially due to t To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps. + +## Modifying Existing Themes + +If you wish to modify a theme within the Touying package locally instead of creating one from scratch, you can achieve this by following these steps: + +1. Copy the [theme code](https://github.com/touying-typ/touying/tree/main/themes) from the `themes` directory to your local machine. For example, copy `themes/university.typ` to a local file named `university.typ`. +2. Remove all `#import "../xxx.typ"` commands at the top of the `university.typ` file. +3. Add `#import "@preview/touying:0.3.3": *` at the top of the `university.typ` file to import all modules. +4. Replace `self: s` in the `register` function with `self: themes.default.register()` **(Important)**. + +You can then import and use the theme by: + +```typst +#import "@preview/touying:0.3.3": * +#import "university.typ" + +#let s = university.register(aspect-ratio: "16-9") +``` + +For a specific example, refer to: [https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx](https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx) + + ## Import Depending on whether the theme is for personal use or part of Touying, you can import in two ways: @@ -25,7 +47,7 @@ Depending on whether the theme is for personal use or part of Touying, you can i If for personal use: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * ``` If part of Touying themes: @@ -51,7 +73,7 @@ Generally, the first step in creating slides is to determine font size and page ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let register( self: themes.default.register(), @@ -68,7 +90,7 @@ Generally, the first step in creating slides is to determine font size and page } // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") @@ -77,7 +99,7 @@ Generally, the first step in creating slides is to determine font size and page #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -168,7 +190,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -230,7 +252,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -239,7 +261,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -269,7 +291,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. ``` // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -386,7 +408,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -403,7 +425,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. #show strong: alert -#let (slide, title-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s) #show: slides = First Section diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index be5613796..1185b1bbb 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -4,6 +4,14 @@ sidebar_position: 14 # Changelog +## v0.3.3 + +- **template:** move template to `touying-aqua` package, make Touying searchable in [Typst Universe Packages](https://typst.app/universe/search?kind=packages) +- **themes:** fix bugs in university and dewdrop theme +- **feat:** make set-show rule work without `setting` parameter +- **feat:** make `composer` parameter more simpler +- **feat:** add `empty-slide` function + ## v0.3.2 - **fix critical bug:** fix `is-sequence` function, make `grid` and `table` work correctly in touying diff --git a/docs/docs/code-styles.md b/docs/docs/code-styles.md index a2ba82954..4048191c5 100644 --- a/docs/docs/code-styles.md +++ b/docs/docs/code-styles.md @@ -9,13 +9,13 @@ sidebar_position: 4 If we only need simplicity, we can directly input content under the heading, just like writing a normal Typst document. The heading here serves to divide the pages, and we can use commands like `#pause` to achieve animation effects. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -37,18 +37,18 @@ PS: We can use the `#slides-end` marker to signify the end of `#show: slides`. ## Block Style -Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of `#slide[...]`. The `#slide` function needs to be unpacked using the syntax `#let (slide,) = utils.slides(s)` to be used correctly after `#show: slides`. +Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of `#slide[...]`. The `#slide` function needs to be unpacked using the syntax `#let (slide, empty-slide) = utils.slides(s)` to be used correctly after `#show: slides`. For example, the previous example can be transformed into: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -64,6 +64,8 @@ For example, the previous example can be transformed into: ] ``` +and `#empty-slide[]` to create an empty slide without header and footer. + There are many advantages to doing this: 1. Many times, we not only need the default `#slide[...]` but also special `slide` functions like `#focus-slide[...]`. @@ -78,14 +80,14 @@ You may have noticed that when using the simple theme, using a level-one heading If we don't want it to automatically create such a section slide, we can delete this method: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = none) #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -106,7 +108,7 @@ As you can see, there are only two pages left, and the default section slide is Similarly, we can register a new section slide: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = (self: none, section, ..args) => { @@ -120,7 +122,7 @@ Similarly, we can register a new section slide: #let (init, slides, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -147,7 +149,7 @@ Also, since `#slide[...]` is registered in `s.slides = ("slide",)`, the `section In fact, you can also not use `#show: slides` and `utils.slides(s)`, but only use `utils.methods(s)`, for example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, touying-outline, slide) = utils.methods(s) diff --git a/docs/docs/dynamic/other.md b/docs/docs/dynamic/other.md index 026d6466c..dcbd5199f 100644 --- a/docs/docs/dynamic/other.md +++ b/docs/docs/dynamic/other.md @@ -11,7 +11,7 @@ Touying also provides `touying-reducer`, which adds `pause` and `meanwhile` anim Here's an example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Here's an example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/docs/dynamic/simple.md b/docs/docs/dynamic/simple.md index a373bbc2c..8a30a1ff8 100644 --- a/docs/docs/dynamic/simple.md +++ b/docs/docs/dynamic/simple.md @@ -52,28 +52,9 @@ In some cases, you may need to display additional content simultaneously with `# This example will create only two subslides, with "First" and "Third" displayed simultaneously, and "Second" and "Fourth" displayed simultaneously. -## Handling set-show rules +## Handling layout functions -If you use set-show rules inside `slide[..]`, you might be surprised to find that subsequent `#pause` and `#meanwhile` do not work. This is because Touying cannot detect the content inside `styled(..)` (content after set-show rules is encompassed by `styled`). - -To address this issue, Touying provides a `setting` parameter for the `#slide()` function. You can place your set-show rules in the `setting` parameter. For example, changing the font color: - -```typst -#slide(setting: body => { - set text(fill: blue) - body -})[ - First - - #pause - - Second -] -``` - -![image](https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff) - -Similarly, Touying currently does not support `#pause` and `#meanwhile` inside layout functions like `grid`. This is due to the same limitation, but you can use the `composer` parameter of `#slide()` to meet most requirements. +If you use layout functions like `grid` inside `slide[..]`, you might be surprised to find that subsequent `#pause` and `#meanwhile` do not work. This is because Touying cannot detect the content inside layout functions. But you can use the `composer` parameter of `#slide()` to meet most requirements. :::tip[Internals] diff --git a/docs/docs/external/pdfpc.md b/docs/docs/external/pdfpc.md index 58c06f85d..d5503a7fb 100644 --- a/docs/docs/external/pdfpc.md +++ b/docs/docs/external/pdfpc.md @@ -52,7 +52,7 @@ typst query --root . ./example.typ --field value --one "" > ./exampl With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code: ```typst -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` \ No newline at end of file diff --git a/docs/docs/global-settings.md b/docs/docs/global-settings.md index 8caf9dc1a..82fd6e031 100644 --- a/docs/docs/global-settings.md +++ b/docs/docs/global-settings.md @@ -32,7 +32,7 @@ If you are not a theme creator but want to add your own global styles to your sl #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -117,7 +117,7 @@ Now you can understand the purpose of the `utils.methods()` function: to bind `s In general, the two ways mentioned above are sufficient for adding global settings. However, there are still situations where we need to initialize counters or states. If you place this code before `#show: slides`, a blank page will be created, which is something we don't want to see. In such cases, you can use the `s.methods.append-preamble` method. For example, when using the codly package: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -131,7 +131,7 @@ In general, the two ways mentioned above are sufficient for adding global settin #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/docs/integration/cetz.md b/docs/docs/integration/cetz.md index 2ceecbc57..747a1a095 100644 --- a/docs/docs/integration/cetz.md +++ b/docs/docs/integration/cetz.md @@ -11,7 +11,7 @@ Touying provides the `touying-reducer`, which adds `pause` and `meanwhile` anima An example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ An example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/docs/integration/codly.md b/docs/docs/integration/codly.md index 636011d15..fc052318c 100644 --- a/docs/docs/integration/codly.md +++ b/docs/docs/integration/codly.md @@ -7,7 +7,7 @@ sidebar_position: 5 When using Codly, we should initialize it using the `s.methods.append-preamble` method. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -21,7 +21,7 @@ When using Codly, we should initialize it using the `s.methods.append-preamble` #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/docs/integration/fletcher.md b/docs/docs/integration/fletcher.md index 5766ac984..eba52f0c1 100644 --- a/docs/docs/integration/fletcher.md +++ b/docs/docs/integration/fletcher.md @@ -9,7 +9,7 @@ Touying provides the `touying-reducer`, which adds `pause` and `meanwhile` anima An example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -20,7 +20,7 @@ An example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/docs/integration/pinit.md b/docs/docs/integration/pinit.md index 4281c6956..42c6d39c1 100644 --- a/docs/docs/integration/pinit.md +++ b/docs/docs/integration/pinit.md @@ -34,7 +34,7 @@ Another [example](https://github.com/OrangeX4/typst-pinit/blob/main/examples/equ An example of shared usage with Touying: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/pinit:0.1.3": * #(s.page-args.paper = "presentation-4-3") @@ -58,7 +58,7 @@ An example of shared usage with Touying: body } -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides // Main body diff --git a/docs/docs/integration/polylux.md b/docs/docs/integration/polylux.md index c439fd82c..947eb965b 100644 --- a/docs/docs/integration/polylux.md +++ b/docs/docs/integration/polylux.md @@ -7,7 +7,7 @@ sidebar_position: 6 With the compatibility between Touying and Polylux, you can make Polylux support direct export as well. Just add the following code to your Polylux source code: ```typst -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` diff --git a/docs/docs/layout.md b/docs/docs/layout.md index 9da184a92..619d9e698 100644 --- a/docs/docs/layout.md +++ b/docs/docs/layout.md @@ -112,7 +112,7 @@ Similarly, if you are not satisfied with the header or footer style of a theme, #(s.page-args.footer = [Custom Footer]) ``` -to replace it. However, please note that if you replace the page parameters in this way, you need to place it before `#let (slide,) = utils.slides(s)`, or you need to call `#let (slide,) = utils.slides(s)` again. +to replace it. However, please note that if you replace the page parameters in this way, you need to place it before `#let (slide, empty-slide) = utils.slides(s)`, or you need to call `#let (slide, empty-slide) = utils.slides(s)` again. :::warning[Warning] @@ -129,7 +129,7 @@ Adding a logo to slides is a very common but also a very versatile requirement. For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/octique:0.1.0": * #let s = themes.metropolis.register(aspect-ratio: "16-9") @@ -170,7 +170,7 @@ If you need to divide the page into two or three columns, you can use the `compo If you need to change the way columns are composed, you can modify the `composer` parameter of `slide`. The default parameter is `utils.with.side-by-side(columns: auto, gutter: 1em)`. If we want the left column to occupy the remaining width, we can use ```typst -#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[ +#slide(composer: (1fr, auto))[ First column. ][ Second column. diff --git a/docs/docs/progress/counters.md b/docs/docs/progress/counters.md index 5bf50b8bc..d3a2b8b17 100644 --- a/docs/docs/progress/counters.md +++ b/docs/docs/progress/counters.md @@ -33,7 +33,7 @@ You can use ```typst // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.methods(s) +#let (slide, empty-slide) = utils.methods(s) #slide[ appendix diff --git a/docs/docs/sections.md b/docs/docs/sections.md index c1a9a94ca..6810650ef 100644 --- a/docs/docs/sections.md +++ b/docs/docs/sections.md @@ -11,13 +11,13 @@ Similar to Beamer, Touying also has the concept of sections and subsections. Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -34,13 +34,13 @@ Hello, Touying! However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -59,13 +59,13 @@ In fact, we can control this behavior through the `slide-level` parameter of the Displaying a table of contents in Touying is straightforward: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides, alert, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(slide-level: 2) = Section diff --git a/docs/docs/start.md b/docs/docs/start.md index 4d76c3823..3fe5178d4 100644 --- a/docs/docs/start.md +++ b/docs/docs/start.md @@ -9,13 +9,13 @@ Before you begin, make sure you have the Typst environment installed. If not, yo To use Touying, you just need to include the following in your document: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -35,7 +35,7 @@ It's that simple! You've created your first Touying slides. Congratulations! **Tip:** You can use Typst syntax like `#import "config.typ": *` or `#include "content.typ"` to implement Touying's multi-file architecture. -**Warning:** The comma in `#let (slide,) = utils.slides(s)` is necessary for the unpacking syntax. +**Warning:** The comma in `#let (slide, empty-slide) = utils.slides(s)` is necessary for the unpacking syntax. ## More Complex Examples @@ -52,7 +52,7 @@ Touying offers many built-in themes to easily create beautiful slides. For examp you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -100,7 +100,7 @@ you can use the university theme. For more detailed tutorials on themes, you can #show strong: alert // Extract slide functions -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Animation @@ -207,14 +207,6 @@ you can use the university theme. For more detailed tutorials on themes, you can Second column. ] -== Setting - -#slide(setting: body => { - set text(fill: blue) - body -})[ - This slide has blue text. -] == Multiple Pages @@ -225,7 +217,7 @@ you can use the university theme. For more detailed tutorials on themes, you can // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) == Appendix diff --git a/docs/docs/themes/aqua.md b/docs/docs/themes/aqua.md index d3262a40e..7042570cb 100644 --- a/docs/docs/themes/aqua.md +++ b/docs/docs/themes/aqua.md @@ -13,7 +13,7 @@ This theme is created by [@pride7](https://github.com/pride7), featuring beautif You can initialize it with the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -29,7 +29,7 @@ You can initialize it with the following code: #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: The outline title can be modified via `#(s.outline-title = [Outline])`. Additionally, you can disable the automatic inclusion of `new-section-slide` functionality by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -140,7 +140,7 @@ Additionally, you can disable the automatic inclusion of `new-section-slide` fun #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -159,7 +159,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -175,7 +175,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = The Section diff --git a/docs/docs/themes/dewdrop.md b/docs/docs/themes/dewdrop.md index 0aee7bb74..88300afd3 100644 --- a/docs/docs/themes/dewdrop.md +++ b/docs/docs/themes/dewdrop.md @@ -15,7 +15,7 @@ The Dewdrop theme features an elegantly designed navigation, including two modes You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -37,7 +37,7 @@ You can initialize it using the following code: #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -152,7 +152,7 @@ PS: You can modify the outline title using `#(s.outline-title = [Outline])`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( @@ -168,7 +168,7 @@ And the function of automatically adding `new-section-slide` can be turned off b #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -188,7 +188,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -209,7 +209,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Section A @@ -256,7 +256,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/docs/themes/metropolis.md b/docs/docs/themes/metropolis.md index 1b8f88655..f738b97d4 100644 --- a/docs/docs/themes/metropolis.md +++ b/docs/docs/themes/metropolis.md @@ -15,7 +15,7 @@ The Metropolis theme is elegant and suitable for everyday use. It is recommended You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -31,7 +31,7 @@ You can initialize it using the following code: #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: You can modify the outline title using `#(s.outline-title = [Outline])`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -160,7 +160,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -180,7 +180,7 @@ Hello, Typst! #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = First Section @@ -217,7 +217,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/docs/themes/simple.md b/docs/docs/themes/simple.md index 25cf40a0b..a060dfa9f 100644 --- a/docs/docs/themes/simple.md +++ b/docs/docs/themes/simple.md @@ -15,14 +15,14 @@ Considered a relatively straightforward theme, you can use it to create simple s You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -96,14 +96,14 @@ You can set it using `#show: slides.with(..)`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -123,13 +123,13 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides #title-slide[ diff --git a/docs/docs/themes/university.md b/docs/docs/themes/university.md index 78073ce13..f058f6b41 100644 --- a/docs/docs/themes/university.md +++ b/docs/docs/themes/university.md @@ -13,7 +13,7 @@ This aesthetically pleasing theme is courtesy of [Pol Dellaiera](https://github. You can initialize the University theme using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -27,7 +27,7 @@ You can initialize the University theme using the following code: #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides ``` @@ -35,6 +35,7 @@ The `register` function accepts the following parameters: - `aspect-ratio`: Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9." - `progress-bar`: Controls whether the progress bar at the top of each slide is displayed, with the default being `true`. +- `display-current-section`: Whether to display the current section. - `footer-columns`: The width of the footer in the bottom three columns, the default is `(25%, 1fr, 25%)`. - `footer-a`: The first column, default is `self => self.info.author`. - `footer-b`: Second column, default is `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`. @@ -134,7 +135,7 @@ You can set these parameters using `#show: slides.with(..)`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -148,7 +149,7 @@ And the function of automatically adding `new-section-slide` can be turned off b #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides = Title @@ -168,7 +169,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -182,7 +183,7 @@ Hello, Typst! #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides.with(title-slide: false) #title-slide(authors: ([Author A], [Author B])) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md index 04c32c54d..2491331c8 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md @@ -19,6 +19,29 @@ sidebar_position: 10 为了演示如何使用 Touying 创建一个自己的主题,我们不妨来一步一步地创建一个简洁美观的 Bamboo 主题。 +## 修改已有主题 + +如果你想在本地修改一个 Touying 内部的 themes,而不是自己从零开始创建,你可以选择通过下面的方式实现: + +1. 将 `themes` 目录下的 [主题代码](https://github.com/touying-typ/touying/tree/main/themes) 复制到本地,例如将 `themes/university.typ` 复制到本地 `university.typ` 中。 +2. 将 `university.typ` 文件顶部的 `#import "../xxx.typ"` 命令全部移除。 +3. 向 `university.typ` 文件顶部中加入 `#import "@preview/touying:0.3.3": *` 来导入所有模块。 +4. 将 `register` 函数中的 `self: s` 替换成 `self: themes.default.register()` **(重要)**。 + +然后就可以通过 + +```typst +#import "@preview/touying:0.3.3": * +#import "university.typ" + +#let s = university.register(aspect-ratio: "16-9") +``` + +的方式导入和使用主题了。 + +一个具体的示例:https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx + + ## 导入 取决于这个主题是你自己的,还是 Touying 的一部分,你可以用两种方式导入: @@ -26,7 +49,7 @@ sidebar_position: 10 如果只是你自己使用,你可以直接导入 Touying: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * ``` 如果你希望这个主题作为 Touying 的一部分,放置在 Touying `themes` 目录下,那你应该将上面的导入语句改为 @@ -52,7 +75,7 @@ sidebar_position: 10 ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let register( self: themes.default.register(), @@ -69,7 +92,7 @@ sidebar_position: 10 } // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") @@ -78,7 +101,7 @@ sidebar_position: 10 #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -176,7 +199,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -238,7 +261,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -247,7 +270,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -276,7 +299,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) ``` // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -393,7 +416,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -410,7 +433,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) #show strong: alert -#let (slide, title-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s) #show: slides = First Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/changelog.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/changelog.md index c6da68654..1976d631c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/changelog.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/changelog.md @@ -4,6 +4,14 @@ sidebar_position: 14 # 更新日志 +## v0.3.3 + +- **template:** move template to `touying-aqua` package, make Touying searchable in [Typst Universe Packages](https://typst.app/universe/search?kind=packages) +- **themes:** fix bugs in university and dewdrop theme +- **feat:** make set-show rule work without `setting` parameter +- **feat:** make `composer` parameter more simpler +- **feat:** add `empty-slide` function + ## v0.3.2 - **fix critical bug:** fix `is-sequence` function, make `grid` and `table` work correctly in touying diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md index 2b4a4d74c..1a06f2eb4 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md @@ -9,13 +9,13 @@ sidebar_position: 4 如果我们只是需要简单使用,我们可以直接在标题下输入内容,就像是在编写正常 Typst 文档一样。这里的标题有着分割页面的作用,同时我们也能正常地使用 `#pause` 等命令实现动画效果。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -38,18 +38,18 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 ## 块风格 -很多时候,仅仅使用简单风格并不能实现我们需要的所有功能,为了更强大的功能和更清晰的结构,我们同样可以使用 `#slide[...]` 形式的块风格,其中 `#slide` 函数需要使用 `#let (slide,) = utils.slides(s)` 语法进行解包,才能正常在 `#show: slides` 后使用。 +很多时候,仅仅使用简单风格并不能实现我们需要的所有功能,为了更强大的功能和更清晰的结构,我们同样可以使用 `#slide[...]` 形式的块风格,其中 `#slide` 函数需要使用 `#let (slide, empty-slide) = utils.slides(s)` 语法进行解包,才能正常在 `#show: slides` 后使用。 例如上面的例子就可以改造成 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -65,6 +65,8 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 ] ``` +以及 `#empty-slide[]` 可以创建一个没有 header 和 footer 的空 Slide。 + 这样做的好处有很多: 1. 很多时候,我们不只是需要默认的 `#slide[...]`,还需要 `#focus-slide[...]` 这些特殊的 `slide` 函数; @@ -80,14 +82,14 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 如果我们不希望它自动创建这样一个 section slide,我们可以将这个方法删除: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = none) #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -108,7 +110,7 @@ Hello, Typst! 同理,我们也可以注册一个新的 section slide: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = (self: none, section, ..args) => { @@ -122,7 +124,7 @@ Hello, Typst! #let (init, slides, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -149,7 +151,7 @@ Hello, Typst! 实际上,你也可以不使用 `#show: slides` 和 `utils.slides(s)`,而是只使用 `utils.methods(s)`,例如 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, touying-outline, slide) = utils.methods(s) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md index 4dffa801f..fa97fbe89 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md @@ -11,7 +11,7 @@ Touying 还提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pau 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Touying 还提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pau #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md index ec3c3ae20..a0f38262e 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md @@ -56,27 +56,7 @@ Touying 为简单的动画效果提供了两个标记:`#pause` 和 `#meanwhile ## 如何处理 set-show rules? -如果你在 `slide[..]` 里面使用了 set-show rules,你会惊讶的发现,在那之后的 `#pause` 和 `#meanwhile` 都失效了。这是因为 Touying 无法探知 `styled(..)` 内部的内容(set-show rules 后的内容会被 `styled` 囊括起来)。 - -为了解决这个问题,Touying 为 `#slide()` 函数提供了一个 `setting` 参数,你可以将你的 set-show rules 放到 `setting` 参数里,例如修改字体颜色: - -```typst -#slide(setting: body => { - set text(fill: blue) - body -})[ - First - - #pause - - Second -] -``` - -![image](https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff) - - -同理,Touying 目前也不支持 `grid` 这类 layout 函数内部的 `#pause` 和 `#meanwhile`,也是由于同样的限制,但是你可以使用 `#slide()` 的 `composer` 参数,大部分情况下都应该能满足需求。 +如果你在 `slide[..]` 里面使用了像 `grid` 这类 layout 函数,你会惊讶地发现其内部的 `#pause` 和 `#meanwhile` 失效了。但是你可以使用 `#slide()` 的 `composer` 参数来布局,大部分情况下都应该能满足需求。 :::tip[原理] diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md index 773489fd6..bcae36d29 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md @@ -54,7 +54,7 @@ typst query --root . ./example.typ --field value --one "" > ./exampl 借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要加入下面的代码即可。 ``` -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md index bc668049c..9548fe2b8 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md @@ -32,7 +32,7 @@ self.methods.init = (self: none, body) => { #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -117,7 +117,7 @@ Title is #s.info.title 一般而言,上面的两种方式就已经足够用于加入全局设置了,但是仍然会有部分情况,我们需要初始化 counters 或 states。如果将这些代码放在 `#show: slides` 之前,就会创建一个空白页,这是我们不想看见的,因此这时候我们就可以使用 `s.methods.append-preamble` 方法。例如在使用 codly 包的时候: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -131,7 +131,7 @@ Title is #s.info.title #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md index c1fc6fc97..a885c9f46 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md @@ -11,7 +11,7 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause` 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause` #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md index a9de5c758..0a65a7712 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md @@ -7,7 +7,7 @@ sidebar_position: 5 在使用 codly 的时候,我们应该使用 `s.methods.append-preamble` 方法进行初始化。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -21,7 +21,7 @@ sidebar_position: 5 #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md index 7c455d031..6693cc57c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md @@ -9,7 +9,7 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -20,7 +20,7 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md index 08589d2e1..d6210ddfe 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md @@ -36,7 +36,7 @@ A simple #pin(1)highlighted text#pin(2). 一个与 Touying 共同使用的示例: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/pinit:0.1.3": * #(s.page-args.paper = "presentation-4-3") @@ -60,7 +60,7 @@ A simple #pin(1)highlighted text#pin(2). body } -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides // Main body diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/polylux.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/polylux.md index 9f316a308..b12b5014c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/polylux.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/integration/polylux.md @@ -7,7 +7,7 @@ sidebar_position: 6 借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要在你的 Polylux 源代码中加入下面的代码即可。 ``` -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/layout.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/layout.md index 6d79bcb80..17d9e9307 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/layout.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/layout.md @@ -112,7 +112,7 @@ sidebar_position: 5 #(s.page-args.footer = [Custom Footer]) ``` -这样方式进行更换。不过需要注意的是,如果这样更换了页面参数,你需要将其放在 `#let (slide,) = utils.slides(s)` 之前,否则就需要重新调用 `#let (slide,) = utils.slides(s)`。 +这样方式进行更换。不过需要注意的是,如果这样更换了页面参数,你需要将其放在 `#let (slide, empty-slide) = utils.slides(s)` 之前,否则就需要重新调用 `#let (slide, empty-slide) = utils.slides(s)`。 :::warning[警告] @@ -129,7 +129,7 @@ sidebar_position: 5 例如,我们决定给 metropolis 主题加入 GitHub 的图标,我们可以这样实现: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/octique:0.1.0": * #let s = themes.metropolis.register(aspect-ratio: "16-9") @@ -170,7 +170,7 @@ sidebar_position: 5 如果你需要更改分栏的方式,可以修改 `slide` 的 `composer` 参数,其中默认的参数是 `utils.with.side-by-side(columns: auto, gutter: 1em)`,如果我们要让左边那一栏占据剩余宽度,可以使用 ```typst -#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[ +#slide(composer: (1fr, auto))[ First column. ][ Second column. diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/progress/counters.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/progress/counters.md index 3ce28cf1f..dee182aca 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/progress/counters.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/progress/counters.md @@ -36,7 +36,7 @@ Touying 的状态均放置于 `states` 命名空间下,包括所有的计数 ```typst // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.methods(s) +#let (slide, empty-slide) = utils.methods(s) #slide[ appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/sections.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/sections.md index 22b7a9995..b4fcd729d 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/sections.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/sections.md @@ -11,13 +11,13 @@ sidebar_position: 3 一般而言,1 级、2 级和 3 级标题分别用来对应 section、subsection 和 title,例如 dewdrop 主题。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -34,13 +34,13 @@ Hello, Touying! 但是很多时候我们并不需要 subsection,因此也会使用 1 级和 2 级标题来分别对应 section 和 title,例如 university 主题。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -60,13 +60,13 @@ Hello, Touying! 在 Touying 中显示目录很简单: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides, alert, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(slide-level: 2) = Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/start.md index 518c0b9ca..074796b19 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/start.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/start.md @@ -9,13 +9,13 @@ sidebar_position: 2 要使用 Touying,您只需要在文档里加入 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -35,14 +35,14 @@ Hello, Typst! **提示:** 你可以使用 `#import "config.typ": *` 或 `#include "content.typ"` 等 Typst 语法来实现 Touying 的多文件架构。 -**警告:** `#let (slide,) = utils.slides(s)` 里的逗号对于解包语法来说是必要的! +**警告:** `#let (slide, empty-slide) = utils.slides(s)` 里的逗号对于解包语法来说是必要的! ## 更复杂的例子 事实上,Touying 提供了多种 slides 编写风格,实际上您也可以使用 `#slide[..]` 的写法,以获得 Touying 提供的更多更强大的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -90,7 +90,7 @@ Hello, Typst! #show strong: alert // Extract slide functions -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Animation @@ -202,16 +202,6 @@ Hello, Typst! ] -== Setting - -#slide(setting: body => { - set text(fill: blue) - body -})[ - This slide has blue text. -] - - == Multiple Pages #slide[ @@ -221,7 +211,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) == Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md index f67661b78..e556fa3d3 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md @@ -14,7 +14,7 @@ sidebar_position: 5 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -30,7 +30,7 @@ sidebar_position: 5 #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -123,7 +123,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -139,7 +139,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -176,7 +176,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = The Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md index 62b1a201e..025d5b1f7 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md @@ -15,7 +15,7 @@ sidebar_position: 3 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -37,7 +37,7 @@ sidebar_position: 3 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -152,7 +152,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( @@ -168,7 +168,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -188,7 +188,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -209,7 +209,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Section A @@ -256,7 +256,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md index af8f553a8..0f46ee448 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md @@ -17,7 +17,7 @@ sidebar_position: 2 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -33,7 +33,7 @@ sidebar_position: 2 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -160,7 +160,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -180,7 +180,7 @@ Hello, Typst! #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = First Section @@ -217,7 +217,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md index 3664be472..eb27c093d 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md @@ -16,14 +16,14 @@ sidebar_position: 1 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -96,14 +96,14 @@ simple 主题提供了一系列自定义 slide 函数: 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -123,13 +123,13 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides #title-slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md index 3ceb16895..7b4ede217 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md @@ -13,7 +13,7 @@ sidebar_position: 4 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -27,7 +27,7 @@ sidebar_position: 4 #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides ``` @@ -35,6 +35,7 @@ sidebar_position: 4 - `aspect-ratio`: 幻灯片的长宽比为 "16-9" 或 "4-3",默认为 "16-9"。 - `progress-bar`: 是否显示 slide 顶部的进度条,默认为 `true`。 +- `display-current-section`: 是否显示当前节标题。 - `footer-columns`: 底部三栏 Footer 的宽度,默认为 `(25%, 1fr, 25%)`。 - `footer-a`: 第一栏,默认为 `self => self.info.author`。 - `footer-b`: 第二栏,默认为 `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`。 @@ -137,7 +138,7 @@ University 主题提供了一系列自定义 slide 函数: 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -151,7 +152,7 @@ University 主题提供了一系列自定义 slide 函数: #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides = Title @@ -171,7 +172,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -185,7 +186,7 @@ Hello, Typst! #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides.with(title-slide: false) #title-slide(authors: ([Author A], [Author B])) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/build-your-own-theme.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/build-your-own-theme.md index 04c32c54d..2491331c8 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/build-your-own-theme.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/build-your-own-theme.md @@ -19,6 +19,29 @@ sidebar_position: 10 为了演示如何使用 Touying 创建一个自己的主题,我们不妨来一步一步地创建一个简洁美观的 Bamboo 主题。 +## 修改已有主题 + +如果你想在本地修改一个 Touying 内部的 themes,而不是自己从零开始创建,你可以选择通过下面的方式实现: + +1. 将 `themes` 目录下的 [主题代码](https://github.com/touying-typ/touying/tree/main/themes) 复制到本地,例如将 `themes/university.typ` 复制到本地 `university.typ` 中。 +2. 将 `university.typ` 文件顶部的 `#import "../xxx.typ"` 命令全部移除。 +3. 向 `university.typ` 文件顶部中加入 `#import "@preview/touying:0.3.3": *` 来导入所有模块。 +4. 将 `register` 函数中的 `self: s` 替换成 `self: themes.default.register()` **(重要)**。 + +然后就可以通过 + +```typst +#import "@preview/touying:0.3.3": * +#import "university.typ" + +#let s = university.register(aspect-ratio: "16-9") +``` + +的方式导入和使用主题了。 + +一个具体的示例:https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx + + ## 导入 取决于这个主题是你自己的,还是 Touying 的一部分,你可以用两种方式导入: @@ -26,7 +49,7 @@ sidebar_position: 10 如果只是你自己使用,你可以直接导入 Touying: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * ``` 如果你希望这个主题作为 Touying 的一部分,放置在 Touying `themes` 目录下,那你应该将上面的导入语句改为 @@ -52,7 +75,7 @@ sidebar_position: 10 ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let register( self: themes.default.register(), @@ -69,7 +92,7 @@ sidebar_position: 10 } // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") @@ -78,7 +101,7 @@ sidebar_position: 10 #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -176,7 +199,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -238,7 +261,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -247,7 +270,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -276,7 +299,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) ``` // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -393,7 +416,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -410,7 +433,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) #show strong: alert -#let (slide, title-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s) #show: slides = First Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/changelog.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/changelog.md index c6da68654..1976d631c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/changelog.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/changelog.md @@ -4,6 +4,14 @@ sidebar_position: 14 # 更新日志 +## v0.3.3 + +- **template:** move template to `touying-aqua` package, make Touying searchable in [Typst Universe Packages](https://typst.app/universe/search?kind=packages) +- **themes:** fix bugs in university and dewdrop theme +- **feat:** make set-show rule work without `setting` parameter +- **feat:** make `composer` parameter more simpler +- **feat:** add `empty-slide` function + ## v0.3.2 - **fix critical bug:** fix `is-sequence` function, make `grid` and `table` work correctly in touying diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/code-styles.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/code-styles.md index 2b4a4d74c..1a06f2eb4 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/code-styles.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/code-styles.md @@ -9,13 +9,13 @@ sidebar_position: 4 如果我们只是需要简单使用,我们可以直接在标题下输入内容,就像是在编写正常 Typst 文档一样。这里的标题有着分割页面的作用,同时我们也能正常地使用 `#pause` 等命令实现动画效果。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -38,18 +38,18 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 ## 块风格 -很多时候,仅仅使用简单风格并不能实现我们需要的所有功能,为了更强大的功能和更清晰的结构,我们同样可以使用 `#slide[...]` 形式的块风格,其中 `#slide` 函数需要使用 `#let (slide,) = utils.slides(s)` 语法进行解包,才能正常在 `#show: slides` 后使用。 +很多时候,仅仅使用简单风格并不能实现我们需要的所有功能,为了更强大的功能和更清晰的结构,我们同样可以使用 `#slide[...]` 形式的块风格,其中 `#slide` 函数需要使用 `#let (slide, empty-slide) = utils.slides(s)` 语法进行解包,才能正常在 `#show: slides` 后使用。 例如上面的例子就可以改造成 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -65,6 +65,8 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 ] ``` +以及 `#empty-slide[]` 可以创建一个没有 header 和 footer 的空 Slide。 + 这样做的好处有很多: 1. 很多时候,我们不只是需要默认的 `#slide[...]`,还需要 `#focus-slide[...]` 这些特殊的 `slide` 函数; @@ -80,14 +82,14 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束 如果我们不希望它自动创建这样一个 section slide,我们可以将这个方法删除: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = none) #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -108,7 +110,7 @@ Hello, Typst! 同理,我们也可以注册一个新的 section slide: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = (self: none, section, ..args) => { @@ -122,7 +124,7 @@ Hello, Typst! #let (init, slides, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -149,7 +151,7 @@ Hello, Typst! 实际上,你也可以不使用 `#show: slides` 和 `utils.slides(s)`,而是只使用 `utils.methods(s)`,例如 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, touying-outline, slide) = utils.methods(s) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/other.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/other.md index 4dffa801f..fa97fbe89 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/other.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/other.md @@ -11,7 +11,7 @@ Touying 还提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pau 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Touying 还提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pau #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/simple.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/simple.md index ec3c3ae20..a0f38262e 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/simple.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/dynamic/simple.md @@ -56,27 +56,7 @@ Touying 为简单的动画效果提供了两个标记:`#pause` 和 `#meanwhile ## 如何处理 set-show rules? -如果你在 `slide[..]` 里面使用了 set-show rules,你会惊讶的发现,在那之后的 `#pause` 和 `#meanwhile` 都失效了。这是因为 Touying 无法探知 `styled(..)` 内部的内容(set-show rules 后的内容会被 `styled` 囊括起来)。 - -为了解决这个问题,Touying 为 `#slide()` 函数提供了一个 `setting` 参数,你可以将你的 set-show rules 放到 `setting` 参数里,例如修改字体颜色: - -```typst -#slide(setting: body => { - set text(fill: blue) - body -})[ - First - - #pause - - Second -] -``` - -![image](https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff) - - -同理,Touying 目前也不支持 `grid` 这类 layout 函数内部的 `#pause` 和 `#meanwhile`,也是由于同样的限制,但是你可以使用 `#slide()` 的 `composer` 参数,大部分情况下都应该能满足需求。 +如果你在 `slide[..]` 里面使用了像 `grid` 这类 layout 函数,你会惊讶地发现其内部的 `#pause` 和 `#meanwhile` 失效了。但是你可以使用 `#slide()` 的 `composer` 参数来布局,大部分情况下都应该能满足需求。 :::tip[原理] diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/external/pdfpc.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/external/pdfpc.md index 773489fd6..bcae36d29 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/external/pdfpc.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/external/pdfpc.md @@ -54,7 +54,7 @@ typst query --root . ./example.typ --field value --one "" > ./exampl 借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要加入下面的代码即可。 ``` -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/global-settings.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/global-settings.md index bc668049c..9548fe2b8 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/global-settings.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/global-settings.md @@ -32,7 +32,7 @@ self.methods.init = (self: none, body) => { #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -117,7 +117,7 @@ Title is #s.info.title 一般而言,上面的两种方式就已经足够用于加入全局设置了,但是仍然会有部分情况,我们需要初始化 counters 或 states。如果将这些代码放在 `#show: slides` 之前,就会创建一个空白页,这是我们不想看见的,因此这时候我们就可以使用 `s.methods.append-preamble` 方法。例如在使用 codly 包的时候: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -131,7 +131,7 @@ Title is #s.info.title #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/cetz.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/cetz.md index c1fc6fc97..a885c9f46 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/cetz.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/cetz.md @@ -11,7 +11,7 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause` 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause` #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/codly.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/codly.md index a9de5c758..0a65a7712 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/codly.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/codly.md @@ -7,7 +7,7 @@ sidebar_position: 5 在使用 codly 的时候,我们应该使用 `s.methods.append-preamble` 方法进行初始化。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -21,7 +21,7 @@ sidebar_position: 5 #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/fletcher.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/fletcher.md index 7c455d031..6693cc57c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/fletcher.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/fletcher.md @@ -9,7 +9,7 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea 一个例子: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -20,7 +20,7 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/pinit.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/pinit.md index 08589d2e1..d6210ddfe 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/pinit.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/pinit.md @@ -36,7 +36,7 @@ A simple #pin(1)highlighted text#pin(2). 一个与 Touying 共同使用的示例: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/pinit:0.1.3": * #(s.page-args.paper = "presentation-4-3") @@ -60,7 +60,7 @@ A simple #pin(1)highlighted text#pin(2). body } -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides // Main body diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/polylux.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/polylux.md index 9f316a308..b12b5014c 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/polylux.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/integration/polylux.md @@ -7,7 +7,7 @@ sidebar_position: 6 借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要在你的 Polylux 源代码中加入下面的代码即可。 ``` -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/layout.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/layout.md index 6d79bcb80..17d9e9307 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/layout.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/layout.md @@ -112,7 +112,7 @@ sidebar_position: 5 #(s.page-args.footer = [Custom Footer]) ``` -这样方式进行更换。不过需要注意的是,如果这样更换了页面参数,你需要将其放在 `#let (slide,) = utils.slides(s)` 之前,否则就需要重新调用 `#let (slide,) = utils.slides(s)`。 +这样方式进行更换。不过需要注意的是,如果这样更换了页面参数,你需要将其放在 `#let (slide, empty-slide) = utils.slides(s)` 之前,否则就需要重新调用 `#let (slide, empty-slide) = utils.slides(s)`。 :::warning[警告] @@ -129,7 +129,7 @@ sidebar_position: 5 例如,我们决定给 metropolis 主题加入 GitHub 的图标,我们可以这样实现: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/octique:0.1.0": * #let s = themes.metropolis.register(aspect-ratio: "16-9") @@ -170,7 +170,7 @@ sidebar_position: 5 如果你需要更改分栏的方式,可以修改 `slide` 的 `composer` 参数,其中默认的参数是 `utils.with.side-by-side(columns: auto, gutter: 1em)`,如果我们要让左边那一栏占据剩余宽度,可以使用 ```typst -#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[ +#slide(composer: (1fr, auto))[ First column. ][ Second column. diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/progress/counters.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/progress/counters.md index 3ce28cf1f..dee182aca 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/progress/counters.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/progress/counters.md @@ -36,7 +36,7 @@ Touying 的状态均放置于 `states` 命名空间下,包括所有的计数 ```typst // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.methods(s) +#let (slide, empty-slide) = utils.methods(s) #slide[ appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/sections.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/sections.md index 22b7a9995..b4fcd729d 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/sections.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/sections.md @@ -11,13 +11,13 @@ sidebar_position: 3 一般而言,1 级、2 级和 3 级标题分别用来对应 section、subsection 和 title,例如 dewdrop 主题。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -34,13 +34,13 @@ Hello, Touying! 但是很多时候我们并不需要 subsection,因此也会使用 1 级和 2 级标题来分别对应 section 和 title,例如 university 主题。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -60,13 +60,13 @@ Hello, Touying! 在 Touying 中显示目录很简单: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides, alert, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(slide-level: 2) = Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/start.md index 518c0b9ca..074796b19 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/start.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/start.md @@ -9,13 +9,13 @@ sidebar_position: 2 要使用 Touying,您只需要在文档里加入 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -35,14 +35,14 @@ Hello, Typst! **提示:** 你可以使用 `#import "config.typ": *` 或 `#include "content.typ"` 等 Typst 语法来实现 Touying 的多文件架构。 -**警告:** `#let (slide,) = utils.slides(s)` 里的逗号对于解包语法来说是必要的! +**警告:** `#let (slide, empty-slide) = utils.slides(s)` 里的逗号对于解包语法来说是必要的! ## 更复杂的例子 事实上,Touying 提供了多种 slides 编写风格,实际上您也可以使用 `#slide[..]` 的写法,以获得 Touying 提供的更多更强大的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -90,7 +90,7 @@ Hello, Typst! #show strong: alert // Extract slide functions -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Animation @@ -202,16 +202,6 @@ Hello, Typst! ] -== Setting - -#slide(setting: body => { - set text(fill: blue) - body -})[ - This slide has blue text. -] - - == Multiple Pages #slide[ @@ -221,7 +211,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) == Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/aqua.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/aqua.md index f67661b78..e556fa3d3 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/aqua.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/aqua.md @@ -14,7 +14,7 @@ sidebar_position: 5 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -30,7 +30,7 @@ sidebar_position: 5 #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -123,7 +123,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -139,7 +139,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -176,7 +176,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = The Section diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/dewdrop.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/dewdrop.md index 62b1a201e..025d5b1f7 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/dewdrop.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/dewdrop.md @@ -15,7 +15,7 @@ sidebar_position: 3 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -37,7 +37,7 @@ sidebar_position: 3 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -152,7 +152,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( @@ -168,7 +168,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -188,7 +188,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -209,7 +209,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Section A @@ -256,7 +256,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/metropolis.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/metropolis.md index af8f553a8..0f46ee448 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/metropolis.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/metropolis.md @@ -17,7 +17,7 @@ sidebar_position: 2 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -33,7 +33,7 @@ sidebar_position: 2 #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -160,7 +160,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -180,7 +180,7 @@ Hello, Typst! #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = First Section @@ -217,7 +217,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/simple.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/simple.md index 3664be472..eb27c093d 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/simple.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/simple.md @@ -16,14 +16,14 @@ sidebar_position: 1 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -96,14 +96,14 @@ simple 主题提供了一系列自定义 slide 函数: 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -123,13 +123,13 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides #title-slide[ diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/university.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/university.md index 3ceb16895..7b4ede217 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/university.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/version-0.3.2+/themes/university.md @@ -13,7 +13,7 @@ sidebar_position: 4 你可以通过下面的代码来初始化: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -27,7 +27,7 @@ sidebar_position: 4 #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides ``` @@ -35,6 +35,7 @@ sidebar_position: 4 - `aspect-ratio`: 幻灯片的长宽比为 "16-9" 或 "4-3",默认为 "16-9"。 - `progress-bar`: 是否显示 slide 顶部的进度条,默认为 `true`。 +- `display-current-section`: 是否显示当前节标题。 - `footer-columns`: 底部三栏 Footer 的宽度,默认为 `(25%, 1fr, 25%)`。 - `footer-a`: 第一栏,默认为 `self => self.info.author`。 - `footer-b`: 第二栏,默认为 `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`。 @@ -137,7 +138,7 @@ University 主题提供了一系列自定义 slide 函数: 以及可以通过 `#(s.methods.touying-new-section-slide = none)` 的方式关闭自动加入 `new-section-slide` 的功能。 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -151,7 +152,7 @@ University 主题提供了一系列自定义 slide 函数: #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides = Title @@ -171,7 +172,7 @@ Hello, Typst! ## 示例 ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -185,7 +186,7 @@ Hello, Typst! #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides.with(title-slide: false) #title-slide(authors: ([Author A], [Author B])) diff --git a/docs/versioned_docs/version-0.3.2+/build-your-own-theme.md b/docs/versioned_docs/version-0.3.2+/build-your-own-theme.md index de2b6a586..9beb541e0 100644 --- a/docs/versioned_docs/version-0.3.2+/build-your-own-theme.md +++ b/docs/versioned_docs/version-0.3.2+/build-your-own-theme.md @@ -18,6 +18,28 @@ Creating your own theme with Touying might seem a bit complex initially due to t To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps. + +## Modifying Existing Themes + +If you wish to modify a theme within the Touying framework locally instead of creating one from scratch, you can achieve this by following these steps: + +1. Copy the [theme code](https://github.com/touying-typ/touying/tree/main/themes) from the `themes` directory to your local machine. For example, copy `themes/university.typ` to a local file named `university.typ`. +2. Remove all `#import "../xxx.typ"` commands at the top of the `university.typ` file. +3. Add `#import "@preview/touying:0.3.3": *` at the top of the `university.typ` file to import all modules. +4. Replace `self: s` in the `register` function with `self: themes.default.register()` **(Important)**. + +You can then import and use the theme by: + +```typst +#import "@preview/touying:0.3.3": * +#import "university.typ" + +#let s = university.register(aspect-ratio: "16-9") +``` + +For a specific example, refer to: [https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx](https://typst.app/project/pdWNTS47I-6jxHrWdMSTLx) + + ## Import Depending on whether the theme is for personal use or part of Touying, you can import in two ways: @@ -25,7 +47,7 @@ Depending on whether the theme is for personal use or part of Touying, you can i If for personal use: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * ``` If part of Touying themes: @@ -51,7 +73,7 @@ Generally, the first step in creating slides is to determine font size and page ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let register( self: themes.default.register(), @@ -68,7 +90,7 @@ Generally, the first step in creating slides is to determine font size and page } // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") @@ -77,7 +99,7 @@ Generally, the first step in creating slides is to determine font size and page #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -168,7 +190,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title ```typst // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -230,7 +252,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -239,7 +261,7 @@ We also need to customize a `slide` method that accepts `slide(self: none, title #show strong: alert -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = First Section @@ -269,7 +291,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. ``` // bamboo.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let slide(self: none, title: auto, ..args) = { if title != auto { @@ -386,7 +408,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. // main.typ -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) @@ -403,7 +425,7 @@ Finally, we update the `slides(self: none, title-slide: true, slide-level: 1, .. #show strong: alert -#let (slide, title-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s) #show: slides = First Section diff --git a/docs/versioned_docs/version-0.3.2+/changelog.md b/docs/versioned_docs/version-0.3.2+/changelog.md index be5613796..1185b1bbb 100644 --- a/docs/versioned_docs/version-0.3.2+/changelog.md +++ b/docs/versioned_docs/version-0.3.2+/changelog.md @@ -4,6 +4,14 @@ sidebar_position: 14 # Changelog +## v0.3.3 + +- **template:** move template to `touying-aqua` package, make Touying searchable in [Typst Universe Packages](https://typst.app/universe/search?kind=packages) +- **themes:** fix bugs in university and dewdrop theme +- **feat:** make set-show rule work without `setting` parameter +- **feat:** make `composer` parameter more simpler +- **feat:** add `empty-slide` function + ## v0.3.2 - **fix critical bug:** fix `is-sequence` function, make `grid` and `table` work correctly in touying diff --git a/docs/versioned_docs/version-0.3.2+/code-styles.md b/docs/versioned_docs/version-0.3.2+/code-styles.md index a2ba82954..4048191c5 100644 --- a/docs/versioned_docs/version-0.3.2+/code-styles.md +++ b/docs/versioned_docs/version-0.3.2+/code-styles.md @@ -9,13 +9,13 @@ sidebar_position: 4 If we only need simplicity, we can directly input content under the heading, just like writing a normal Typst document. The heading here serves to divide the pages, and we can use commands like `#pause` to achieve animation effects. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -37,18 +37,18 @@ PS: We can use the `#slides-end` marker to signify the end of `#show: slides`. ## Block Style -Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of `#slide[...]`. The `#slide` function needs to be unpacked using the syntax `#let (slide,) = utils.slides(s)` to be used correctly after `#show: slides`. +Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of `#slide[...]`. The `#slide` function needs to be unpacked using the syntax `#let (slide, empty-slide) = utils.slides(s)` to be used correctly after `#show: slides`. For example, the previous example can be transformed into: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -64,6 +64,8 @@ For example, the previous example can be transformed into: ] ``` +and `#empty-slide[]` to create an empty slide without header and footer. + There are many advantages to doing this: 1. Many times, we not only need the default `#slide[...]` but also special `slide` functions like `#focus-slide[...]`. @@ -78,14 +80,14 @@ You may have noticed that when using the simple theme, using a level-one heading If we don't want it to automatically create such a section slide, we can delete this method: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = none) #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -106,7 +108,7 @@ As you can see, there are only two pages left, and the default section slide is Similarly, we can register a new section slide: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #(s.methods.touying-new-section-slide = (self: none, section, ..args) => { @@ -120,7 +122,7 @@ Similarly, we can register a new section slide: #let (init, slides, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -147,7 +149,7 @@ Also, since `#slide[...]` is registered in `s.slides = ("slide",)`, the `section In fact, you can also not use `#show: slides` and `utils.slides(s)`, but only use `utils.methods(s)`, for example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, touying-outline, slide) = utils.methods(s) diff --git a/docs/versioned_docs/version-0.3.2+/dynamic/other.md b/docs/versioned_docs/version-0.3.2+/dynamic/other.md index 026d6466c..dcbd5199f 100644 --- a/docs/versioned_docs/version-0.3.2+/dynamic/other.md +++ b/docs/versioned_docs/version-0.3.2+/dynamic/other.md @@ -11,7 +11,7 @@ Touying also provides `touying-reducer`, which adds `pause` and `meanwhile` anim Here's an example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ Here's an example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/versioned_docs/version-0.3.2+/dynamic/simple.md b/docs/versioned_docs/version-0.3.2+/dynamic/simple.md index a373bbc2c..8a30a1ff8 100644 --- a/docs/versioned_docs/version-0.3.2+/dynamic/simple.md +++ b/docs/versioned_docs/version-0.3.2+/dynamic/simple.md @@ -52,28 +52,9 @@ In some cases, you may need to display additional content simultaneously with `# This example will create only two subslides, with "First" and "Third" displayed simultaneously, and "Second" and "Fourth" displayed simultaneously. -## Handling set-show rules +## Handling layout functions -If you use set-show rules inside `slide[..]`, you might be surprised to find that subsequent `#pause` and `#meanwhile` do not work. This is because Touying cannot detect the content inside `styled(..)` (content after set-show rules is encompassed by `styled`). - -To address this issue, Touying provides a `setting` parameter for the `#slide()` function. You can place your set-show rules in the `setting` parameter. For example, changing the font color: - -```typst -#slide(setting: body => { - set text(fill: blue) - body -})[ - First - - #pause - - Second -] -``` - -![image](https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff) - -Similarly, Touying currently does not support `#pause` and `#meanwhile` inside layout functions like `grid`. This is due to the same limitation, but you can use the `composer` parameter of `#slide()` to meet most requirements. +If you use layout functions like `grid` inside `slide[..]`, you might be surprised to find that subsequent `#pause` and `#meanwhile` do not work. This is because Touying cannot detect the content inside layout functions. But you can use the `composer` parameter of `#slide()` to meet most requirements. :::tip[Internals] diff --git a/docs/versioned_docs/version-0.3.2+/external/pdfpc.md b/docs/versioned_docs/version-0.3.2+/external/pdfpc.md index 58c06f85d..d5503a7fb 100644 --- a/docs/versioned_docs/version-0.3.2+/external/pdfpc.md +++ b/docs/versioned_docs/version-0.3.2+/external/pdfpc.md @@ -52,7 +52,7 @@ typst query --root . ./example.typ --field value --one "" > ./exampl With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code: ```typst -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` \ No newline at end of file diff --git a/docs/versioned_docs/version-0.3.2+/global-settings.md b/docs/versioned_docs/version-0.3.2+/global-settings.md index 8caf9dc1a..82fd6e031 100644 --- a/docs/versioned_docs/version-0.3.2+/global-settings.md +++ b/docs/versioned_docs/version-0.3.2+/global-settings.md @@ -32,7 +32,7 @@ If you are not a theme creator but want to add your own global styles to your sl #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -117,7 +117,7 @@ Now you can understand the purpose of the `utils.methods()` function: to bind `s In general, the two ways mentioned above are sufficient for adding global settings. However, there are still situations where we need to initialize counters or states. If you place this code before `#show: slides`, a blank page will be created, which is something we don't want to see. In such cases, you can use the `s.methods.append-preamble` method. For example, when using the codly package: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -131,7 +131,7 @@ In general, the two ways mentioned above are sufficient for adding global settin #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/versioned_docs/version-0.3.2+/integration/cetz.md b/docs/versioned_docs/version-0.3.2+/integration/cetz.md index 2ceecbc57..747a1a095 100644 --- a/docs/versioned_docs/version-0.3.2+/integration/cetz.md +++ b/docs/versioned_docs/version-0.3.2+/integration/cetz.md @@ -11,7 +11,7 @@ Touying provides the `touying-reducer`, which adds `pause` and `meanwhile` anima An example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -22,7 +22,7 @@ An example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/versioned_docs/version-0.3.2+/integration/codly.md b/docs/versioned_docs/version-0.3.2+/integration/codly.md index 636011d15..fc052318c 100644 --- a/docs/versioned_docs/version-0.3.2+/integration/codly.md +++ b/docs/versioned_docs/version-0.3.2+/integration/codly.md @@ -7,7 +7,7 @@ sidebar_position: 5 When using Codly, we should initialize it using the `s.methods.append-preamble` method. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/codly:0.2.0": * #let s = themes.simple.register(aspect-ratio: "16-9") @@ -21,7 +21,7 @@ When using Codly, we should initialize it using the `s.methods.append-preamble` #show: init #show: codly-init.with() -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides #slide[ diff --git a/docs/versioned_docs/version-0.3.2+/integration/fletcher.md b/docs/versioned_docs/version-0.3.2+/integration/fletcher.md index 5766ac984..eba52f0c1 100644 --- a/docs/versioned_docs/version-0.3.2+/integration/fletcher.md +++ b/docs/versioned_docs/version-0.3.2+/integration/fletcher.md @@ -9,7 +9,7 @@ Touying provides the `touying-reducer`, which adds `pause` and `meanwhile` anima An example: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -20,7 +20,7 @@ An example: #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(title-slide: false, outline-slide: false) // cetz animation diff --git a/docs/versioned_docs/version-0.3.2+/integration/pinit.md b/docs/versioned_docs/version-0.3.2+/integration/pinit.md index 4281c6956..42c6d39c1 100644 --- a/docs/versioned_docs/version-0.3.2+/integration/pinit.md +++ b/docs/versioned_docs/version-0.3.2+/integration/pinit.md @@ -34,7 +34,7 @@ Another [example](https://github.com/OrangeX4/typst-pinit/blob/main/examples/equ An example of shared usage with Touying: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/pinit:0.1.3": * #(s.page-args.paper = "presentation-4-3") @@ -58,7 +58,7 @@ An example of shared usage with Touying: body } -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides // Main body diff --git a/docs/versioned_docs/version-0.3.2+/integration/polylux.md b/docs/versioned_docs/version-0.3.2+/integration/polylux.md index c439fd82c..947eb965b 100644 --- a/docs/versioned_docs/version-0.3.2+/integration/polylux.md +++ b/docs/versioned_docs/version-0.3.2+/integration/polylux.md @@ -7,7 +7,7 @@ sidebar_position: 6 With the compatibility between Touying and Polylux, you can make Polylux support direct export as well. Just add the following code to your Polylux source code: ```typst -#import "@preview/touying:0.3.2" +#import "@preview/touying:0.3.3" #locate(loc => touying.pdfpc.pdfpc-file(loc)) ``` diff --git a/docs/versioned_docs/version-0.3.2+/layout.md b/docs/versioned_docs/version-0.3.2+/layout.md index 9da184a92..619d9e698 100644 --- a/docs/versioned_docs/version-0.3.2+/layout.md +++ b/docs/versioned_docs/version-0.3.2+/layout.md @@ -112,7 +112,7 @@ Similarly, if you are not satisfied with the header or footer style of a theme, #(s.page-args.footer = [Custom Footer]) ``` -to replace it. However, please note that if you replace the page parameters in this way, you need to place it before `#let (slide,) = utils.slides(s)`, or you need to call `#let (slide,) = utils.slides(s)` again. +to replace it. However, please note that if you replace the page parameters in this way, you need to place it before `#let (slide, empty-slide) = utils.slides(s)`, or you need to call `#let (slide, empty-slide) = utils.slides(s)` again. :::warning[Warning] @@ -129,7 +129,7 @@ Adding a logo to slides is a very common but also a very versatile requirement. For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/octique:0.1.0": * #let s = themes.metropolis.register(aspect-ratio: "16-9") @@ -170,7 +170,7 @@ If you need to divide the page into two or three columns, you can use the `compo If you need to change the way columns are composed, you can modify the `composer` parameter of `slide`. The default parameter is `utils.with.side-by-side(columns: auto, gutter: 1em)`. If we want the left column to occupy the remaining width, we can use ```typst -#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[ +#slide(composer: (1fr, auto))[ First column. ][ Second column. diff --git a/docs/versioned_docs/version-0.3.2+/progress/counters.md b/docs/versioned_docs/version-0.3.2+/progress/counters.md index 5bf50b8bc..d3a2b8b17 100644 --- a/docs/versioned_docs/version-0.3.2+/progress/counters.md +++ b/docs/versioned_docs/version-0.3.2+/progress/counters.md @@ -33,7 +33,7 @@ You can use ```typst // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.methods(s) +#let (slide, empty-slide) = utils.methods(s) #slide[ appendix diff --git a/docs/versioned_docs/version-0.3.2+/sections.md b/docs/versioned_docs/version-0.3.2+/sections.md index c1a9a94ca..6810650ef 100644 --- a/docs/versioned_docs/version-0.3.2+/sections.md +++ b/docs/versioned_docs/version-0.3.2+/sections.md @@ -11,13 +11,13 @@ Similar to Beamer, Touying also has the concept of sections and subsections. Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -34,13 +34,13 @@ Hello, Touying! However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Section @@ -59,13 +59,13 @@ In fact, we can control this behavior through the `slide-level` parameter of the Displaying a table of contents in Touying is straightforward: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides, alert, touying-outline) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides.with(slide-level: 2) = Section diff --git a/docs/versioned_docs/version-0.3.2+/start.md b/docs/versioned_docs/version-0.3.2+/start.md index 4d76c3823..483ccfbff 100644 --- a/docs/versioned_docs/version-0.3.2+/start.md +++ b/docs/versioned_docs/version-0.3.2+/start.md @@ -9,13 +9,13 @@ Before you begin, make sure you have the Typst environment installed. If not, yo To use Touying, you just need to include the following in your document: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Title @@ -35,7 +35,7 @@ It's that simple! You've created your first Touying slides. Congratulations! **Tip:** You can use Typst syntax like `#import "config.typ": *` or `#include "content.typ"` to implement Touying's multi-file architecture. -**Warning:** The comma in `#let (slide,) = utils.slides(s)` is necessary for the unpacking syntax. +**Warning:** The comma in `#let (slide, empty-slide) = utils.slides(s)` is necessary for the unpacking syntax. ## More Complex Examples @@ -52,7 +52,7 @@ Touying offers many built-in themes to easily create beautiful slides. For examp you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge @@ -100,7 +100,7 @@ you can use the university theme. For more detailed tutorials on themes, you can #show strong: alert // Extract slide functions -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) #show: slides = Animation @@ -206,16 +206,6 @@ you can use the university theme. For more detailed tutorials on themes, you can ][ Second column. ] - -== Setting - -#slide(setting: body => { - set text(fill: blue) - body -})[ - This slide has blue text. -] - == Multiple Pages #slide[ @@ -225,7 +215,7 @@ you can use the university theme. For more detailed tutorials on themes, you can // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) == Appendix diff --git a/docs/versioned_docs/version-0.3.2+/themes/aqua.md b/docs/versioned_docs/version-0.3.2+/themes/aqua.md index d3262a40e..7042570cb 100644 --- a/docs/versioned_docs/version-0.3.2+/themes/aqua.md +++ b/docs/versioned_docs/version-0.3.2+/themes/aqua.md @@ -13,7 +13,7 @@ This theme is created by [@pride7](https://github.com/pride7), featuring beautif You can initialize it with the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -29,7 +29,7 @@ You can initialize it with the following code: #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: The outline title can be modified via `#(s.outline-title = [Outline])`. Additionally, you can disable the automatic inclusion of `new-section-slide` functionality by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -140,7 +140,7 @@ Additionally, you can disable the automatic inclusion of `new-section-slide` fun #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -159,7 +159,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( @@ -175,7 +175,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, outline-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = The Section diff --git a/docs/versioned_docs/version-0.3.2+/themes/dewdrop.md b/docs/versioned_docs/version-0.3.2+/themes/dewdrop.md index 0aee7bb74..88300afd3 100644 --- a/docs/versioned_docs/version-0.3.2+/themes/dewdrop.md +++ b/docs/versioned_docs/version-0.3.2+/themes/dewdrop.md @@ -15,7 +15,7 @@ The Dewdrop theme features an elegantly designed navigation, including two modes You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -37,7 +37,7 @@ You can initialize it using the following code: #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -152,7 +152,7 @@ PS: You can modify the outline title using `#(s.outline-title = [Outline])`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( @@ -168,7 +168,7 @@ And the function of automatically adding `new-section-slide` can be turned off b #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -188,7 +188,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register( aspect-ratio: "16-9", @@ -209,7 +209,7 @@ Hello, Typst! #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Section A @@ -256,7 +256,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/versioned_docs/version-0.3.2+/themes/metropolis.md b/docs/versioned_docs/version-0.3.2+/themes/metropolis.md index 1b8f88655..f738b97d4 100644 --- a/docs/versioned_docs/version-0.3.2+/themes/metropolis.md +++ b/docs/versioned_docs/version-0.3.2+/themes/metropolis.md @@ -15,7 +15,7 @@ The Metropolis theme is elegant and suitable for everyday use. It is recommended You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -31,7 +31,7 @@ You can initialize it using the following code: #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -124,7 +124,7 @@ PS: You can modify the outline title using `#(s.outline-title = [Outline])`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -160,7 +160,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( @@ -180,7 +180,7 @@ Hello, Typst! #set par(justify: true) #show strong: alert -#let (slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = First Section @@ -217,7 +217,7 @@ Hello, Typst! // appendix by freezing last-slide-number #let s = (s.methods.appendix)(self: s) -#let (slide,) = utils.slides(s) +#let (slide, empty-slide) = utils.slides(s) = Appendix diff --git a/docs/versioned_docs/version-0.3.2+/themes/simple.md b/docs/versioned_docs/version-0.3.2+/themes/simple.md index 25cf40a0b..a060dfa9f 100644 --- a/docs/versioned_docs/version-0.3.2+/themes/simple.md +++ b/docs/versioned_docs/version-0.3.2+/themes/simple.md @@ -15,14 +15,14 @@ Considered a relatively straightforward theme, you can use it to create simple s You can initialize it using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides ``` @@ -96,14 +96,14 @@ You can set it using `#show: slides.with(..)`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides = Title @@ -123,13 +123,13 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides]) #let (init, slides) = utils.methods(s) #show: init -#let (slide, title-slide, centered-slide, focus-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s) #show: slides #title-slide[ diff --git a/docs/versioned_docs/version-0.3.2+/themes/university.md b/docs/versioned_docs/version-0.3.2+/themes/university.md index 78073ce13..f058f6b41 100644 --- a/docs/versioned_docs/version-0.3.2+/themes/university.md +++ b/docs/versioned_docs/version-0.3.2+/themes/university.md @@ -13,7 +13,7 @@ This aesthetically pleasing theme is courtesy of [Pol Dellaiera](https://github. You can initialize the University theme using the following code: ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -27,7 +27,7 @@ You can initialize the University theme using the following code: #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides ``` @@ -35,6 +35,7 @@ The `register` function accepts the following parameters: - `aspect-ratio`: Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9." - `progress-bar`: Controls whether the progress bar at the top of each slide is displayed, with the default being `true`. +- `display-current-section`: Whether to display the current section. - `footer-columns`: The width of the footer in the bottom three columns, the default is `(25%, 1fr, 25%)`. - `footer-a`: The first column, default is `self => self.info.author`. - `footer-b`: Second column, default is `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`. @@ -134,7 +135,7 @@ You can set these parameters using `#show: slides.with(..)`. And the function of automatically adding `new-section-slide` can be turned off by `#(s.methods.touying-new-section-slide = none)`. ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -148,7 +149,7 @@ And the function of automatically adding `new-section-slide` can be turned off b #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides = Title @@ -168,7 +169,7 @@ Hello, Typst! ## Example ```typst -#import "@preview/touying:0.3.2": * +#import "@preview/touying:0.3.3": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( @@ -182,7 +183,7 @@ Hello, Typst! #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init -#let (slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) +#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides.with(title-slide: false) #title-slide(authors: ([Author A], [Author B]))