### Basic Touying Presentation Setup in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.2/start This snippet demonstrates the fundamental steps to create a simple presentation using the Touying package in Typst. It includes importing the package, registering a theme, initializing slide methods, and defining basic slides with a pause for content progression. This forms the minimal working example for a Touying presentation. ```Typst #import "@preview/touying:0.4.2": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init #let (slide, empty-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Basic Touying Presentation Setup in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.3.2+/start This code snippet demonstrates the fundamental steps to create a simple presentation using the Touying library in Typst. It includes importing the necessary package, registering a theme, initializing the presentation environment, and defining basic slides with content and a pause. This serves as a quick start guide for new users to create their first Touying slides. ```Typst #import "@preview/touying:0.3.3": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init #let (slide, empty-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Basic Touying Presentation Setup in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.1/start This snippet demonstrates the minimal setup for a Touying presentation in Typst. It includes importing the Touying library, registering a simple theme, initializing the slide system, and defining basic content with a pause between elements. ```Typst #import "@preview/touying:0.4.1": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init #let (slide, empty-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Complete Touying Document Setup with Theme, Numbering, Info, and PDFPC Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.2/start This comprehensive snippet shows a full setup for a Touying document. It includes importing necessary packages, registering the 'university' theme, configuring section and subsection numbering, setting global document information (title, author, date, institution), and integrating PDFPC settings for presentation control. It also defines custom theorem environments using `ctheorems`. ```Typst #import "@preview/touying:0.4.2": * #import "@preview/cetz:0.3.2" #import "@preview/fletcher:0.4.4" as fletcher: node, edge #import "@preview/ctheorems:1.1.3": * // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) // Register university theme // You can replace it with other themes and it can still work normally #let s = themes.university.register(aspect-ratio: "16-9") // Set the numbering of section and subsection #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") // Set the speaker notes configuration // #let s = (s.methods.show-notes-on-second-screen)(self: s, right) // Global information configuration #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) // Pdfpc configuration // typst query --root . ./example.typ --field value --one "" > ./example.pdfpc #let s = (s.methods.append-preamble)(self: s, pdfpc.config( duration-minutes: 30, start-time: datetime(hour: 14, minute: 10, second: 0), end-time: datetime(hour: 14, minute: 40, second: 0), last-minutes: 5, note-font-size: 12, disable-markdown: false, default-transition: ( type: "push", duration-seconds: 2, angle: ltr, alignment: "vertical", direction: "inward", ), )) // Theorems configuration by ctheorems #show: thmrules.with(qed-symbol: $square$) #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em)) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmproof("proof", "Proof") // Extract methods #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert // Extract slide functions #let (slide, empty-slide) = utils.slides(s) #show: slides ``` -------------------------------- ### Full Touying Presentation Setup with Imports and Configuration Source: https://touying-typ.github.io/docs/themes/stargazer/0.3.2+/start This comprehensive snippet outlines the initial setup for a Touying presentation, including importing necessary packages, defining custom reducers for `cetz` and `fletcher` integration, configuring global presentation information (title, author, date), and setting up `pdfpc` for presenter console features like duration and slide transitions. ```Typst #import "@preview/touying:0.3.3": * #import "@preview/cetz:0.2.1" #import "@preview/fletcher:0.4.2" as fletcher: node, edge // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: (arr, ..args) => fletcher.diagram(..args, ..arr)) // Register university theme // You can replace it with other themes and it can still work normally #let s = themes.university.register(aspect-ratio: "16-9") // Global information configuration #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) // Pdfpc configuration // typst query --root . ./example.typ --field value --one "" > ./example.pdfpc #let s = (s.methods.append-preamble)(self: s, pdfpc.config( duration-minutes: 30, start-time: datetime(hour: 14, minute: 10, second: 0), end-time: datetime(hour: 14, minute: 40, second: 0), last-minutes: 5, note-font-size: 12, disable-markdown: false, default-transition: ( type: "push", duration-seconds: 2, angle: ltr, alignment: "vertical", direction: "inward", ), )) // Extract methods #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert // Extract slide functions #let (slide, empty-slide) = utils.slides(s) #show: slides ``` -------------------------------- ### Comprehensive Touying Presentation Configuration Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.1/start This extensive code block provides a complete setup for a Touying presentation, including package imports, theme registration, section numbering, global information (title, author, date), PDFpc configuration for presentation control, and theorem styling using `ctheorems`. It showcases how to integrate various Touying features and external packages for a rich presentation experience. ```Typst #import "@preview/touying:0.4.1": * #import "@preview/cetz:0.3.2" #import "@preview/fletcher:0.4.4" as fletcher: node, edge #import "@preview/ctheorems:1.1.3": * // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) // Register university theme // You can replace it with other themes and it can still work normally #let s = themes.university.register(aspect-ratio: "16-9") // Set the numbering of section and subsection #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") // Global information configuration #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) // Pdfpc configuration // typst query --root . ./example.typ --field value --one "" > ./example.pdfpc #let s = (s.methods.append-preamble)(self: s, pdfpc.config( duration-minutes: 30, start-time: datetime(hour: 14, minute: 10, second: 0), end-time: datetime(hour: 14, minute: 40, second: 0), last-minutes: 5, note-font-size: 12, disable-markdown: false, default-transition: ( type: "push", duration-seconds: 2, angle: ltr, alignment: "vertical", direction: "inward", ), )) // Theorems configuration by ctheorems #show: thmrules.with(qed-symbol: $square$) #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em)) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmproof("proof", "Proof") // Extract methods #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert // Extract slide functions #let (slide, empty-slide) = utils.slides(s) #show: slides ``` -------------------------------- ### Basic Touying Presentation Example Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.0+/themes/university This example demonstrates the fundamental setup of a Touying presentation using the University theme. It includes importing the library, registering the theme, setting presentation metadata (title, author, date), initializing the presentation, and creating simple slides with pauses. ```Typst #import "@preview/touying:0.4.0": * #let s = themes.university.register(aspect-ratio: "16-9") #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Create Your First Basic Touying Slide Source: https://touying-typ.github.io/docs/themes/stargazer/next/start This snippet demonstrates the minimal setup required to create a basic presentation slide using Touying in Typst. It imports the Touying package, applies a simple theme, sets the aspect ratio, and includes a title, a slide, and a pause for content reveal. ```Typst #import "@preview/touying:0.6.1": * #import themes.simple: * #show: simple-theme.with(aspect-ratio: "16-9") = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Create Basic Touying Presentation Slides in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.0+/start This Typst code snippet demonstrates the minimal setup required to create a simple presentation using the Touying library. It imports the Touying package, registers a default theme, initializes the slide rendering system, and defines a basic slide with content and a pause effect. ```Typst #import "@preview/touying:0.4.0": * #let s = themes.simple.register() #let (init, slides) = utils.methods(s) #show: init #let (slide, empty-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Comprehensive Touying Slide Presentation Example Source: https://touying-typ.github.io/docs/themes/stargazer/start This Typst code provides a complete example of a Touying presentation. It demonstrates importing themes (university theme), configuring presentation information (title, author, logo), setting heading numbering, and creating various types of animations including simple pauses, complex reveal effects (`#uncover`, `#only`, `#alternatives`), callback-style animations, math equation animations, and integrations with CeTZ for vector graphics and Fletcher for diagrams. It also includes examples of defining theorems, proofs, corollaries, and creating multi-column layouts. ```Typst #import "@preview/touying:0.6.1": * #import themes.university: * #import "@preview/cetz:0.3.2" #import "@preview/fletcher:0.5.5" as fletcher: node, edge #import "@preview/numbly:0.1.0": numbly #import "@preview/theorion:0.3.2": * #import cosmos.clouds: * #show: show-theorion // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) #show: university-theme.with( aspect-ratio: "16-9", // align: horizon, // config-common(handout: true), config-common(frozen-counters: (theorem-counter,)), // freeze theorem counter for animation config-info( title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], logo: emoji.school, ), ) #set heading(numbering: numbly("{1}.", default: "1.1")) #title-slide() == Outline #components.adaptive-columns(outline(title: none, indent: 1em)) = Animation == Simple Animation We can use `#pause` to #pause display something later. #pause Just like this. #meanwhile Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously. #speaker-note[ + This is a speaker note. + You won't see it unless you use `config-common(show-notes-on-second-screen: right)` ] == Complex Animation At subslide #touying-fn-wrapper((self: none) => str(self.subslide)), we can use #uncover("2-")[`#uncover` function] for reserving space, use #only("2-")[`#only` function] for not reserving space, #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. == Callback Style Animation #slide( repeat: 3, self => [ #let (uncover, only, alternatives) = utils.methods(self) At subslide #self.subslide, we can use #uncover("2-")[`#uncover` function] for reserving space, use #only("2-")[`#only` function] for not reserving space, #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. ], ) == Math Equation Animation Equation with `pause`: $ f(x) &= pause x^2 + 2x + 1 \\ &= pause (x + 1)^2 \\ $ #meanwhile Here, #pause we have the expression of $f(x)$. #pause By factorizing, we can obtain this result. == CeTZ Animation CeTZ Animation in Touying: #cetz-canvas({ import cetz.draw: * rect((0, 0), (5, 5)) (pause,) rect((0, 0), (1, 1)) rect((1, 1), (2, 2)) rect((2, 2), (3, 3)) (pause,) line((0, 0), (2.5, 2.5), name: "line") }) == Fletcher Animation Fletcher Animation in Touying: #fletcher-diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1, 0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0, 0), `reading`, radius: 2em), edge((0, 0), (0, 0), `read()`, "--|>", bend: 130deg), pause, edge(`read()`, "-|>"), node((1, 0), `eof`, radius: 2em), pause, edge(`close()`, "-|>"), node((2, 0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0, 0), (2, 0), `close()`, "-|>", bend: -40deg), ) = Theorems == Prime numbers #definition[ A natural number is called a #highlight[_prime number_] if it is greater than 1 and cannot be written as the product of two smaller natural numbers. ] #example[ The numbers $2$, $3$, and $17$ are prime. @cor_largest_prime shows that this list is not exhaustive! ] #theorem(title: "Euclid")[ There are infinitely many primes. ] #pagebreak(weak: true) #proof[ Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a contradiction. ] #corollary[ There is no largest prime number. ] #corollary[ There are infinitely many composite numbers. ] #theorem[ There are arbitrarily long stretches of composite numbers. ] #proof[ For any $n > 2$, consider $ n! + 2, quad n! + 3, quad ..., quad n! + n $ ] = Others == Side-by-side #slide(composer: (1fr, 1fr))[ First column. ][ Second column. ] == Multiple Pages #lorem(200) #show: appendix = Appendix == Appendix Please pay attention to the current slide number. ``` -------------------------------- ### Defining and Using Theorems with Touying and Ctheorems Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.1/start This snippet demonstrates how to define and present mathematical theorems, definitions, examples, and proofs using Touying, leveraging the `ctheorems` package. It shows the structure for presenting formal mathematical content within a presentation, including custom theorem environments. ```Typst #definition[ A natural number is called a #highlight[_prime number_] if it is greater than 1 and cannot be written as the product of two smaller natural numbers. ] #example[ The numbers $2$, $3$, and $17$ are prime. @cor_largest_prime shows that this list is not exhaustive! ] #theorem("Euclid")[ There are infinitely many primes. ] #proof[ Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, ] ``` -------------------------------- ### Basic Dewdrop Theme Setup Example in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.3.2+/themes/dewdrop A foundational Typst example demonstrating how to set up the Dewdrop theme. This includes registering the theme, configuring presentation metadata (title, author, date), initializing theme methods, and creating a basic title and first content slide with a `pause` effect. ```Typst #import "@preview/touying:0.3.3": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Define Mathematical Theorems and Proofs in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.2/start Illustrates the use of Typst's built-in macros like #definition, #example, #theorem, #proof, and #corollary to structure mathematical content, including prime number definitions and Euclid's theorem. ```Typst #definition[ A natural number is called a #highlight[_prime number_] if it is greater than 1 and cannot be written as the product of two smaller natural numbers. ] #example[ The numbers $2$, $3$, and $17$ are prime. @cor_largest_prime shows that this list is not exhaustive! ] #theorem("Euclid")[ There are infinitely many primes. ] #proof[ Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a contradiction. ] #corollary[ There is no largest prime number. ] #corollary[ There are infinitely many composite numbers. ] #theorem[ There are arbitrarily long stretches of composite numbers. ] #proof[ For any $n > 2$, consider $ n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere $ ] ``` -------------------------------- ### Touying Theme Registration Example Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.0+/start This snippet illustrates how to register a built-in theme, specifically the 'university' theme, in Touying. It also demonstrates setting the `aspect-ratio` for the presentation, a fundamental step in customizing the visual layout of slides. ```Typst #let s = themes.university.register(aspect-ratio: "16-9") ``` -------------------------------- ### Basic Dewdrop Theme Setup and First Slide Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.2/themes/dewdrop This example demonstrates the basic setup of the Dewdrop theme in Typst. It registers the theme, configures presentation information like title and author, initializes the presentation, and defines a simple title slide and a content slide with a pause. ```Typst #import "@preview/touying:0.4.2": * #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Touying Theme Setup and Slide Usage Example Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.2/build-your-own-theme This comprehensive Typst example demonstrates the full workflow for setting up a Touying presentation. It covers importing necessary modules, registering a custom theme with specific aspect ratios and footers, configuring presentation metadata (title, author, date), and showcasing the usage of various slide types like `slide` and `focus-slide` for content presentation. ```Typst #import "@preview/touying:0.4.2": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s) #show: slides = First Section == First Slide #slide[ A slide with a title and an *important* information. ] #focus-slide[ Focus on it! ] ``` -------------------------------- ### Comprehensive Touying Presentation Configuration Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.0+/start This extensive Typst code block provides a complete setup for a Touying presentation. It covers essential configurations such as importing external packages (`cetz`, `fletcher`, `ctheorems`), binding diagramming tools, registering and customizing a theme, setting slide numbering, defining global presentation metadata (title, author, date), configuring `pdfpc` for advanced presentation control, and establishing custom theorem environments. Furthermore, it showcases various animation techniques including basic `#pause` and `#meanwhile` for sequential reveals, advanced slide transitions with `#uncover`, `#only`, and `#alternatives`, and dynamic animations within mathematical equations (`touying-equation`), CeTZ diagrams (`cetz-canvas`), and Fletcher graphs (`fletcher-diagram`). This example demonstrates a holistic approach to building interactive and visually rich presentations with Touying. ```Typst #import "@preview/touying:0.4.0": * #import "@preview/cetz:0.3.2" #import "@preview/fletcher:0.4.4" as fletcher: node, edge #import "@preview/ctheorems:1.1.3": * // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) // Register university theme // You can replace it with other themes and it can still work normally #let s = themes.university.register(aspect-ratio: "16-9") // Set the numbering of section and subsection #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") // Global information configuration #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) // Pdfpc configuration // typst query --root . ./example.typ --field value --one "" > ./example.pdfpc #let s = (s.methods.append-preamble)(self: s, pdfpc.config( duration-minutes: 30, start-time: datetime(hour: 14, minute: 10, second: 0), end-time: datetime(hour: 14, minute: 40, second: 0), last-minutes: 5, note-font-size: 12, disable-markdown: false, default-transition: ( type: "push", duration-seconds: 2, angle: ltr, alignment: "vertical", direction: "inward", ), )) // Theorems configuration by ctheorems #show: thmrules.with(qed-symbol: $square$) #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em)) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmproof("proof", "Proof") // Extract methods #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert // Extract slide functions #let (slide, empty-slide) = utils.slides(s) #show: slides = Animation == Simple Animation We can use `#pause` to #pause display something later. #pause Just like this. #meanwhile Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously. == Complex Animation #slide(repeat: 3, self => [ #let (uncover, only, alternatives) = utils.methods(self) At subslide #self.subslide, we can use #uncover("2-")[`#uncover` function] for reserving space, use #only("2-")[`#only` function] for not reserving space, #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. ]) == Math Equation Animation Touying equation with `pause`: #touying-equation(` f(x) &= pause x^2 + 2x + 1 \ &= pause (x + 1)^2 \ `) #meanwhile Here, #pause we have the expression of $f(x)$. #pause By factorizing, we can obtain this result. == CeTZ Animation CeTZ Animation in Touying: #cetz-canvas({ import cetz.draw: * rect((0,0), (5,5)) (pause,) rect((0,0), (1,1)) rect((1,1), (2,2)) rect((2,2), (3,3)) (pause,) line((0,0), (2.5, 2.5), name: "line") }) == Fletcher Animation Fletcher Animation in Touying: #fletcher-diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), pause, edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), pause, edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) = Theorems == Prime numbers #definition[ A natural number is called a #highlight[_prime number_] if it is greater than 1 and cannot be written as the product of two smaller natural numbers. ] #example[ The numbers $2$, $3$, and $17$ are prime. @cor_largest_prime shows that this list is not exhaustive! ] #theorem("Euclid")[ There are infinitely many primes. ] #proof[ Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since ``` -------------------------------- ### Typst: Basic Touying Presentation Setup with `slides` Source: https://touying-typ.github.io/docs/themes/stargazer/0.2.x/themes/dewdrop Provides a foundational example of setting up a Touying presentation. It demonstrates importing the library, registering a theme, configuring presentation metadata like title and author, enabling transparent covers, and creating basic slides with pauses. ```Typst #import "@preview/touying:0.2.1": * #let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop]) #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let s = (s.methods.enable-transparent-cover)(self: s) #let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Basic Touying Slide Deck Creation in Typst Source: https://touying-typ.github.io/docs/themes/stargazer/0.3.x/start This Typst code snippet illustrates the fundamental steps to create a simple presentation using the Touying framework. It imports the Touying package, registers a basic theme, initializes the slide environment, and defines a title slide with a pause effect. This example requires a working Typst environment to compile and render the presentation. ```Typst #import "@preview/touying:0.3.1": * #let s = themes.simple.register(s) #let (init, slides) = utils.methods(s) #show: init #let (slide,) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Basic Touying Typst Presentation Setup Example Source: https://touying-typ.github.io/docs/themes/stargazer/0.4.1/themes/aqua This Typst code snippet demonstrates the fundamental setup for a presentation using the `touying` library. It initializes the presentation environment, registers a theme, sets up presentation metadata like title and author, and includes basic slide structures such as a title slide and a content slide with a pause effect. ```Typst #import "@preview/touying:0.4.1": * #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en") #let s = (s.methods.info)( self: s, title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], ) #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s) #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Create a Basic Touying Slide Source: https://touying-typ.github.io/docs/themes/stargazer/0.2.x/start This snippet demonstrates the minimal code required to set up Touying and create a simple slide with a title and two lines of text, separated by a pause. It uses the `import` statement to bring in Touying utilities and `show` to initialize and display slides. ```Typst #import "@preview/touying:0.2.1": * #let (init, slide, slides) = utils.methods(s) #show: init #show: slides = Title == First Slide Hello, Touying! #pause Hello, Typst! ``` -------------------------------- ### Comprehensive Touying Slide Configuration and Animation Example Source: https://touying-typ.github.io/docs/themes/stargazer/0.5.x/start This extensive Typst code block showcases a wide range of Touying features for creating dynamic and structured presentations. It includes theme configuration, custom theorem definitions, various animation techniques (simple pauses, synchronous displays, conditional content reveal, callback-style animations), mathematical equation animation, and integration with external libraries like CeTZ for vector graphics and Fletcher for diagrams. It also demonstrates speaker notes, outline generation, and multi-column slide layouts. ```Typst #import "@preview/touying:0.5.5": * #import themes.university: * #import "@preview/cetz:0.3.2" #import "@preview/fletcher:0.5.5" as fletcher: node, edge #import "@preview/ctheorems:1.1.3": * #import "@preview/numbly:0.1.0": numbly // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) // Theorems configuration by ctheorems #show: thmrules.with(qed-symbol: $square$) #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em)) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmproof("proof", "Proof") #show: university-theme.with( aspect-ratio: "16-9", // config-common(handout: true), config-info( title: [Title], subtitle: [Subtitle], author: [Authors], date: datetime.today(), institution: [Institution], logo: emoji.school, ), ) #set heading(numbering: numbly("{1}.", default: "1.1")) #title-slide() == Outline #components.adaptive-columns(outline(title: none, indent: 1em)) = Animation == Simple Animation We can use `#pause` to #pause display something later. #pause Just like this. #meanwhile Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously. #speaker-note[ + This is a speaker note. + You won't see it unless you use `config-common(show-notes-on-second-screen: right)` ] == Complex Animation At subslide #touying-fn-wrapper((self: none) => str(self.subslide)), we can use #uncover("2-")[`#uncover` function] for reserving space, use #only("2-")[`#only` function] for not reserving space, #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. == Callback Style Animation #slide(repeat: 3, self => [ #let (uncover, only, alternatives) = utils.methods(self) At subslide #self.subslide, we can use #uncover("2-")[`#uncover` function] for reserving space, use #only("2-")[`#only` function] for not reserving space, #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives. ]) == Math Equation Animation Equation with `pause`: $ f(x) &= pause x^2 + 2x + 1 \\ &= pause (x + 1)^2 \\ $ #meanwhile Here, #pause we have the expression of $f(x)$. #pause By factorizing, we can obtain this result. == CeTZ Animation CeTZ Animation in Touying: #cetz-canvas({ import cetz.draw: * rect((0,0), (5,5)) (pause,) rect((0,0), (1,1)) rect((1,1), (2,2)) rect((2,2), (3,3)) (pause,) line((0,0), (2.5, 2.5), name: "line") }) == Fletcher Animation Fletcher Animation in Touying: #fletcher-diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), pause, edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), pause, edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) = Theorems == Prime numbers #definition[ A natural number is called a #highlight[_prime number_] if it is greater than 1 and cannot be written as the product of two smaller natural numbers. ] #example[ The numbers $2$, $3$, and $17$ are prime. @cor_largest_prime shows that this list is not exhaustive! ] #theorem("Euclid")[ There are infinitely many primes. ] #proof[ Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list, it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a contradiction. ] #corollary[ There is no largest prime number. ] #corollary[ There are infinitely many composite numbers. ] #theorem[ There are arbitrarily long stretches of composite numbers. ] #proof[ For any $n > 2$, consider $ n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere $ ] = Others == Side-by-side #slide(composer: (1fr, 1fr))[ First column. ][ Second column. ] ```