Page Not Found | Touying
-
+
diff --git a/assets/js/0d1c87af.abe48754.js b/assets/js/0d1c87af.1af163d0.js
similarity index 97%
rename from assets/js/0d1c87af.abe48754.js
rename to assets/js/0d1c87af.1af163d0.js
index 4c1cff567..611056451 100644
--- a/assets/js/0d1c87af.abe48754.js
+++ b/assets/js/0d1c87af.1af163d0.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2792],{2006:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>a});var s=i(5893),t=i(1151);const l={sidebar_position:5},o="Aqua Theme",d={id:"themes/aqua",title:"Aqua Theme",description:"image",source:"@site/docs/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University Theme",permalink:"/touying/docs/next/themes/university"},next:{title:"Creating Your Own Theme",permalink:"/touying/docs/next/build-your-own-theme"}},r={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Themes",id:"color-themes",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"aqua-theme",children:"Aqua Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is created by ",(0,s.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"}),", featuring beautiful backgrounds made with Typst's visualization capabilities."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it with the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Where ",(0,s.jsx)(n.code,{children:"register"})," takes parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of slides, either "16-9" or "4-3", default is "16-9".']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content shown on the right side of the footer, default is ",(0,s.jsx)(n.code,{children:"states.slide-counter.display()"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"lang"}),": Language configuration, currently supports ",(0,s.jsx)(n.code,{children:'"en"'})," and ",(0,s.jsx)(n.code,{children:'"zh"'}),", default is ",(0,s.jsx)(n.code,{children:'"en"'}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Aqua theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can utilize with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\n",(0,s.jsx)(n.p,{children:"Aqua by default uses:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\n'})}),"\n",(0,s.jsxs)(n.p,{children:["color themes, which you can modify by ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"Aqua theme offers a series of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," will read information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Display an outline slide."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A default ordinary slide function with title and footer, where ",(0,s.jsx)(n.code,{children:"title"})," defaults to the current section title."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw the audience's attention. The background color is ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Start a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Default is ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["They can be set via ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: The outline title can be modified via ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, you can disable the automatic inclusion of ",(0,s.jsx)(n.code,{children:"new-section-slide"})," functionality by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2792],{2006:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>a});var s=i(5893),t=i(1151);const l={sidebar_position:5},o="Aqua Theme",d={id:"themes/aqua",title:"Aqua Theme",description:"image",source:"@site/docs/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University Theme",permalink:"/touying/docs/next/themes/university"},next:{title:"Creating Your Own Theme",permalink:"/touying/docs/next/build-your-own-theme"}},r={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Themes",id:"color-themes",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"aqua-theme",children:"Aqua Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is created by ",(0,s.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"}),", featuring beautiful backgrounds made with Typst's visualization capabilities."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it with the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Where ",(0,s.jsx)(n.code,{children:"register"})," takes parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of slides, either "16-9" or "4-3", default is "16-9".']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content shown on the right side of the footer, default is ",(0,s.jsx)(n.code,{children:"states.slide-counter.display()"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"lang"}),": Language configuration, currently supports ",(0,s.jsx)(n.code,{children:'"en"'})," and ",(0,s.jsx)(n.code,{children:'"zh"'}),", default is ",(0,s.jsx)(n.code,{children:'"en"'}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Aqua theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can utilize with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\n",(0,s.jsx)(n.p,{children:"Aqua by default uses:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\n'})}),"\n",(0,s.jsxs)(n.p,{children:["color themes, which you can modify by ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"Aqua theme offers a series of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," will read information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Display an outline slide."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A default ordinary slide function with title and footer, where ",(0,s.jsx)(n.code,{children:"title"})," defaults to the current section title."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw the audience's attention. The background color is ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Start a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Default is ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["They can be set via ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: The outline title can be modified via ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, you can disable the automatic inclusion of ",(0,s.jsx)(n.code,{children:"new-section-slide"})," functionality by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/293f9c83.e2d4c498.js b/assets/js/293f9c83.3b48b842.js
similarity index 98%
rename from assets/js/293f9c83.e2d4c498.js
rename to assets/js/293f9c83.3b48b842.js
index 284019363..6431010a4 100644
--- a/assets/js/293f9c83.e2d4c498.js
+++ b/assets/js/293f9c83.3b48b842.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8088],{9547:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=t(5893),s=t(1151);const r={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to CeTZ and Fletcher.",source:"@site/docs/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"}},d={},a=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to CeTZ and Fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within CeTZ, but it requires a bit of technique:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8088],{9547:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=t(5893),s=t(1151);const r={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to CeTZ and Fletcher.",source:"@site/docs/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"}},d={},a=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to CeTZ and Fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within CeTZ, but it requires a bit of technique:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/39430005.39096450.js b/assets/js/39430005.282e5018.js
similarity index 98%
rename from assets/js/39430005.39096450.js
rename to assets/js/39430005.282e5018.js
index 180dea687..6517de829 100644
--- a/assets/js/39430005.39096450.js
+++ b/assets/js/39430005.282e5018.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9619],{4057:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=t(5893),s=t(1151);const o={sidebar_position:5},r="Other Animations",d={id:"dynamic/other",title:"Other Animations",description:"Touying also provides touying-reducer, which adds pause and meanwhile animations to cetz and fletcher.",source:"@site/docs/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover Function",permalink:"/touying/docs/next/dynamic/cover"},next:{title:"Handout Mode",permalink:"/touying/docs/next/dynamic/handout"}},c={},a=[{value:"Simple Animations",id:"simple-animations",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"other-animations",children:"Other Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying also provides ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to cetz and fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsx)(n.p,{children:"Here's an example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within cetz, just requiring a bit of skill:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9619],{4057:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=t(5893),s=t(1151);const o={sidebar_position:5},r="Other Animations",d={id:"dynamic/other",title:"Other Animations",description:"Touying also provides touying-reducer, which adds pause and meanwhile animations to cetz and fletcher.",source:"@site/docs/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover Function",permalink:"/touying/docs/next/dynamic/cover"},next:{title:"Handout Mode",permalink:"/touying/docs/next/dynamic/handout"}},c={},a=[{value:"Simple Animations",id:"simple-animations",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"other-animations",children:"Other Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying also provides ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to cetz and fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsx)(n.p,{children:"Here's an example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within cetz, just requiring a bit of skill:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/3f2877b5.be6b644a.js b/assets/js/3f2877b5.4796c932.js
similarity index 98%
rename from assets/js/3f2877b5.be6b644a.js
rename to assets/js/3f2877b5.4796c932.js
index 27d4cf594..369ad506b 100644
--- a/assets/js/3f2877b5.be6b644a.js
+++ b/assets/js/3f2877b5.4796c932.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8350],{5813:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to Fletcher.",source:"@site/docs/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to Fletcher."]}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8350],{5813:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to Fletcher.",source:"@site/docs/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to Fletcher."]}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/472f8a66.c4719110.js b/assets/js/472f8a66.6827c4cb.js
similarity index 99%
rename from assets/js/472f8a66.c4719110.js
rename to assets/js/472f8a66.6827c4cb.js
index e8d252874..50f839432 100644
--- a/assets/js/472f8a66.c4719110.js
+++ b/assets/js/472f8a66.6827c4cb.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var i=t(5893),o=t(1151);const a={sidebar_position:5},s="Page Layout",r={id:"layout",title:"Page Layout",description:"Basic Concepts",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Code Style",permalink:"/touying/docs/next/code-styles"},next:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"}},d={},l=[{value:"Basic Concepts",id:"basic-concepts",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Application: Adding a Logo",id:"application-adding-a-logo",level:2},{value:"Page Columns",id:"page-columns",level:2}];function c(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"page-layout",children:"Page Layout"}),"\n",(0,i.jsx)(n.h2,{id:"basic-concepts",children:"Basic Concepts"}),"\n",(0,i.jsx)(n.p,{children:"To create stylish slides using Typst, it's essential to understand Typst's page model correctly. If you're not concerned with customizing page styles, you can choose to skip this section. However, it's still recommended to go through it."}),"\n",(0,i.jsx)(n.p,{children:"Let's illustrate Typst's default page model through a specific example."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"We need to distinguish the following concepts:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Model:"})," Typst has a model similar to the CSS Box Model, divided into Margin, Padding, and Content. However, padding is not a property of ",(0,i.jsx)(n.code,{children:"set page(..)"})," but is obtained by manually adding ",(0,i.jsx)(n.code,{children:"#pad(..)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Margin:"})," Margins are the edges of the page, divided into top, bottom, left, and right. They are the core of Typst's page model, and all other properties are influenced by margins, especially Header and Footer. Header and Footer are actually located within the Margin."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header:"})," The Header is the content at the top of the page, divided into container and innerbox. We can observe that the edge of the header container and padding does not align but has some space in between, which is actually ",(0,i.jsx)(n.code,{children:"header-ascent: 30%"}),", where the percentage is relative to the margin-top. Additionally, we notice that the header innerbox is actually located at the bottom left corner of the header container, meaning innerbox defaults to ",(0,i.jsx)(n.code,{children:"#set align(left + bottom)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Footer:"})," The Footer is the content at the bottom of the page, similar to the Header but in the opposite direction."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Place:"})," The ",(0,i.jsx)(n.code,{children:"place"})," function enables absolute positioning relative to the parent container without affecting other elements inside the parent container. It allows specifying ",(0,i.jsx)(n.code,{children:"alignment"}),", ",(0,i.jsx)(n.code,{children:"dx"}),", and ",(0,i.jsx)(n.code,{children:"dy"}),", making it suitable for placing decorative elements like logos."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Therefore, to apply Typst to create slides, we only need to set:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"However, we still need to address how the header occupies the entire page width. Here, we use negative padding to achieve this. For instance:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,i.jsxs)(n.p,{children:["Since modifying page parameters using the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command in Typst creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable and a ",(0,i.jsx)(n.code,{children:"s.padding"})," member variable. These parameters are only applied when Touying creates a new slide, so users only need to focus on ",(0,i.jsx)(n.code,{children:"s.page-args"})," and ",(0,i.jsx)(n.code,{children:"s.padding"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"For example, the previous example can be modified as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Touying automatically detects the value of ",(0,i.jsx)(n.code,{children:"margin.x"})," and adds negative padding to the header if ",(0,i.jsx)(n.code,{children:"self.full-header == true"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Similarly, if you're unsatisfied with the header or footer style of a particular theme, you can change it using:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,i.jsxs)(n.p,{children:["However, it's essential to note that if you change page parameters in this way, you need to place it before ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),", or you'll have to call ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," again."]}),"\n",(0,i.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,i.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command directly but instead modify the ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable internally."]})}),"\n",(0,i.jsxs)(n.p,{children:["This approach also allows us to query the current page parameters in real-time using ",(0,i.jsx)(n.code,{children:"s.page-args"}),", which is useful for functions that need to obtain margins or the current page's background color, such as ",(0,i.jsx)(n.code,{children:"transparent-cover"}),". This is partially equivalent to context get rule and is actually more convenient to use."]}),"\n",(0,i.jsx)(n.h2,{id:"application-adding-a-logo",children:"Application: Adding a Logo"}),"\n",(0,i.jsxs)(n.p,{children:["Adding a logo to slides is a very common but also a very versatile requirement. The difficulty lies in the fact that the required size and position of the logo often vary from person to person. Therefore, most of Touying's themes do not include configuration options for logos. But with the concepts of page layout mentioned in this section, we know that we can use the ",(0,i.jsx)(n.code,{children:"place"})," function in the header or footer to place a logo image."]}),"\n",(0,i.jsx)(n.p,{children:"For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo at the top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["Here, ",(0,i.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," can be used to display ",(0,i.jsx)(n.code,{children:"body"})," as content or a callback function in the form ",(0,i.jsx)(n.code,{children:"self => content"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,i.jsxs)(n.p,{children:["If you need to divide the page into two or three columns, you can use the ",(0,i.jsx)(n.code,{children:"compose"})," feature provided by the default ",(0,i.jsx)(n.code,{children:"slide"})," function in Touying. The simplest example is as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a39f88a2-f1ba-4420-8f78-6a0fc644704e",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,i.jsx)(n.code,{children:"utils.side-by-side.with(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/aa84192a-4082-495d-9773-b06df32ab8dc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>s});var i=t(7294);const o={},a=i.createContext(o);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var i=t(5893),o=t(1151);const a={sidebar_position:5},s="Page Layout",r={id:"layout",title:"Page Layout",description:"Basic Concepts",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Code Style",permalink:"/touying/docs/next/code-styles"},next:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"}},d={},l=[{value:"Basic Concepts",id:"basic-concepts",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Application: Adding a Logo",id:"application-adding-a-logo",level:2},{value:"Page Columns",id:"page-columns",level:2}];function c(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"page-layout",children:"Page Layout"}),"\n",(0,i.jsx)(n.h2,{id:"basic-concepts",children:"Basic Concepts"}),"\n",(0,i.jsx)(n.p,{children:"To create stylish slides using Typst, it's essential to understand Typst's page model correctly. If you're not concerned with customizing page styles, you can choose to skip this section. However, it's still recommended to go through it."}),"\n",(0,i.jsx)(n.p,{children:"Let's illustrate Typst's default page model through a specific example."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"We need to distinguish the following concepts:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Model:"})," Typst has a model similar to the CSS Box Model, divided into Margin, Padding, and Content. However, padding is not a property of ",(0,i.jsx)(n.code,{children:"set page(..)"})," but is obtained by manually adding ",(0,i.jsx)(n.code,{children:"#pad(..)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Margin:"})," Margins are the edges of the page, divided into top, bottom, left, and right. They are the core of Typst's page model, and all other properties are influenced by margins, especially Header and Footer. Header and Footer are actually located within the Margin."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header:"})," The Header is the content at the top of the page, divided into container and innerbox. We can observe that the edge of the header container and padding does not align but has some space in between, which is actually ",(0,i.jsx)(n.code,{children:"header-ascent: 30%"}),", where the percentage is relative to the margin-top. Additionally, we notice that the header innerbox is actually located at the bottom left corner of the header container, meaning innerbox defaults to ",(0,i.jsx)(n.code,{children:"#set align(left + bottom)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Footer:"})," The Footer is the content at the bottom of the page, similar to the Header but in the opposite direction."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Place:"})," The ",(0,i.jsx)(n.code,{children:"place"})," function enables absolute positioning relative to the parent container without affecting other elements inside the parent container. It allows specifying ",(0,i.jsx)(n.code,{children:"alignment"}),", ",(0,i.jsx)(n.code,{children:"dx"}),", and ",(0,i.jsx)(n.code,{children:"dy"}),", making it suitable for placing decorative elements like logos."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Therefore, to apply Typst to create slides, we only need to set:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"However, we still need to address how the header occupies the entire page width. Here, we use negative padding to achieve this. For instance:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,i.jsxs)(n.p,{children:["Since modifying page parameters using the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command in Typst creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable and a ",(0,i.jsx)(n.code,{children:"s.padding"})," member variable. These parameters are only applied when Touying creates a new slide, so users only need to focus on ",(0,i.jsx)(n.code,{children:"s.page-args"})," and ",(0,i.jsx)(n.code,{children:"s.padding"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"For example, the previous example can be modified as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Touying automatically detects the value of ",(0,i.jsx)(n.code,{children:"margin.x"})," and adds negative padding to the header if ",(0,i.jsx)(n.code,{children:"self.full-header == true"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Similarly, if you're unsatisfied with the header or footer style of a particular theme, you can change it using:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,i.jsxs)(n.p,{children:["However, it's essential to note that if you change page parameters in this way, you need to place it before ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),", or you'll have to call ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," again."]}),"\n",(0,i.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,i.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command directly but instead modify the ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable internally."]})}),"\n",(0,i.jsxs)(n.p,{children:["This approach also allows us to query the current page parameters in real-time using ",(0,i.jsx)(n.code,{children:"s.page-args"}),", which is useful for functions that need to obtain margins or the current page's background color, such as ",(0,i.jsx)(n.code,{children:"transparent-cover"}),". This is partially equivalent to context get rule and is actually more convenient to use."]}),"\n",(0,i.jsx)(n.h2,{id:"application-adding-a-logo",children:"Application: Adding a Logo"}),"\n",(0,i.jsxs)(n.p,{children:["Adding a logo to slides is a very common but also a very versatile requirement. The difficulty lies in the fact that the required size and position of the logo often vary from person to person. Therefore, most of Touying's themes do not include configuration options for logos. But with the concepts of page layout mentioned in this section, we know that we can use the ",(0,i.jsx)(n.code,{children:"place"})," function in the header or footer to place a logo image."]}),"\n",(0,i.jsx)(n.p,{children:"For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo at the top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["Here, ",(0,i.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," can be used to display ",(0,i.jsx)(n.code,{children:"body"})," as content or a callback function in the form ",(0,i.jsx)(n.code,{children:"self => content"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,i.jsxs)(n.p,{children:["If you need to divide the page into two or three columns, you can use the ",(0,i.jsx)(n.code,{children:"compose"})," feature provided by the default ",(0,i.jsx)(n.code,{children:"slide"})," function in Touying. The simplest example is as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a39f88a2-f1ba-4420-8f78-6a0fc644704e",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,i.jsx)(n.code,{children:"utils.side-by-side.with(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/aa84192a-4082-495d-9773-b06df32ab8dc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>s});var i=t(7294);const o={},a=i.createContext(o);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/5057383c.7a48ca40.js b/assets/js/5057383c.ecf8e775.js
similarity index 98%
rename from assets/js/5057383c.7a48ca40.js
rename to assets/js/5057383c.ecf8e775.js
index 95c7fe671..7cc31f560 100644
--- a/assets/js/5057383c.7a48ca40.js
+++ b/assets/js/5057383c.ecf8e775.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5854],{3242:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>c});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002",source:"@site/docs/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Pdfpc",permalink:"/touying/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/docs/next/external/typst-preview"}},p={},c=[{value:"\u7b14\u8bb0\u652f\u6301",id:"\u7b14\u8bb0\u652f\u6301",level:2}];function l(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002"]}),"\n",(0,t.jsx)(s.h2,{id:"\u7b14\u8bb0\u652f\u6301",children:"\u7b14\u8bb0\u652f\u6301"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"\u7136\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 pympress \u653e\u6620\u4e86\u3002"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5854],{3242:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>c});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002",source:"@site/docs/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Pdfpc",permalink:"/touying/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/docs/next/external/typst-preview"}},p={},c=[{value:"\u7b14\u8bb0\u652f\u6301",id:"\u7b14\u8bb0\u652f\u6301",level:2}];function l(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002"]}),"\n",(0,t.jsx)(s.h2,{id:"\u7b14\u8bb0\u652f\u6301",children:"\u7b14\u8bb0\u652f\u6301"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"\u7136\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 pympress \u653e\u6620\u4e86\u3002"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/55b57bd3.afd6b9b2.js b/assets/js/55b57bd3.648f91c3.js
similarity index 98%
rename from assets/js/55b57bd3.afd6b9b2.js
rename to assets/js/55b57bd3.648f91c3.js
index b4bdb1e77..a21fc2aae 100644
--- a/assets/js/55b57bd3.afd6b9b2.js
+++ b/assets/js/55b57bd3.648f91c3.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6259],{4628:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying can work seamlessly with the ctheorems package, allowing you to directly use the ctheorems package.",source:"@site/docs/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/docs/next/category/themes"}},c={},l=[];function m(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsxs)(n.p,{children:["Touying can work seamlessly with the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package, allowing you to directly use the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package."]}),"\n",(0,o.jsxs)(n.p,{children:["Moreover, you can utilize ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," to set numbering for sections and subsections."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6259],{4628:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying can work seamlessly with the ctheorems package, allowing you to directly use the ctheorems package.",source:"@site/docs/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/docs/next/category/themes"}},c={},l=[];function m(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsxs)(n.p,{children:["Touying can work seamlessly with the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package, allowing you to directly use the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package."]}),"\n",(0,o.jsxs)(n.p,{children:["Moreover, you can utilize ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," to set numbering for sections and subsections."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/5670b452.b5eb8c1f.js b/assets/js/5670b452.5f7a58b6.js
similarity index 97%
rename from assets/js/5670b452.b5eb8c1f.js
rename to assets/js/5670b452.5f7a58b6.js
index b2185335f..c12bab659 100644
--- a/assets/js/5670b452.b5eb8c1f.js
+++ b/assets/js/5670b452.5f7a58b6.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[997],{2261:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var n=s(5893),i=s(1151);const o={sidebar_position:11},l="Creating Your Own Theme",r={id:"build-your-own-theme",title:"Creating Your Own Theme",description:"Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the source code of existing themes for guidance. The key steps to implement are:",source:"@site/docs/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/docs/next/category/progress"}},d={},a=[{value:"Modifying Existing Themes",id:"modifying-existing-themes",level:2},{value:"Import",id:"import",level:2},{value:"Register Function and Init Method",id:"register-function-and-init-method",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Practical: Custom Alert Method",id:"practical-custom-alert-method",level:2},{value:"Custom Header and Footer",id:"custom-header-and-footer",level:2},{value:"Custom Special Slide",id:"custom-special-slide",level:2},{value:"Conclusion",id:"conclusion",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"creating-your-own-theme",children:"Creating Your Own Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"source code of existing themes"})," for guidance. The key steps to implement are:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"register"})," function to initialize the global singleton ",(0,n.jsx)(t.code,{children:"s"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"init"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Define a color theme by modifying the ",(0,n.jsx)(t.code,{children:"self.colors"})," member variable."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"alert"})," method (optional)."]}),"\n",(0,n.jsx)(t.li,{children:"Customize the header."}),"\n",(0,n.jsx)(t.li,{children:"Customize the footer."}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slide"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize special slide methods, such as ",(0,n.jsx)(t.code,{children:"title-slide"})," and ",(0,n.jsx)(t.code,{children:"focus-slide"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slides"})," method (optional)."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps."}),"\n",(0,n.jsx)(t.h2,{id:"modifying-existing-themes",children:"Modifying Existing Themes"}),"\n",(0,n.jsx)(t.p,{children:"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:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["Copy the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"theme code"})," from the ",(0,n.jsx)(t.code,{children:"themes"})," directory to your local machine. For example, copy ",(0,n.jsx)(t.code,{children:"themes/university.typ"})," to a local file named ",(0,n.jsx)(t.code,{children:"university.typ"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Remove all ",(0,n.jsx)(t.code,{children:'#import "../xxx.typ"'})," commands at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file."]}),"\n",(0,n.jsxs)(t.li,{children:["Add ",(0,n.jsx)(t.code,{children:'#import "@preview/touying:0.4.0": *'})," at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file to import all modules."]}),"\n",(0,n.jsxs)(t.li,{children:["Replace ",(0,n.jsx)(t.code,{children:"self: s"})," in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"})," ",(0,n.jsx)(t.strong,{children:"(Important)"}),"."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"You can then import and use the theme by:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,n.jsxs)(t.p,{children:["For a specific example, refer to: ",(0,n.jsx)(t.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,n.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,n.jsx)(t.p,{children:"Depending on whether the theme is for personal use or part of Touying, you can import in two ways:"}),"\n",(0,n.jsx)(t.p,{children:"If for personal use:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n'})}),"\n",(0,n.jsx)(t.p,{children:"If part of Touying themes:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["Additionally, add the import statement in Touying's ",(0,n.jsx)(t.code,{children:"themes/themes.typ"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,n.jsx)(t.h2,{id:"register-function-and-init-method",children:"Register Function and Init Method"}),"\n",(0,n.jsx)(t.p,{children:"Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted."}),"\n",(0,n.jsx)(t.p,{children:"Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, we created a ",(0,n.jsx)(t.code,{children:"register"})," function and passed an ",(0,n.jsx)(t.code,{children:"aspect-ratio"})," parameter to set the page aspect ratio. We get default ",(0,n.jsx)(t.code,{children:"self"})," by ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"}),". As you might already know, in Touying, we should not use ",(0,n.jsx)(t.code,{children:"set page(..)"})," to set page parameters but rather use the syntax ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to set them, as explained in the Page Layout section."]}),"\n",(0,n.jsxs)(t.p,{children:["In addition, we registered a ",(0,n.jsx)(t.code,{children:"self.methods.init"})," method, which can be used for some global style settings. For example, in this case, we added ",(0,n.jsx)(t.code,{children:"set text(size: 20pt)"})," to set the font size. You can also place additional global style settings here, such as ",(0,n.jsx)(t.code,{children:"set par(justify: true)"}),". Since the ",(0,n.jsx)(t.code,{children:"init"})," function is placed inside ",(0,n.jsx)(t.code,{children:"self.methods"}),", it is a method, not a regular function. Therefore, we need to add the parameter ",(0,n.jsx)(t.code,{children:"self: none"})," to use it properly."]}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, later in ",(0,n.jsx)(t.code,{children:"main.typ"}),", we apply the global style settings in ",(0,n.jsx)(t.code,{children:"init"})," using ",(0,n.jsx)(t.code,{children:"#show: init"}),", where ",(0,n.jsx)(t.code,{children:"init"})," is bound and unpacked through ",(0,n.jsx)(t.code,{children:"utils.methods(s)"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["If you pay extra attention, you'll notice that the ",(0,n.jsx)(t.code,{children:"register"})," function has an independent ",(0,n.jsx)(t.code,{children:"self"})," at the end. This actually represents returning the modified ",(0,n.jsx)(t.code,{children:"self"})," as the return value, which will be saved in ",(0,n.jsx)(t.code,{children:"#let s = .."}),". This line is therefore indispensable."]}),"\n",(0,n.jsx)(t.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Choosing an attractive color theme for your slides is crucial. Touying provides built-in color theme support to minimize API differences between different themes. Touying offers two dimensions of color selection: the first is ",(0,n.jsx)(t.code,{children:"neutral"}),", ",(0,n.jsx)(t.code,{children:"primary"}),", ",(0,n.jsx)(t.code,{children:"secondary"}),", and ",(0,n.jsx)(t.code,{children:"tertiary"})," for hue distinction, with ",(0,n.jsx)(t.code,{children:"primary"})," being the most commonly used; the second is ",(0,n.jsx)(t.code,{children:"default"}),", ",(0,n.jsx)(t.code,{children:"light"}),", ",(0,n.jsx)(t.code,{children:"lighter"}),", ",(0,n.jsx)(t.code,{children:"lightest"}),", ",(0,n.jsx)(t.code,{children:"dark"}),", ",(0,n.jsx)(t.code,{children:"darker"}),", and ",(0,n.jsx)(t.code,{children:"darkest"})," for brightness distinction."]}),"\n",(0,n.jsxs)(t.p,{children:["As we are creating the Bamboo theme, we chose a color for the ",(0,n.jsx)(t.code,{children:"primary"})," theme, similar to bamboo (",(0,n.jsx)(t.code,{children:'rgb("#5E8B65")'}),"), and included neutral lightest/darkest as background and font colors."]}),"\n",(0,n.jsxs)(t.p,{children:["As shown in the code below, we use ",(0,n.jsx)(t.code,{children:"(self.methods.colors)(self: self, ..)"})," to modify the color theme. Essentially, it is a wrapper for ",(0,n.jsx)(t.code,{children:"self.colors += (..)"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["After adding the color theme, we can access the color using syntax like ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"It's worth noting that users can change the theme color at any time using:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,n.jsx)(t.p,{children:"This flexibility demonstrates Touying's powerful customization capabilities."}),"\n",(0,n.jsx)(t.h2,{id:"practical-custom-alert-method",children:"Practical: Custom Alert Method"}),"\n",(0,n.jsxs)(t.p,{children:["In general, we need to provide a ",(0,n.jsx)(t.code,{children:"#alert[..]"})," function for users, similar to ",(0,n.jsx)(t.code,{children:"#strong[..]"}),". Typically, ",(0,n.jsx)(t.code,{children:"#alert[..]"})," emphasizes text using the primary theme color for aesthetics. We add a line in the ",(0,n.jsx)(t.code,{children:"register"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["This code sets the text color to ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),", utilizing the theme's primary color."]}),"\n",(0,n.jsx)(t.h2,{id:"custom-header-and-footer",children:"Custom Header and Footer"}),"\n",(0,n.jsx)(t.p,{children:"Here, assuming you've already read the Page Layout section, we know we should add headers and footers to the slides."}),"\n",(0,n.jsxs)(t.p,{children:["Firstly, we add ",(0,n.jsx)(t.code,{children:"self.bamboo-title = []"}),". This means we save the title of the current slide as a member variable ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),", stored in ",(0,n.jsx)(t.code,{children:"self"}),". This makes it easy to use in the header and later modifications. Similarly, we create ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),", saving the ",(0,n.jsx)(t.code,{children:"footer: []"})," parameter from the ",(0,n.jsx)(t.code,{children:"register"})," function for displaying in the bottom-left corner."]}),"\n",(0,n.jsxs)(t.p,{children:["It's worth noting that our header is actually a content function in the form of ",(0,n.jsx)(t.code,{children:"let header(self) = { .. }"})," with the ",(0,n.jsx)(t.code,{children:"self"})," parameter, allowing us to get the latest information from ",(0,n.jsx)(t.code,{children:"self"}),". For example, ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),". The footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"components.cell"})," used inside is actually ",(0,n.jsx)(t.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),", and ",(0,n.jsx)(t.code,{children:"show: components.cell"})," is shorthand for ",(0,n.jsx)(t.code,{children:"components.cell(body)"}),". The ",(0,n.jsx)(t.code,{children:"show: pad.with(.4em)"})," in the footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["Another point to note is the ",(0,n.jsx)(t.code,{children:"states"})," module, which contains many counters and state-related content. For example, ",(0,n.jsx)(t.code,{children:"states.current-section-title"})," is used to display the current ",(0,n.jsx)(t.code,{children:"section"}),", and ",(0,n.jsx)(t.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," is used to display the current page number and total number of pages."]}),"\n",(0,n.jsxs)(t.p,{children:["We observe the usage of ",(0,n.jsx)(t.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," to display ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),". This is used to handle situations like ",(0,n.jsx)(t.code,{children:"self.bamboo-footer = (self) => {..}"}),", ensuring a unified approach to displaying content functions and content."]}),"\n",(0,n.jsxs)(t.p,{children:["To ensure proper display of the header and footer and sufficient spacing from the main content, we also set margins, such as ",(0,n.jsx)(t.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["We also need to customize a ",(0,n.jsx)(t.code,{children:"slide"})," method that accepts ",(0,n.jsx)(t.code,{children:"slide(self: none, title: auto, ..args)"}),". The first ",(0,n.jsx)(t.code,{children:"self: none"})," is a required method parameter for getting the latest ",(0,n.jsx)(t.code,{children:"self"}),". The second ",(0,n.jsx)(t.code,{children:"title"})," is used to update ",(0,n.jsx)(t.code,{children:"self.bamboo-title"})," for displaying in the header. The third ",(0,n.jsx)(t.code,{children:"..args"})," collects the remaining parameters and passes them to ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, ..args)"}),", which is necessary for the Touying ",(0,n.jsx)(t.code,{children:"slide"})," functionality to work properly. Additionally, we need to register this method in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self.methods.slide = slide"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"custom-special-slide",children:"Custom Special Slide"}),"\n",(0,n.jsxs)(t.p,{children:["Building upon the basic slide, we further add some special slide functions such as ",(0,n.jsx)(t.code,{children:"title-slide"}),", ",(0,n.jsx)(t.code,{children:"focus-slide"}),", and a custom ",(0,n.jsx)(t.code,{children:"slides"})," method."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"title-slide"})," method, first, we call ",(0,n.jsx)(t.code,{children:"self = utils.empty-page(self)"}),". This function clears ",(0,n.jsx)(t.code,{children:"self.page-args.header"}),", ",(0,n.jsx)(t.code,{children:"self.page-args.footer"}),", and sets ",(0,n.jsx)(t.code,{children:"margin"})," to ",(0,n.jsx)(t.code,{children:"0em"}),", creating a blank page effect. Then, we use ",(0,n.jsx)(t.code,{children:"let info = self.info + args.named()"})," to get information stored in ",(0,n.jsx)(t.code,{children:"self.info"})," and update it with the passed ",(0,n.jsx)(t.code,{children:"args.named()"})," for later use as ",(0,n.jsx)(t.code,{children:"info.title"}),". The specific page content ",(0,n.jsx)(t.code,{children:"body"})," will vary for each theme, so we won't go into details here. Finally, we call `(self.methods.touying-slide)(self: self, repeat: none, body"]}),"\n",(0,n.jsxs)(t.p,{children:[")",(0,n.jsx)(t.code,{children:", where "}),"repeat: none",(0,n.jsx)(t.code,{children:"indicates that this page does not require animation effects, and passing the"}),"body` parameter displays its content."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"new-section-slide"})," method, the process is similar. The only thing to note is that in ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"}),", we pass an additional ",(0,n.jsx)(t.code,{children:"section: section"})," parameter to declare the creation of a new section. Another point to note is that besides ",(0,n.jsx)(t.code,{children:"self.methods.new-section-slide = new-section-slide"}),", we also register ",(0,n.jsx)(t.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),", so ",(0,n.jsx)(t.code,{children:"new-section-slide"})," will be automatically called when encountering a first-level title."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"focus-slide"})," method, most of the content is similar, but it's worth noting that we use ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to update the page's background color."]}),"\n",(0,n.jsxs)(t.p,{children:["Finally, we update the ",(0,n.jsx)(t.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," method. When ",(0,n.jsx)(t.code,{children:"title-slide"})," is ",(0,n.jsx)(t.code,{children:"true"}),", using ",(0,n.jsx)(t.code,{children:"#show: slides"})," will automatically create a ",(0,n.jsx)(t.code,{children:"title-slide"}),". Setting ",(0,n.jsx)(t.code,{children:"slide-level: 1"})," indicates that the first-level and second-level titles correspond to ",(0,n.jsx)(t.code,{children:"section"})," and ",(0,n.jsx)(t.code,{children:"title"}),", respectively."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming."})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>l});var n=s(7294);const i={},o=n.createContext(i);function l(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[997],{2261:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var n=s(5893),i=s(1151);const o={sidebar_position:11},l="Creating Your Own Theme",r={id:"build-your-own-theme",title:"Creating Your Own Theme",description:"Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the source code of existing themes for guidance. The key steps to implement are:",source:"@site/docs/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/docs/next/category/progress"}},d={},a=[{value:"Modifying Existing Themes",id:"modifying-existing-themes",level:2},{value:"Import",id:"import",level:2},{value:"Register Function and Init Method",id:"register-function-and-init-method",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Practical: Custom Alert Method",id:"practical-custom-alert-method",level:2},{value:"Custom Header and Footer",id:"custom-header-and-footer",level:2},{value:"Custom Special Slide",id:"custom-special-slide",level:2},{value:"Conclusion",id:"conclusion",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"creating-your-own-theme",children:"Creating Your Own Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"source code of existing themes"})," for guidance. The key steps to implement are:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"register"})," function to initialize the global singleton ",(0,n.jsx)(t.code,{children:"s"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"init"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Define a color theme by modifying the ",(0,n.jsx)(t.code,{children:"self.colors"})," member variable."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"alert"})," method (optional)."]}),"\n",(0,n.jsx)(t.li,{children:"Customize the header."}),"\n",(0,n.jsx)(t.li,{children:"Customize the footer."}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slide"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize special slide methods, such as ",(0,n.jsx)(t.code,{children:"title-slide"})," and ",(0,n.jsx)(t.code,{children:"focus-slide"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slides"})," method (optional)."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps."}),"\n",(0,n.jsx)(t.h2,{id:"modifying-existing-themes",children:"Modifying Existing Themes"}),"\n",(0,n.jsx)(t.p,{children:"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:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["Copy the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"theme code"})," from the ",(0,n.jsx)(t.code,{children:"themes"})," directory to your local machine. For example, copy ",(0,n.jsx)(t.code,{children:"themes/university.typ"})," to a local file named ",(0,n.jsx)(t.code,{children:"university.typ"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Remove all ",(0,n.jsx)(t.code,{children:'#import "../xxx.typ"'})," commands at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file."]}),"\n",(0,n.jsxs)(t.li,{children:["Add ",(0,n.jsx)(t.code,{children:'#import "@preview/touying:0.4.1": *'})," at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file to import all modules."]}),"\n",(0,n.jsxs)(t.li,{children:["Replace ",(0,n.jsx)(t.code,{children:"self: s"})," in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"})," ",(0,n.jsx)(t.strong,{children:"(Important)"}),"."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"You can then import and use the theme by:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,n.jsxs)(t.p,{children:["For a specific example, refer to: ",(0,n.jsx)(t.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,n.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,n.jsx)(t.p,{children:"Depending on whether the theme is for personal use or part of Touying, you can import in two ways:"}),"\n",(0,n.jsx)(t.p,{children:"If for personal use:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n'})}),"\n",(0,n.jsx)(t.p,{children:"If part of Touying themes:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["Additionally, add the import statement in Touying's ",(0,n.jsx)(t.code,{children:"themes/themes.typ"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,n.jsx)(t.h2,{id:"register-function-and-init-method",children:"Register Function and Init Method"}),"\n",(0,n.jsx)(t.p,{children:"Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted."}),"\n",(0,n.jsx)(t.p,{children:"Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, we created a ",(0,n.jsx)(t.code,{children:"register"})," function and passed an ",(0,n.jsx)(t.code,{children:"aspect-ratio"})," parameter to set the page aspect ratio. We get default ",(0,n.jsx)(t.code,{children:"self"})," by ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"}),". As you might already know, in Touying, we should not use ",(0,n.jsx)(t.code,{children:"set page(..)"})," to set page parameters but rather use the syntax ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to set them, as explained in the Page Layout section."]}),"\n",(0,n.jsxs)(t.p,{children:["In addition, we registered a ",(0,n.jsx)(t.code,{children:"self.methods.init"})," method, which can be used for some global style settings. For example, in this case, we added ",(0,n.jsx)(t.code,{children:"set text(size: 20pt)"})," to set the font size. You can also place additional global style settings here, such as ",(0,n.jsx)(t.code,{children:"set par(justify: true)"}),". Since the ",(0,n.jsx)(t.code,{children:"init"})," function is placed inside ",(0,n.jsx)(t.code,{children:"self.methods"}),", it is a method, not a regular function. Therefore, we need to add the parameter ",(0,n.jsx)(t.code,{children:"self: none"})," to use it properly."]}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, later in ",(0,n.jsx)(t.code,{children:"main.typ"}),", we apply the global style settings in ",(0,n.jsx)(t.code,{children:"init"})," using ",(0,n.jsx)(t.code,{children:"#show: init"}),", where ",(0,n.jsx)(t.code,{children:"init"})," is bound and unpacked through ",(0,n.jsx)(t.code,{children:"utils.methods(s)"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["If you pay extra attention, you'll notice that the ",(0,n.jsx)(t.code,{children:"register"})," function has an independent ",(0,n.jsx)(t.code,{children:"self"})," at the end. This actually represents returning the modified ",(0,n.jsx)(t.code,{children:"self"})," as the return value, which will be saved in ",(0,n.jsx)(t.code,{children:"#let s = .."}),". This line is therefore indispensable."]}),"\n",(0,n.jsx)(t.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Choosing an attractive color theme for your slides is crucial. Touying provides built-in color theme support to minimize API differences between different themes. Touying offers two dimensions of color selection: the first is ",(0,n.jsx)(t.code,{children:"neutral"}),", ",(0,n.jsx)(t.code,{children:"primary"}),", ",(0,n.jsx)(t.code,{children:"secondary"}),", and ",(0,n.jsx)(t.code,{children:"tertiary"})," for hue distinction, with ",(0,n.jsx)(t.code,{children:"primary"})," being the most commonly used; the second is ",(0,n.jsx)(t.code,{children:"default"}),", ",(0,n.jsx)(t.code,{children:"light"}),", ",(0,n.jsx)(t.code,{children:"lighter"}),", ",(0,n.jsx)(t.code,{children:"lightest"}),", ",(0,n.jsx)(t.code,{children:"dark"}),", ",(0,n.jsx)(t.code,{children:"darker"}),", and ",(0,n.jsx)(t.code,{children:"darkest"})," for brightness distinction."]}),"\n",(0,n.jsxs)(t.p,{children:["As we are creating the Bamboo theme, we chose a color for the ",(0,n.jsx)(t.code,{children:"primary"})," theme, similar to bamboo (",(0,n.jsx)(t.code,{children:'rgb("#5E8B65")'}),"), and included neutral lightest/darkest as background and font colors."]}),"\n",(0,n.jsxs)(t.p,{children:["As shown in the code below, we use ",(0,n.jsx)(t.code,{children:"(self.methods.colors)(self: self, ..)"})," to modify the color theme. Essentially, it is a wrapper for ",(0,n.jsx)(t.code,{children:"self.colors += (..)"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["After adding the color theme, we can access the color using syntax like ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"It's worth noting that users can change the theme color at any time using:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,n.jsx)(t.p,{children:"This flexibility demonstrates Touying's powerful customization capabilities."}),"\n",(0,n.jsx)(t.h2,{id:"practical-custom-alert-method",children:"Practical: Custom Alert Method"}),"\n",(0,n.jsxs)(t.p,{children:["In general, we need to provide a ",(0,n.jsx)(t.code,{children:"#alert[..]"})," function for users, similar to ",(0,n.jsx)(t.code,{children:"#strong[..]"}),". Typically, ",(0,n.jsx)(t.code,{children:"#alert[..]"})," emphasizes text using the primary theme color for aesthetics. We add a line in the ",(0,n.jsx)(t.code,{children:"register"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["This code sets the text color to ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),", utilizing the theme's primary color."]}),"\n",(0,n.jsx)(t.h2,{id:"custom-header-and-footer",children:"Custom Header and Footer"}),"\n",(0,n.jsx)(t.p,{children:"Here, assuming you've already read the Page Layout section, we know we should add headers and footers to the slides."}),"\n",(0,n.jsxs)(t.p,{children:["Firstly, we add ",(0,n.jsx)(t.code,{children:"self.bamboo-title = []"}),". This means we save the title of the current slide as a member variable ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),", stored in ",(0,n.jsx)(t.code,{children:"self"}),". This makes it easy to use in the header and later modifications. Similarly, we create ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),", saving the ",(0,n.jsx)(t.code,{children:"footer: []"})," parameter from the ",(0,n.jsx)(t.code,{children:"register"})," function for displaying in the bottom-left corner."]}),"\n",(0,n.jsxs)(t.p,{children:["It's worth noting that our header is actually a content function in the form of ",(0,n.jsx)(t.code,{children:"let header(self) = { .. }"})," with the ",(0,n.jsx)(t.code,{children:"self"})," parameter, allowing us to get the latest information from ",(0,n.jsx)(t.code,{children:"self"}),". For example, ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),". The footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"components.cell"})," used inside is actually ",(0,n.jsx)(t.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),", and ",(0,n.jsx)(t.code,{children:"show: components.cell"})," is shorthand for ",(0,n.jsx)(t.code,{children:"components.cell(body)"}),". The ",(0,n.jsx)(t.code,{children:"show: pad.with(.4em)"})," in the footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["Another point to note is the ",(0,n.jsx)(t.code,{children:"states"})," module, which contains many counters and state-related content. For example, ",(0,n.jsx)(t.code,{children:"states.current-section-title"})," is used to display the current ",(0,n.jsx)(t.code,{children:"section"}),", and ",(0,n.jsx)(t.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," is used to display the current page number and total number of pages."]}),"\n",(0,n.jsxs)(t.p,{children:["We observe the usage of ",(0,n.jsx)(t.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," to display ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),". This is used to handle situations like ",(0,n.jsx)(t.code,{children:"self.bamboo-footer = (self) => {..}"}),", ensuring a unified approach to displaying content functions and content."]}),"\n",(0,n.jsxs)(t.p,{children:["To ensure proper display of the header and footer and sufficient spacing from the main content, we also set margins, such as ",(0,n.jsx)(t.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["We also need to customize a ",(0,n.jsx)(t.code,{children:"slide"})," method that accepts ",(0,n.jsx)(t.code,{children:"slide(self: none, title: auto, ..args)"}),". The first ",(0,n.jsx)(t.code,{children:"self: none"})," is a required method parameter for getting the latest ",(0,n.jsx)(t.code,{children:"self"}),". The second ",(0,n.jsx)(t.code,{children:"title"})," is used to update ",(0,n.jsx)(t.code,{children:"self.bamboo-title"})," for displaying in the header. The third ",(0,n.jsx)(t.code,{children:"..args"})," collects the remaining parameters and passes them to ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, ..args)"}),", which is necessary for the Touying ",(0,n.jsx)(t.code,{children:"slide"})," functionality to work properly. Additionally, we need to register this method in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self.methods.slide = slide"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"custom-special-slide",children:"Custom Special Slide"}),"\n",(0,n.jsxs)(t.p,{children:["Building upon the basic slide, we further add some special slide functions such as ",(0,n.jsx)(t.code,{children:"title-slide"}),", ",(0,n.jsx)(t.code,{children:"focus-slide"}),", and a custom ",(0,n.jsx)(t.code,{children:"slides"})," method."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"title-slide"})," method, first, we call ",(0,n.jsx)(t.code,{children:"self = utils.empty-page(self)"}),". This function clears ",(0,n.jsx)(t.code,{children:"self.page-args.header"}),", ",(0,n.jsx)(t.code,{children:"self.page-args.footer"}),", and sets ",(0,n.jsx)(t.code,{children:"margin"})," to ",(0,n.jsx)(t.code,{children:"0em"}),", creating a blank page effect. Then, we use ",(0,n.jsx)(t.code,{children:"let info = self.info + args.named()"})," to get information stored in ",(0,n.jsx)(t.code,{children:"self.info"})," and update it with the passed ",(0,n.jsx)(t.code,{children:"args.named()"})," for later use as ",(0,n.jsx)(t.code,{children:"info.title"}),". The specific page content ",(0,n.jsx)(t.code,{children:"body"})," will vary for each theme, so we won't go into details here. Finally, we call `(self.methods.touying-slide)(self: self, repeat: none, body"]}),"\n",(0,n.jsxs)(t.p,{children:[")",(0,n.jsx)(t.code,{children:", where "}),"repeat: none",(0,n.jsx)(t.code,{children:"indicates that this page does not require animation effects, and passing the"}),"body` parameter displays its content."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"new-section-slide"})," method, the process is similar. The only thing to note is that in ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"}),", we pass an additional ",(0,n.jsx)(t.code,{children:"section: section"})," parameter to declare the creation of a new section. Another point to note is that besides ",(0,n.jsx)(t.code,{children:"self.methods.new-section-slide = new-section-slide"}),", we also register ",(0,n.jsx)(t.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),", so ",(0,n.jsx)(t.code,{children:"new-section-slide"})," will be automatically called when encountering a first-level title."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"focus-slide"})," method, most of the content is similar, but it's worth noting that we use ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to update the page's background color."]}),"\n",(0,n.jsxs)(t.p,{children:["Finally, we update the ",(0,n.jsx)(t.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," method. When ",(0,n.jsx)(t.code,{children:"title-slide"})," is ",(0,n.jsx)(t.code,{children:"true"}),", using ",(0,n.jsx)(t.code,{children:"#show: slides"})," will automatically create a ",(0,n.jsx)(t.code,{children:"title-slide"}),". Setting ",(0,n.jsx)(t.code,{children:"slide-level: 1"})," indicates that the first-level and second-level titles correspond to ",(0,n.jsx)(t.code,{children:"section"})," and ",(0,n.jsx)(t.code,{children:"title"}),", respectively."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming."})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>l});var n=s(7294);const i={},o=n.createContext(i);function l(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/5a57e638.6764a52d.js b/assets/js/5a57e638.e978d988.js
similarity index 97%
rename from assets/js/5a57e638.6764a52d.js
rename to assets/js/5a57e638.e978d988.js
index f6969dff8..82691db4d 100644
--- a/assets/js/5a57e638.6764a52d.js
+++ b/assets/js/5a57e638.e978d988.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",d={id:"themes/simple",title:"Simple Theme",description:"image",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/docs/next/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-theme",children:"Simple Theme"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["This theme originates from ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),", created by Andreas Kr\xf6pelin."]}),"\n",(0,i.jsx)(n.p,{children:"Considered a relatively straightforward theme, you can use it to create simple slides and freely incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,i.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"background"}),": Background color, defaulting to white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, defaulting to black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, defaulting to ",(0,i.jsx)(n.code,{children:"aqua.darken(50%)"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,i.jsx)(n.p,{children:"The Simple theme provides a variety of custom slide functions:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["A slide with content centered, and the ",(0,i.jsx)(n.code,{children:"section"})," parameter can be used to create a new section."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Similar to ",(0,i.jsx)(n.code,{children:"centered-slide"}),", this is provided for consistency with Polylux syntax."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // simple theme args\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Used to draw attention, it optionally accepts a foreground color (defaulting to ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (defaulting to ",(0,i.jsx)(n.code,{children:"auto"}),", i.e., ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),")."]}),"\n",(0,i.jsxs)(n.h2,{id:"slides-function",children:[(0,i.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"slides"})," function has the following parameter:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can set it using ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["And the function of automatically adding ",(0,i.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/2c599bd1-6250-497f-a65b-f19ae02a16cb",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>o});var i=s(7294);const t={},l=i.createContext(t);function o(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",d={id:"themes/simple",title:"Simple Theme",description:"image",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/docs/next/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-theme",children:"Simple Theme"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["This theme originates from ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),", created by Andreas Kr\xf6pelin."]}),"\n",(0,i.jsx)(n.p,{children:"Considered a relatively straightforward theme, you can use it to create simple slides and freely incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,i.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"background"}),": Background color, defaulting to white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, defaulting to black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, defaulting to ",(0,i.jsx)(n.code,{children:"aqua.darken(50%)"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,i.jsx)(n.p,{children:"The Simple theme provides a variety of custom slide functions:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["A slide with content centered, and the ",(0,i.jsx)(n.code,{children:"section"})," parameter can be used to create a new section."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Similar to ",(0,i.jsx)(n.code,{children:"centered-slide"}),", this is provided for consistency with Polylux syntax."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // simple theme args\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Used to draw attention, it optionally accepts a foreground color (defaulting to ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (defaulting to ",(0,i.jsx)(n.code,{children:"auto"}),", i.e., ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),")."]}),"\n",(0,i.jsxs)(n.h2,{id:"slides-function",children:[(0,i.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"slides"})," function has the following parameter:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can set it using ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["And the function of automatically adding ",(0,i.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/2c599bd1-6250-497f-a65b-f19ae02a16cb",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>o});var i=s(7294);const t={},l=i.createContext(t);function o(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/6607fcb6.18359e4f.js b/assets/js/6607fcb6.4d9db996.js
similarity index 98%
rename from assets/js/6607fcb6.18359e4f.js
rename to assets/js/6607fcb6.4d9db996.js
index ec36f4632..1c8bdf440 100644
--- a/assets/js/6607fcb6.18359e4f.js
+++ b/assets/js/6607fcb6.4d9db996.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8332],{3732:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var i=t(5893),s=t(1151);const o={sidebar_position:7},l="Multi-File Architecture",c={id:"multi-file",title:"Multi-File Architecture",description:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides.",source:"@site/docs/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/docs/next/category/dynamic-slides"}},a={},r=[{value:"Configuration and Content Separation",id:"configuration-and-content-separation",level:2},{value:"Multiple Sections",id:"multiple-sections",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"multi-file-architecture",children:"Multi-File Architecture"}),"\n",(0,i.jsx)(n.p,{children:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides."}),"\n",(0,i.jsx)(n.p,{children:"If you need to write a large set of slides, such as a course manual spanning tens or hundreds of pages, you can also try Touying's multi-file architecture."}),"\n",(0,i.jsx)(n.h2,{id:"configuration-and-content-separation",children:"Configuration and Content Separation"}),"\n",(0,i.jsxs)(n.p,{children:["A simple Touying multi-file architecture consists of three files: a global configuration file ",(0,i.jsx)(n.code,{children:"globals.typ"}),", a main entry file ",(0,i.jsx)(n.code,{children:"main.typ"}),", and a content file ",(0,i.jsx)(n.code,{children:"content.typ"})," for storing the actual content."]}),"\n",(0,i.jsxs)(n.p,{children:["These three files are separated to allow both ",(0,i.jsx)(n.code,{children:"main.typ"})," and ",(0,i.jsx)(n.code,{children:"content.typ"})," to import ",(0,i.jsx)(n.code,{children:"globals.typ"})," without causing circular references."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"globals.typ"})," can be used to store some global custom functions and initialize Touying themes:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"main.typ"}),", as the main entry point of the project, applies show rules by importing ",(0,i.jsx)(n.code,{children:"globals.typ"})," and includes ",(0,i.jsx)(n.code,{children:"content.typ"})," using ",(0,i.jsx)(n.code,{children:"#include"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"content.typ"})," is where you write the actual content:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.h2,{id:"multiple-sections",children:"Multiple Sections"}),"\n",(0,i.jsxs)(n.p,{children:["Implementing multiple sections is also straightforward. You only need to create a ",(0,i.jsx)(n.code,{children:"sections"})," directory and move the ",(0,i.jsx)(n.code,{children:"content.typ"})," file to the ",(0,i.jsx)(n.code,{children:"sections.typ"})," directory, for example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,i.jsx)(n.p,{children:"And"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:"Now, you have learned how to use Touying to achieve a multi-file architecture for large-scale slides."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var i=t(7294);const s={},o=i.createContext(s);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8332],{3732:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var i=t(5893),s=t(1151);const o={sidebar_position:7},l="Multi-File Architecture",c={id:"multi-file",title:"Multi-File Architecture",description:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides.",source:"@site/docs/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/docs/next/category/dynamic-slides"}},a={},r=[{value:"Configuration and Content Separation",id:"configuration-and-content-separation",level:2},{value:"Multiple Sections",id:"multiple-sections",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"multi-file-architecture",children:"Multi-File Architecture"}),"\n",(0,i.jsx)(n.p,{children:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides."}),"\n",(0,i.jsx)(n.p,{children:"If you need to write a large set of slides, such as a course manual spanning tens or hundreds of pages, you can also try Touying's multi-file architecture."}),"\n",(0,i.jsx)(n.h2,{id:"configuration-and-content-separation",children:"Configuration and Content Separation"}),"\n",(0,i.jsxs)(n.p,{children:["A simple Touying multi-file architecture consists of three files: a global configuration file ",(0,i.jsx)(n.code,{children:"globals.typ"}),", a main entry file ",(0,i.jsx)(n.code,{children:"main.typ"}),", and a content file ",(0,i.jsx)(n.code,{children:"content.typ"})," for storing the actual content."]}),"\n",(0,i.jsxs)(n.p,{children:["These three files are separated to allow both ",(0,i.jsx)(n.code,{children:"main.typ"})," and ",(0,i.jsx)(n.code,{children:"content.typ"})," to import ",(0,i.jsx)(n.code,{children:"globals.typ"})," without causing circular references."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"globals.typ"})," can be used to store some global custom functions and initialize Touying themes:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"main.typ"}),", as the main entry point of the project, applies show rules by importing ",(0,i.jsx)(n.code,{children:"globals.typ"})," and includes ",(0,i.jsx)(n.code,{children:"content.typ"})," using ",(0,i.jsx)(n.code,{children:"#include"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"content.typ"})," is where you write the actual content:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.h2,{id:"multiple-sections",children:"Multiple Sections"}),"\n",(0,i.jsxs)(n.p,{children:["Implementing multiple sections is also straightforward. You only need to create a ",(0,i.jsx)(n.code,{children:"sections"})," directory and move the ",(0,i.jsx)(n.code,{children:"content.typ"})," file to the ",(0,i.jsx)(n.code,{children:"sections.typ"})," directory, for example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,i.jsx)(n.p,{children:"And"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:"Now, you have learned how to use Touying to achieve a multi-file architecture for large-scale slides."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var i=t(7294);const s={},o=i.createContext(s);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/7d3539b2.b4866903.js b/assets/js/7d3539b2.06b94f08.js
similarity index 98%
rename from assets/js/7d3539b2.b4866903.js
rename to assets/js/7d3539b2.06b94f08.js
index 97db92914..41cbc191b 100644
--- a/assets/js/7d3539b2.b4866903.js
+++ b/assets/js/7d3539b2.06b94f08.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4481],{6594:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=i(5893),s=i(1151);const l={sidebar_position:4},o="University Theme",r={id:"themes/university",title:"University Theme",description:"image",source:"@site/docs/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"},next:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"}},d={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Title Slide",id:"title-slide",level:3},{value:"Regular Slide",id:"regular-slide",level:3},{value:"Focus Slide",id:"focus-slide",level:3},{value:"Matrix Slide",id:"matrix-slide",level:3},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"university-theme",children:"University Theme"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["This aesthetically pleasing theme is courtesy of ",(0,t.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsx)(n.p,{children:"You can initialize the University theme using the following code:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"register"})," function accepts the following parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"progress-bar"}),": Controls whether the progress bar at the top of each slide is displayed, with the default being ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"display-current-section"}),": Whether to display the current section."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-columns"}),": The width of the footer in the bottom three columns, the default is ",(0,t.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-a"}),": The first column, default is ",(0,t.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-b"}),": Second column, default is ",(0,t.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-c"}),": third column, default is"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Additionally, the University theme provides an ",(0,t.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with the ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," syntax for emphasizing text with ",(0,t.jsx)(n.code,{children:"*alert text*"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,t.jsx)(n.p,{children:"The University theme defaults to the following color theme:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["You can modify this color theme using ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,t.jsx)(n.p,{children:"The University theme provides a series of custom slide functions:"}),"\n",(0,t.jsx)(n.h3,{id:"title-slide",children:"Title Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(logo: none, authors: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"title-slide"})," function reads information from ",(0,t.jsx)(n.code,{children:"self.info"})," for display. You can also pass the ",(0,t.jsx)(n.code,{children:"logo"})," parameter and an array-type ",(0,t.jsx)(n.code,{children:"authors"})," parameter."]}),"\n",(0,t.jsx)(n.h3,{id:"regular-slide",children:"Regular Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The default slide function with a title and footer. The ",(0,t.jsx)(n.code,{children:"title"})," defaults to the current section title, and the footer is set as per your configuration."]}),"\n",(0,t.jsx)(n.h3,{id:"focus-slide",children:"Focus Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Used to capture the audience's attention. The default background color is ",(0,t.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"matrix-slide",children:"Matrix Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Refer to the ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"documentation"}),"."]}),"\n",(0,t.jsxs)(n.h2,{id:"slides-function",children:[(0,t.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,t.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["You can set these parameters using ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["And the function of automatically adding ",(0,t.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",alt:"image"})}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>o});var t=i(7294);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4481],{6594:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=i(5893),s=i(1151);const l={sidebar_position:4},o="University Theme",r={id:"themes/university",title:"University Theme",description:"image",source:"@site/docs/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"},next:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"}},d={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Title Slide",id:"title-slide",level:3},{value:"Regular Slide",id:"regular-slide",level:3},{value:"Focus Slide",id:"focus-slide",level:3},{value:"Matrix Slide",id:"matrix-slide",level:3},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"university-theme",children:"University Theme"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["This aesthetically pleasing theme is courtesy of ",(0,t.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsx)(n.p,{children:"You can initialize the University theme using the following code:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"register"})," function accepts the following parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"progress-bar"}),": Controls whether the progress bar at the top of each slide is displayed, with the default being ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"display-current-section"}),": Whether to display the current section."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-columns"}),": The width of the footer in the bottom three columns, the default is ",(0,t.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-a"}),": The first column, default is ",(0,t.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-b"}),": Second column, default is ",(0,t.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-c"}),": third column, default is"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Additionally, the University theme provides an ",(0,t.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with the ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," syntax for emphasizing text with ",(0,t.jsx)(n.code,{children:"*alert text*"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,t.jsx)(n.p,{children:"The University theme defaults to the following color theme:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["You can modify this color theme using ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,t.jsx)(n.p,{children:"The University theme provides a series of custom slide functions:"}),"\n",(0,t.jsx)(n.h3,{id:"title-slide",children:"Title Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(logo: none, authors: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"title-slide"})," function reads information from ",(0,t.jsx)(n.code,{children:"self.info"})," for display. You can also pass the ",(0,t.jsx)(n.code,{children:"logo"})," parameter and an array-type ",(0,t.jsx)(n.code,{children:"authors"})," parameter."]}),"\n",(0,t.jsx)(n.h3,{id:"regular-slide",children:"Regular Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The default slide function with a title and footer. The ",(0,t.jsx)(n.code,{children:"title"})," defaults to the current section title, and the footer is set as per your configuration."]}),"\n",(0,t.jsx)(n.h3,{id:"focus-slide",children:"Focus Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Used to capture the audience's attention. The default background color is ",(0,t.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"matrix-slide",children:"Matrix Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Refer to the ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"documentation"}),"."]}),"\n",(0,t.jsxs)(n.h2,{id:"slides-function",children:[(0,t.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,t.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["You can set these parameters using ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["And the function of automatically adding ",(0,t.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",alt:"image"})}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>o});var t=i(7294);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/7f65dfb7.e0a5ac39.js b/assets/js/7f65dfb7.26d35ace.js
similarity index 96%
rename from assets/js/7f65dfb7.e0a5ac39.js
rename to assets/js/7f65dfb7.26d35ace.js
index bfb5b56cb..8dd5036c8 100644
--- a/assets/js/7f65dfb7.e0a5ac39.js
+++ b/assets/js/7f65dfb7.26d35ace.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6917],{2049:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>r});var i=n(5893),t=n(1151);const l={sidebar_position:4},o="Code Style",d={id:"code-styles",title:"Code Style",description:"Simple Style",source:"@site/docs/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"},next:{title:"Page Layout",permalink:"/touying/docs/next/layout"}},c={},r=[{value:"Simple Style",id:"simple-style",level:2},{value:"Block Style",id:"block-style",level:2},{value:"Convention Over Configuration",id:"convention-over-configuration",level:2}];function a(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"code-style",children:"Code Style"}),"\n",(0,i.jsx)(s.h2,{id:"simple-style",children:"Simple Style"}),"\n",(0,i.jsxs)(s.p,{children:["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 ",(0,i.jsx)(s.code,{children:"#pause"})," to achieve animation effects."]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["You can use an empty heading ",(0,i.jsx)(s.code,{children:"=="})," to create a new page. This skill also helps clear the continuation of the previous title."]}),"\n",(0,i.jsxs)(s.p,{children:["PS: We can use the ",(0,i.jsx)(s.code,{children:"#slides-end"})," marker to signify the end of ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"block-style",children:"Block Style"}),"\n",(0,i.jsxs)(s.p,{children:["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 ",(0,i.jsx)(s.code,{children:"#slide[...]"}),". The ",(0,i.jsx)(s.code,{children:"#slide"})," function needs to be unpacked using the syntax ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," to be used correctly after ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"For example, the previous example can be transformed into:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["and ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," to create an empty slide without header and footer."]}),"\n",(0,i.jsx)(s.p,{children:"There are many advantages to doing this:"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["Many times, we not only need the default ",(0,i.jsx)(s.code,{children:"#slide[...]"})," but also special ",(0,i.jsx)(s.code,{children:"slide"})," functions like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Different themes' ",(0,i.jsx)(s.code,{children:"#slide[...]"})," functions may have more parameters than the default, such as the university theme's ",(0,i.jsx)(s.code,{children:"#slide[...]"})," function having a ",(0,i.jsx)(s.code,{children:"subtitle"})," parameter."]}),"\n",(0,i.jsxs)(s.li,{children:["Only ",(0,i.jsx)(s.code,{children:"slide"})," functions can use the callback-style content block to achieve complex animation effects with ",(0,i.jsx)(s.code,{children:"#only"})," and ",(0,i.jsx)(s.code,{children:"#uncover"})," functions."]}),"\n",(0,i.jsxs)(s.li,{children:["It has a clearer structure. By identifying ",(0,i.jsx)(s.code,{children:"#slide[...]"})," blocks, we can easily distinguish the specific pagination effects of slides."]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"convention-over-configuration",children:"Convention Over Configuration"}),"\n",(0,i.jsxs)(s.p,{children:["You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," method, so Touying will automatically call this method."]}),"\n",(0,i.jsx)(s.p,{children:"If we don't want it to automatically create such a section slide, we can delete this method:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"As you can see, there are only two pages left, and the default section slide is gone."}),"\n",(0,i.jsx)(s.p,{children:"Similarly, we can register a new section slide:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["Similarly, we can modify ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," to do the same for ",(0,i.jsx)(s.code,{children:"subsection"}),"."]}),"\n",(0,i.jsxs)(s.p,{children:["In fact, besides ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),", another special ",(0,i.jsx)(s.code,{children:"slide"})," function is the ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," function, which will be called by default in simple style when ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is not explicitly used."]}),"\n",(0,i.jsxs)(s.p,{children:["Also, since ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is registered in ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'}),", the ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"})," parameters will be automatically passed, while others like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," will not automatically receive these three parameters."]}),"\n",(0,i.jsxs)(s.admonition,{title:"Principle",type:"tip",children:[(0,i.jsxs)(s.p,{children:["In fact, you can also not use ",(0,i.jsx)(s.code,{children:"#show: slides"})," and ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),", but only use ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),", for example:"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["Here, you need to manually pass in ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"}),", but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages."]})]})]})}function h(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>o});var i=n(7294);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6917],{2049:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>r});var i=n(5893),t=n(1151);const l={sidebar_position:4},o="Code Style",d={id:"code-styles",title:"Code Style",description:"Simple Style",source:"@site/docs/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"},next:{title:"Page Layout",permalink:"/touying/docs/next/layout"}},c={},r=[{value:"Simple Style",id:"simple-style",level:2},{value:"Block Style",id:"block-style",level:2},{value:"Convention Over Configuration",id:"convention-over-configuration",level:2}];function a(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"code-style",children:"Code Style"}),"\n",(0,i.jsx)(s.h2,{id:"simple-style",children:"Simple Style"}),"\n",(0,i.jsxs)(s.p,{children:["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 ",(0,i.jsx)(s.code,{children:"#pause"})," to achieve animation effects."]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["You can use an empty heading ",(0,i.jsx)(s.code,{children:"=="})," to create a new page. This skill also helps clear the continuation of the previous title."]}),"\n",(0,i.jsxs)(s.p,{children:["PS: We can use the ",(0,i.jsx)(s.code,{children:"#slides-end"})," marker to signify the end of ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"block-style",children:"Block Style"}),"\n",(0,i.jsxs)(s.p,{children:["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 ",(0,i.jsx)(s.code,{children:"#slide[...]"}),". The ",(0,i.jsx)(s.code,{children:"#slide"})," function needs to be unpacked using the syntax ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," to be used correctly after ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"For example, the previous example can be transformed into:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["and ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," to create an empty slide without header and footer."]}),"\n",(0,i.jsx)(s.p,{children:"There are many advantages to doing this:"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["Many times, we not only need the default ",(0,i.jsx)(s.code,{children:"#slide[...]"})," but also special ",(0,i.jsx)(s.code,{children:"slide"})," functions like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Different themes' ",(0,i.jsx)(s.code,{children:"#slide[...]"})," functions may have more parameters than the default, such as the university theme's ",(0,i.jsx)(s.code,{children:"#slide[...]"})," function having a ",(0,i.jsx)(s.code,{children:"subtitle"})," parameter."]}),"\n",(0,i.jsxs)(s.li,{children:["Only ",(0,i.jsx)(s.code,{children:"slide"})," functions can use the callback-style content block to achieve complex animation effects with ",(0,i.jsx)(s.code,{children:"#only"})," and ",(0,i.jsx)(s.code,{children:"#uncover"})," functions."]}),"\n",(0,i.jsxs)(s.li,{children:["It has a clearer structure. By identifying ",(0,i.jsx)(s.code,{children:"#slide[...]"})," blocks, we can easily distinguish the specific pagination effects of slides."]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"convention-over-configuration",children:"Convention Over Configuration"}),"\n",(0,i.jsxs)(s.p,{children:["You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," method, so Touying will automatically call this method."]}),"\n",(0,i.jsx)(s.p,{children:"If we don't want it to automatically create such a section slide, we can delete this method:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"As you can see, there are only two pages left, and the default section slide is gone."}),"\n",(0,i.jsx)(s.p,{children:"Similarly, we can register a new section slide:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["Similarly, we can modify ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," to do the same for ",(0,i.jsx)(s.code,{children:"subsection"}),"."]}),"\n",(0,i.jsxs)(s.p,{children:["In fact, besides ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),", another special ",(0,i.jsx)(s.code,{children:"slide"})," function is the ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," function, which will be called by default in simple style when ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is not explicitly used."]}),"\n",(0,i.jsxs)(s.p,{children:["Also, since ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is registered in ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'}),", the ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"})," parameters will be automatically passed, while others like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," will not automatically receive these three parameters."]}),"\n",(0,i.jsxs)(s.admonition,{title:"Principle",type:"tip",children:[(0,i.jsxs)(s.p,{children:["In fact, you can also not use ",(0,i.jsx)(s.code,{children:"#show: slides"})," and ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),", but only use ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),", for example:"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["Here, you need to manually pass in ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"}),", but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages."]})]})]})}function h(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>o});var i=n(7294);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/80a0c88e.a9a1492a.js b/assets/js/80a0c88e.b733f954.js
similarity index 98%
rename from assets/js/80a0c88e.a9a1492a.js
rename to assets/js/80a0c88e.b733f954.js
index b0fc8b666..28b915d97 100644
--- a/assets/js/80a0c88e.a9a1492a.js
+++ b/assets/js/80a0c88e.b733f954.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3209],{8135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="Metropolis Theme",r={id:"themes/metropolis",title:"Metropolis Theme",description:"image",source:"@site/docs/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/docs/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Theme",permalink:"/touying/docs/next/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"}},d={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"metropolis-theme",children:"Metropolis Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/383ceb22-f696-4450-83a6-c0f17e4597e1",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme draws inspiration from Matthias Vogelgesang's ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme is elegant and suitable for everyday use. It is recommended to have Fira Sans and Fira Math fonts installed on your computer for the best results."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content displayed in the header, defaulting to ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.title"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-progress"}),": Whether to show the progress bar at the bottom of the slide, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Metropolis theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Metropolis uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary-dark"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4ab45ee6-09f7-498b-b349-e889d6e42e3e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3209],{8135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="Metropolis Theme",r={id:"themes/metropolis",title:"Metropolis Theme",description:"image",source:"@site/docs/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/docs/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Theme",permalink:"/touying/docs/next/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"}},d={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"metropolis-theme",children:"Metropolis Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/383ceb22-f696-4450-83a6-c0f17e4597e1",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme draws inspiration from Matthias Vogelgesang's ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme is elegant and suitable for everyday use. It is recommended to have Fira Sans and Fira Math fonts installed on your computer for the best results."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content displayed in the header, defaulting to ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.title"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-progress"}),": Whether to show the progress bar at the bottom of the slide, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Metropolis theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Metropolis uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary-dark"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4ab45ee6-09f7-498b-b349-e889d6e42e3e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/8ac96054.67767120.js b/assets/js/8ac96054.96187a17.js
similarity index 98%
rename from assets/js/8ac96054.67767120.js
rename to assets/js/8ac96054.96187a17.js
index 6dcc64ef8..29def8c5d 100644
--- a/assets/js/8ac96054.67767120.js
+++ b/assets/js/8ac96054.96187a17.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9527],{3680:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>p,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(5893),o=t(1151);const s={sidebar_position:1},d="Pdfpc",r={id:"external/pdfpc",title:"Pdfpc",description:'pdfpc is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.',source:"@site/docs/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/docs/next/external/pympress"}},a={},c=[{value:"Adding Metadata",id:"adding-metadata",level:2},{value:"Pdfpc Configuration",id:"pdfpc-configuration",level:2},{value:"Exporting .pdfpc File",id:"exporting-pdfpc-file",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"pdfpc",children:"Pdfpc"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"pdfpc"}),' is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.']}),"\n",(0,i.jsxs)(n.p,{children:["pdfpc has a JSON-formatted ",(0,i.jsx)(n.code,{children:".pdfpc"})," file that can provide additional information for PDF slides. While you can manually write this file, you can also manage it through Touying."]}),"\n",(0,i.jsx)(n.h2,{id:"adding-metadata",children:"Adding Metadata"}),"\n",(0,i.jsxs)(n.p,{children:["Touying remains consistent with ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," to avoid conflicts between APIs."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, you can add notes using ",(0,i.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pdfpc-configuration",children:"Pdfpc Configuration"}),"\n",(0,i.jsx)(n.p,{children:"To add pdfpc configurations, you can use"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Add the corresponding configurations. Refer to ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," for specific configuration details."]}),"\n",(0,i.jsx)(n.h2,{id:"exporting-pdfpc-file",children:"Exporting .pdfpc File"}),"\n",(0,i.jsxs)(n.p,{children:["Assuming your document is ",(0,i.jsx)(n.code,{children:"./example.typ"}),", you can export the ",(0,i.jsx)(n.code,{children:".pdfpc"})," file directly using:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,i.jsx)(n.p,{children:"With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>d});var i=t(7294);const o={},s=i.createContext(o);function d(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:d(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9527],{3680:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>p,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(5893),o=t(1151);const s={sidebar_position:1},d="Pdfpc",r={id:"external/pdfpc",title:"Pdfpc",description:'pdfpc is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.',source:"@site/docs/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/docs/next/external/pympress"}},a={},c=[{value:"Adding Metadata",id:"adding-metadata",level:2},{value:"Pdfpc Configuration",id:"pdfpc-configuration",level:2},{value:"Exporting .pdfpc File",id:"exporting-pdfpc-file",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"pdfpc",children:"Pdfpc"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"pdfpc"}),' is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.']}),"\n",(0,i.jsxs)(n.p,{children:["pdfpc has a JSON-formatted ",(0,i.jsx)(n.code,{children:".pdfpc"})," file that can provide additional information for PDF slides. While you can manually write this file, you can also manage it through Touying."]}),"\n",(0,i.jsx)(n.h2,{id:"adding-metadata",children:"Adding Metadata"}),"\n",(0,i.jsxs)(n.p,{children:["Touying remains consistent with ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," to avoid conflicts between APIs."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, you can add notes using ",(0,i.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pdfpc-configuration",children:"Pdfpc Configuration"}),"\n",(0,i.jsx)(n.p,{children:"To add pdfpc configurations, you can use"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Add the corresponding configurations. Refer to ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," for specific configuration details."]}),"\n",(0,i.jsx)(n.h2,{id:"exporting-pdfpc-file",children:"Exporting .pdfpc File"}),"\n",(0,i.jsxs)(n.p,{children:["Assuming your document is ",(0,i.jsx)(n.code,{children:"./example.typ"}),", you can export the ",(0,i.jsx)(n.code,{children:".pdfpc"})," file directly using:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,i.jsx)(n.p,{children:"With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>d});var i=t(7294);const o={},s=i.createContext(o);function d(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:d(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/98ce8162.0db38a50.js b/assets/js/98ce8162.287e62b5.js
similarity index 98%
rename from assets/js/98ce8162.0db38a50.js
rename to assets/js/98ce8162.287e62b5.js
index 32f555e4d..244676fc3 100644
--- a/assets/js/98ce8162.0db38a50.js
+++ b/assets/js/98ce8162.287e62b5.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const o={sidebar_position:2},r="Getting Started",a={id:"start",title:"Getting Started",description:"Before you begin, make sure you have the Typst environment installed. If not, you can use the Web App or install the Tinymist LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to Touying",permalink:"/touying/docs/next/intro"},next:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"}},l={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["Before you begin, make sure you have the Typst environment installed. If not, you can use the ",(0,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or install the ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," and ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," plugins for VS Code."]}),"\n",(0,i.jsx)(n.p,{children:"To use Touying, you just need to include the following in your document:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"It's that simple! You've created your first Touying slides. Congratulations! \ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip:"})," You can use Typst syntax like ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," or ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," to implement Touying's multi-file architecture."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Warning:"})," The comma in ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," is necessary for the unpacking syntax."]}),"\n",(0,i.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, Touying provides various styles for slide writing. You can also use the ",(0,i.jsx)(n.code,{children:"#slide[..]"})," syntax to access more powerful features provided by Touying."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const o={sidebar_position:2},r="Getting Started",a={id:"start",title:"Getting Started",description:"Before you begin, make sure you have the Typst environment installed. If not, you can use the Web App or install the Tinymist LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to Touying",permalink:"/touying/docs/next/intro"},next:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"}},l={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["Before you begin, make sure you have the Typst environment installed. If not, you can use the ",(0,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or install the ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," and ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," plugins for VS Code."]}),"\n",(0,i.jsx)(n.p,{children:"To use Touying, you just need to include the following in your document:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"It's that simple! You've created your first Touying slides. Congratulations! \ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip:"})," You can use Typst syntax like ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," or ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," to implement Touying's multi-file architecture."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Warning:"})," The comma in ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," is necessary for the unpacking syntax."]}),"\n",(0,i.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, Touying provides various styles for slide writing. You can also use the ",(0,i.jsx)(n.code,{children:"#slide[..]"})," syntax to access more powerful features provided by Touying."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/ab32da60.1d07324a.js b/assets/js/ab32da60.7b00de2b.js
similarity index 96%
rename from assets/js/ab32da60.1d07324a.js
rename to assets/js/ab32da60.7b00de2b.js
index c8c3e3162..81cf779c1 100644
--- a/assets/js/ab32da60.1d07324a.js
+++ b/assets/js/ab32da60.7b00de2b.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7190],{7022:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},l="Sections and Subsections",c={id:"sections",title:"Sections and Subsections",description:"Structure",source:"@site/docs/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/next/start"},next:{title:"Code Style",permalink:"/touying/docs/next/code-styles"}},r={},d=[{value:"Structure",id:"structure",level:2},{value:"Numbering",id:"numbering",level:2},{value:"Table of Contents",id:"table-of-contents",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.h2,{id:"structure",children:"Structure"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concept of sections and subsections."}),"\n",(0,s.jsx)(n.p,{children:"Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"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."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["In fact, we can control this behavior through the ",(0,s.jsx)(n.code,{children:"slide-level"})," parameter of the ",(0,s.jsx)(n.code,{children:"slides"})," function. ",(0,s.jsx)(n.code,{children:"slide-level"})," represents the complexity of the nested structure, starting from 0. For example, ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," is equivalent to the section, subsection, and title structure; while ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," is equivalent to the section and title structure."]}),"\n",(0,s.jsx)(n.h2,{id:"numbering",children:"Numbering"}),"\n",(0,s.jsx)(n.p,{children:"To add numbering to sections and subsections, we simply use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["This sets the default numbering to ",(0,s.jsx)(n.code,{children:"1.1"}),", with the section corresponding to ",(0,s.jsx)(n.code,{children:"1."}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsx)(n.p,{children:"Displaying a table of contents in Touying is straightforward:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["Where the definition of ",(0,s.jsx)(n.code,{children:"touying-outline()"})," is:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify the parameters of the internal enum through ",(0,s.jsx)(n.code,{children:"enum-args"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If you have complex custom requirements for the table of contents, you can use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,s.jsx)(n.p,{children:"As done in the dewdrop theme."})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7190],{7022:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},l="Sections and Subsections",c={id:"sections",title:"Sections and Subsections",description:"Structure",source:"@site/docs/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/next/start"},next:{title:"Code Style",permalink:"/touying/docs/next/code-styles"}},r={},d=[{value:"Structure",id:"structure",level:2},{value:"Numbering",id:"numbering",level:2},{value:"Table of Contents",id:"table-of-contents",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.h2,{id:"structure",children:"Structure"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concept of sections and subsections."}),"\n",(0,s.jsx)(n.p,{children:"Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"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."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["In fact, we can control this behavior through the ",(0,s.jsx)(n.code,{children:"slide-level"})," parameter of the ",(0,s.jsx)(n.code,{children:"slides"})," function. ",(0,s.jsx)(n.code,{children:"slide-level"})," represents the complexity of the nested structure, starting from 0. For example, ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," is equivalent to the section, subsection, and title structure; while ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," is equivalent to the section and title structure."]}),"\n",(0,s.jsx)(n.h2,{id:"numbering",children:"Numbering"}),"\n",(0,s.jsx)(n.p,{children:"To add numbering to sections and subsections, we simply use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["This sets the default numbering to ",(0,s.jsx)(n.code,{children:"1.1"}),", with the section corresponding to ",(0,s.jsx)(n.code,{children:"1."}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsx)(n.p,{children:"Displaying a table of contents in Touying is straightforward:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["Where the definition of ",(0,s.jsx)(n.code,{children:"touying-outline()"})," is:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify the parameters of the internal enum through ",(0,s.jsx)(n.code,{children:"enum-args"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If you have complex custom requirements for the table of contents, you can use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,s.jsx)(n.p,{children:"As done in the dewdrop theme."})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/c38df086.3a34d537.js b/assets/js/c38df086.21aead31.js
similarity index 98%
rename from assets/js/c38df086.3a34d537.js
rename to assets/js/c38df086.21aead31.js
index cf9c5fe9e..e330619a1 100644
--- a/assets/js/c38df086.3a34d537.js
+++ b/assets/js/c38df086.21aead31.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6154],{82:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var i=t(5893),o=t(1151);const s={sidebar_position:1},a="Pinit",p={id:"integration/pinit",title:"Pinit",description:'Pinit package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.',source:"@site/docs/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"}},r={},l=[{value:"Simple Example",id:"simple-example",level:2},{value:"Complex Example",id:"complex-example",level:2}];function c(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"}),' package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.']}),"\n",(0,i.jsx)(e.h2,{id:"simple-example",children:"Simple Example"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(e.p,{children:["Another ",(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"example"}),":"]}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(e.h2,{id:"complex-example",children:"Complex Example"}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(e.p,{children:"An example of shared usage with Touying:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:e}={...(0,o.a)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>p,a:()=>a});var i=t(7294);const o={},s=i.createContext(o);function a(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:a(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6154],{82:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var i=t(5893),o=t(1151);const s={sidebar_position:1},a="Pinit",p={id:"integration/pinit",title:"Pinit",description:'Pinit package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.',source:"@site/docs/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"}},r={},l=[{value:"Simple Example",id:"simple-example",level:2},{value:"Complex Example",id:"complex-example",level:2}];function c(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"}),' package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.']}),"\n",(0,i.jsx)(e.h2,{id:"simple-example",children:"Simple Example"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(e.p,{children:["Another ",(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"example"}),":"]}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(e.h2,{id:"complex-example",children:"Complex Example"}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(e.p,{children:"An example of shared usage with Touying:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:e}={...(0,o.a)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>p,a:()=>a});var i=t(7294);const o={},s=i.createContext(o);function a(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:a(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/d16cbc15.e70ad829.js b/assets/js/d16cbc15.5450aa44.js
similarity index 98%
rename from assets/js/d16cbc15.e70ad829.js
rename to assets/js/d16cbc15.5450aa44.js
index c0b48a5cf..a5dabf9c5 100644
--- a/assets/js/d16cbc15.e70ad829.js
+++ b/assets/js/d16cbc15.5450aa44.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2403],{9741:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var s=i(5893),t=i(1151);const l={sidebar_position:3},o="Dewdrop Theme",d={id:"themes/dewdrop",title:"Dewdrop Theme",description:"image",source:"@site/docs/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/docs/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"},next:{title:"University Theme",permalink:"/touying/docs/next/themes/university"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Special Functions",id:"special-functions",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"dewdrop-theme",children:"Dewdrop Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme takes inspiration from Zhibo Wang's ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme features an elegantly designed navigation, including two modes: ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),": The navigation bar style, which can be ",(0,s.jsx)(n.code,{children:'"sidebar"'}),", ",(0,s.jsx)(n.code,{children:'"mini-slides"'}),", or ",(0,s.jsx)(n.code,{children:"none"}),", defaulting to ",(0,s.jsx)(n.code,{children:'"sidebar"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Sidebar navigation settings, defaulting to ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Mini-slides settings, defaulting to ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"height"}),": The height of mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"x"}),": Padding on the x-axis for mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"section"}),": Whether to display slides after the section and before the subsection, defaulting to ",(0,s.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"subsection"}),": Whether to split mini-slides based on subsections or compress them into one line, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"primary"}),": Primary color, defaulting to ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, defaulting to ",(0,s.jsx)(n.code,{children:"70%"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Dewdrop uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-darkest: rgb("#000000"),\n neutral-dark: rgb("#202020"),\n neutral-light: rgb("#f3f3f3"),\n neutral-lightest: rgb("#ffffff"),\n primary: primary,\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Dewdrop theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with navigation and footer, where the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"special-functions",children:"Special Functions"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Displays the current table of contents. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections in an inactive state."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display the sidebar."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display mini-slides."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"2"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/09ddfb40-4f97-4062-8261-23f87690c33e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2403],{9741:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var s=i(5893),t=i(1151);const l={sidebar_position:3},o="Dewdrop Theme",d={id:"themes/dewdrop",title:"Dewdrop Theme",description:"image",source:"@site/docs/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/docs/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"},next:{title:"University Theme",permalink:"/touying/docs/next/themes/university"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Special Functions",id:"special-functions",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"dewdrop-theme",children:"Dewdrop Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme takes inspiration from Zhibo Wang's ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme features an elegantly designed navigation, including two modes: ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),": The navigation bar style, which can be ",(0,s.jsx)(n.code,{children:'"sidebar"'}),", ",(0,s.jsx)(n.code,{children:'"mini-slides"'}),", or ",(0,s.jsx)(n.code,{children:"none"}),", defaulting to ",(0,s.jsx)(n.code,{children:'"sidebar"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Sidebar navigation settings, defaulting to ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Mini-slides settings, defaulting to ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"height"}),": The height of mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"x"}),": Padding on the x-axis for mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"section"}),": Whether to display slides after the section and before the subsection, defaulting to ",(0,s.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"subsection"}),": Whether to split mini-slides based on subsections or compress them into one line, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"primary"}),": Primary color, defaulting to ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, defaulting to ",(0,s.jsx)(n.code,{children:"70%"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Dewdrop uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-darkest: rgb("#000000"),\n neutral-dark: rgb("#202020"),\n neutral-light: rgb("#f3f3f3"),\n neutral-lightest: rgb("#ffffff"),\n primary: primary,\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Dewdrop theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with navigation and footer, where the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"special-functions",children:"Special Functions"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Displays the current table of contents. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections in an inactive state."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display the sidebar."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display mini-slides."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"2"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/09ddfb40-4f97-4062-8261-23f87690c33e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/d287f9e6.06a655ad.js b/assets/js/d287f9e6.1b25ce7b.js
similarity index 97%
rename from assets/js/d287f9e6.06a655ad.js
rename to assets/js/d287f9e6.1b25ce7b.js
index 96cc398d6..45738e0c3 100644
--- a/assets/js/d287f9e6.06a655ad.js
+++ b/assets/js/d287f9e6.1b25ce7b.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[612],{1344:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var i=n(5893),o=n(1151);const s={sidebar_position:5},r="Codly",l={id:"integration/codly",title:"Codly",description:"When using Codly, we should initialize it using the s.methods.append-preamble method.",source:"@site/docs/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/docs/next/integration/ctheorems"}},d={},c=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,i.jsxs)(t.p,{children:["When using Codly, we should initialize it using the ",(0,i.jsx)(t.code,{children:"s.methods.append-preamble"})," method."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var i=n(7294);const o={},s=i.createContext(o);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[612],{1344:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var i=n(5893),o=n(1151);const s={sidebar_position:5},r="Codly",l={id:"integration/codly",title:"Codly",description:"When using Codly, we should initialize it using the s.methods.append-preamble method.",source:"@site/docs/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/docs/next/integration/ctheorems"}},d={},c=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,i.jsxs)(t.p,{children:["When using Codly, we should initialize it using the ",(0,i.jsx)(t.code,{children:"s.methods.append-preamble"})," method."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var i=n(7294);const o={},s=i.createContext(o);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/f3a7b3b2.232f5b0b.js b/assets/js/f3a7b3b2.b1e52f6b.js
similarity index 99%
rename from assets/js/f3a7b3b2.232f5b0b.js
rename to assets/js/f3a7b3b2.b1e52f6b.js
index be5d285e8..ae14c5b5d 100644
--- a/assets/js/f3a7b3b2.232f5b0b.js
+++ b/assets/js/f3a7b3b2.b1e52f6b.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9916],{1075:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var s=n(5893),i=n(1151);const o={sidebar_position:6},l="Global Settings",a={id:"global-settings",title:"Global Settings",description:"Global Styles",source:"@site/docs/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Page Layout",permalink:"/touying/docs/next/layout"},next:{title:"Multi-File Architecture",permalink:"/touying/docs/next/multi-file"}},r={},d=[{value:"Global Styles",id:"global-styles",level:2},{value:"Global Information",id:"global-information",level:2},{value:"State Initialization",id:"state-initialization",level:2}];function c(e){const t={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"global-settings",children:"Global Settings"}),"\n",(0,s.jsx)(t.h2,{id:"global-styles",children:"Global Styles"}),"\n",(0,s.jsxs)(t.p,{children:["For Touying, global styles refer to set rules or show rules that need to be applied everywhere, such as ",(0,s.jsx)(t.code,{children:"#set text(size: 20pt)"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["Themes in Touying encapsulate some of their own global styles, which are placed in ",(0,s.jsx)(t.code,{children:"#show: init"}),". For example, the university theme encapsulates the following:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you are not a theme creator but want to add your own global styles to your slides, you can simply place them after ",(0,s.jsx)(t.code,{children:"#show: init"})," and before ",(0,s.jsx)(t.code,{children:"#show: slides"}),". For example, the metropolis theme recommends adding the following global styles:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(t.p,{children:["However, note that you should not use ",(0,s.jsx)(t.code,{children:"#set page(..)"}),". Instead, modify ",(0,s.jsx)(t.code,{children:"s.page-args"})," and ",(0,s.jsx)(t.code,{children:"s.padding"}),", for example:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,s.jsx)(t.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(t.p,{children:"Like Beamer, Touying, through an OOP-style unified API design, can help you better maintain global information, allowing you to easily switch between different themes. Global information is a typical example of this."}),"\n",(0,s.jsx)(t.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:["In subsequent slides, you can access them through ",(0,s.jsx)(t.code,{children:"s.info"})," or ",(0,s.jsx)(t.code,{children:"self.info"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"This information is generally used in the title-slide, header, and footer of the theme, for example:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"date"})," can accept ",(0,s.jsx)(t.code,{children:"datetime"})," format or ",(0,s.jsx)(t.code,{children:"content"})," format, and the display format for the ",(0,s.jsx)(t.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(t.admonition,{title:"Principle",type:"tip",children:[(0,s.jsx)(t.p,{children:"Here, we will introduce a bit of OOP concept in Touying."}),(0,s.jsxs)(t.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering, which means Typst caches the results of previous function calls. This requires that Typst consists of pure functions, meaning functions that do not change external variables. Thus, it is challenging to modify a global variable in the true sense, even with the use of ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"}),". This would require the use of ",(0,s.jsx)(t.code,{children:"locate"})," with callback functions to obtain the values inside, and this approach would have a significant impact on performance."]}),(0,s.jsxs)(t.p,{children:["Touying does not use ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"})," and does not violate the principle of pure functions in Typst. Instead, it uses a clever approach in an object-oriented style, maintaining a global singleton ",(0,s.jsx)(t.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We agree that methods all have a named parameter ",(0,s.jsx)(t.code,{children:"self"})," for passing the object itself, and methods are placed in the ",(0,s.jsx)(t.code,{children:".methods"})," domain. With this concept, it becomes easier to write methods to update ",(0,s.jsx)(t.code,{children:"info"}),":"]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (\n info: (:),\n methods: (\n // update info\n info: (self: none, ..args) => {\n self.info += args.named()\n self\n },\n )\n)\n\n#let s = (s.methods.info)(self: s, title: [title])\n\nTitle is #s.info.title\n"})}),(0,s.jsxs)(t.p,{children:["Now you can understand the purpose of the ",(0,s.jsx)(t.code,{children:"utils.methods()"})," function: to bind ",(0,s.jsx)(t.code,{children:"self"})," to all methods of ",(0,s.jsx)(t.code,{children:"s"})," and return it, simplifying the subsequent usage through unpacking syntax."]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(t.h2,{id:"state-initialization",children:"State Initialization"}),"\n",(0,s.jsxs)(t.p,{children:["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 ",(0,s.jsx)(t.code,{children:"#show: slides"}),", a blank page will be created, which is something we don't want to see. In such cases, you can use the ",(0,s.jsx)(t.code,{children:"s.methods.append-preamble"})," method. For example, when using the codly package:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,s.jsx)(t.p,{children:"Or when configuring Pdfpc:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>l});var s=n(7294);const i={},o=s.createContext(i);function l(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9916],{1075:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var s=n(5893),i=n(1151);const o={sidebar_position:6},l="Global Settings",a={id:"global-settings",title:"Global Settings",description:"Global Styles",source:"@site/docs/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Page Layout",permalink:"/touying/docs/next/layout"},next:{title:"Multi-File Architecture",permalink:"/touying/docs/next/multi-file"}},r={},d=[{value:"Global Styles",id:"global-styles",level:2},{value:"Global Information",id:"global-information",level:2},{value:"State Initialization",id:"state-initialization",level:2}];function c(e){const t={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"global-settings",children:"Global Settings"}),"\n",(0,s.jsx)(t.h2,{id:"global-styles",children:"Global Styles"}),"\n",(0,s.jsxs)(t.p,{children:["For Touying, global styles refer to set rules or show rules that need to be applied everywhere, such as ",(0,s.jsx)(t.code,{children:"#set text(size: 20pt)"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["Themes in Touying encapsulate some of their own global styles, which are placed in ",(0,s.jsx)(t.code,{children:"#show: init"}),". For example, the university theme encapsulates the following:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you are not a theme creator but want to add your own global styles to your slides, you can simply place them after ",(0,s.jsx)(t.code,{children:"#show: init"})," and before ",(0,s.jsx)(t.code,{children:"#show: slides"}),". For example, the metropolis theme recommends adding the following global styles:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(t.p,{children:["However, note that you should not use ",(0,s.jsx)(t.code,{children:"#set page(..)"}),". Instead, modify ",(0,s.jsx)(t.code,{children:"s.page-args"})," and ",(0,s.jsx)(t.code,{children:"s.padding"}),", for example:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,s.jsx)(t.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(t.p,{children:"Like Beamer, Touying, through an OOP-style unified API design, can help you better maintain global information, allowing you to easily switch between different themes. Global information is a typical example of this."}),"\n",(0,s.jsx)(t.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:["In subsequent slides, you can access them through ",(0,s.jsx)(t.code,{children:"s.info"})," or ",(0,s.jsx)(t.code,{children:"self.info"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"This information is generally used in the title-slide, header, and footer of the theme, for example:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"date"})," can accept ",(0,s.jsx)(t.code,{children:"datetime"})," format or ",(0,s.jsx)(t.code,{children:"content"})," format, and the display format for the ",(0,s.jsx)(t.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(t.admonition,{title:"Principle",type:"tip",children:[(0,s.jsx)(t.p,{children:"Here, we will introduce a bit of OOP concept in Touying."}),(0,s.jsxs)(t.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering, which means Typst caches the results of previous function calls. This requires that Typst consists of pure functions, meaning functions that do not change external variables. Thus, it is challenging to modify a global variable in the true sense, even with the use of ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"}),". This would require the use of ",(0,s.jsx)(t.code,{children:"locate"})," with callback functions to obtain the values inside, and this approach would have a significant impact on performance."]}),(0,s.jsxs)(t.p,{children:["Touying does not use ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"})," and does not violate the principle of pure functions in Typst. Instead, it uses a clever approach in an object-oriented style, maintaining a global singleton ",(0,s.jsx)(t.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We agree that methods all have a named parameter ",(0,s.jsx)(t.code,{children:"self"})," for passing the object itself, and methods are placed in the ",(0,s.jsx)(t.code,{children:".methods"})," domain. With this concept, it becomes easier to write methods to update ",(0,s.jsx)(t.code,{children:"info"}),":"]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (\n info: (:),\n methods: (\n // update info\n info: (self: none, ..args) => {\n self.info += args.named()\n self\n },\n )\n)\n\n#let s = (s.methods.info)(self: s, title: [title])\n\nTitle is #s.info.title\n"})}),(0,s.jsxs)(t.p,{children:["Now you can understand the purpose of the ",(0,s.jsx)(t.code,{children:"utils.methods()"})," function: to bind ",(0,s.jsx)(t.code,{children:"self"})," to all methods of ",(0,s.jsx)(t.code,{children:"s"})," and return it, simplifying the subsequent usage through unpacking syntax."]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(t.h2,{id:"state-initialization",children:"State Initialization"}),"\n",(0,s.jsxs)(t.p,{children:["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 ",(0,s.jsx)(t.code,{children:"#show: slides"}),", a blank page will be created, which is something we don't want to see. In such cases, you can use the ",(0,s.jsx)(t.code,{children:"s.methods.append-preamble"})," method. For example, when using the codly package:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,s.jsx)(t.p,{children:"Or when configuring Pdfpc:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>l});var s=n(7294);const i={},o=s.createContext(i);function l(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.939ad99e.js b/assets/js/runtime~main.9eada2e8.js
similarity index 74%
rename from assets/js/runtime~main.939ad99e.js
rename to assets/js/runtime~main.9eada2e8.js
index 1bf2083f2..1718b3c44 100644
--- a/assets/js/runtime~main.939ad99e.js
+++ b/assets/js/runtime~main.9eada2e8.js
@@ -1 +1 @@
-(()=>{"use strict";var e,c,f,a,b,d={},t={};function r(e){var c=t[e];if(void 0!==c)return c.exports;var f=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(f.exports,f,f.exports,r),f.loaded=!0,f.exports}r.m=d,r.c=t,e=[],r.O=(c,f,a,b)=>{if(!f){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[f,a,b]},r.n=e=>{var c=e&&e.__esModule?()=>e.default:()=>e;return r.d(c,{a:c}),c},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};c=c||[null,f({}),f([]),f(f)];for(var t=2&a&&e;"object"==typeof t&&!~c.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((c=>d[c]=()=>e[c]));return d.default=()=>e,r.d(b,d),b},r.d=(e,c)=>{for(var f in c)r.o(c,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:c[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((c,f)=>(r.f[f](e,c),c)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",69:"018a1506",80:"2c0b54ac",196:"d9bab663",263:"5c062049",417:"080c9bd0",438:"5de4625c",498:"2cc1595c",513:"b6606f5f",530:"e5b11173",612:"d287f9e6",876:"b035a2d2",915:"648478e2",997:"5670b452",1039:"35b233e8",1049:"b472294c",1053:"c51e9508",1089:"04b649ca",1110:"5eea6960",1317:"9cec3c93",1400:"495c719e",1498:"e511abbf",1543:"98ce8162",1546:"92f7ac8d",1560:"0275f7e4",1581:"f8777534",1588:"f80396ac",1626:"a449492b",1827:"5806a9e1",1860:"67bae27a",1893:"340f1526",1949:"7c9c7243",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2216:"c7f97b4e",2289:"51a4d3bf",2322:"f24a23d8",2403:"d16cbc15",2418:"e9b496d5",2432:"116fbef0",2464:"b5dfb830",2528:"ae31ff46",2529:"3143bd0d",2535:"814f3328",2551:"c37d3efc",2701:"1aab1ab5",2707:"ada9f060",2751:"890ef1f8",2784:"f65f6456",2786:"267f059f",2792:"0d1c87af",2830:"86e5cb88",2847:"7927a478",2865:"82487ba9",2868:"ce57b2d1",2925:"d848b1c8",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3134:"86f810a5",3135:"7ba330a5",3209:"80a0c88e",3263:"91bd08ce",3280:"4bb9edb3",3376:"6c8708e3",3389:"4c713790",3432:"de4f60ff",3608:"9e4087bc",3651:"1514c4f3",3655:"b1a1bf59",3684:"797defb6",3715:"583d85fc",3808:"ce30cdaf",3832:"e6bd25e0",3942:"14c08683",3969:"5b27bc59",3994:"41abee02",4013:"01a85c17",4042:"65e4303d",4067:"4e3d17c1",4195:"c4f5d8e4",4288:"a732a165",4368:"a94703ab",4447:"28a86b5d",4450:"c60ded92",4481:"7d3539b2",4599:"a94a4682",4618:"8e2c1ca5",4621:"0479d12b",4725:"06e0043a",4733:"173c8b24",4770:"bf750d2c",4823:"17588091",4842:"0c7d33f3",4873:"83b73936",4984:"b8fd1f7e",5022:"3b36ca8e",5030:"7f50710c",5094:"a3b8b6db",5096:"bef23ce3",5106:"6c1ba8b1",5151:"43e6fa63",5313:"4919068e",5332:"8ded3f77",5428:"11366869",5431:"7329c3b8",5526:"2553c37c",5598:"65e4cc1e",5609:"5035b6a4",5617:"54ea3d6a",5619:"ecfd88b4",5635:"1cf5eacf",5651:"359eb289",5675:"bce42248",5695:"6d7ce909",5701:"5539901a",5739:"717af290",5832:"926843be",5854:"5057383c",5870:"4b91b61e",5921:"1b6fd54f",5954:"ff235272",6085:"3d438ec7",6099:"58092a00",6103:"ccc49370",6114:"89f39702",6118:"c9566e8a",6142:"f2bffab0",6154:"c38df086",6175:"58132609",6193:"864ebe97",6232:"f554ac40",6259:"55b57bd3",6296:"286c2c64",6403:"ad972684",6518:"3fefcd96",6526:"41a6ae87",6567:"b2b68e5a",6662:"555ecac1",6679:"a7cd7c6a",6685:"65dfabbc",6721:"38803c52",6864:"cbce90b2",6893:"d85491b0",6902:"024af9ce",6917:"7f65dfb7",7060:"9f9db465",7190:"ab32da60",7224:"d4a2dc55",7335:"850166d8",7414:"393be207",7503:"05ed0e1f",7504:"5297811e",7545:"2b9fd23c",7668:"acfad3c9",7701:"df5b4e08",7836:"02f62403",7918:"17896441",8010:"99d50e1d",8084:"34ff0b4c",8088:"293f9c83",8110:"56a68450",8210:"29e7adb3",8240:"832b8a10",8300:"e5a884f4",8332:"6607fcb6",8338:"f5938888",8341:"730fef4c",8350:"3f2877b5",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",8694:"30e9e8ba",8814:"11b282fc",8881:"05206b71",8990:"e7541c45",9027:"2b13119a",9090:"4fabf2f1",9095:"ebca17e9",9139:"09ecdeab",9159:"fbe708ec",9183:"2d4a7f47",9199:"f7c1e588",9254:"78c3c618",9259:"a62a85e6",9319:"851c2574",9375:"729d3e1e",9410:"c9c87310",9413:"38682d35",9527:"8ac96054",9543:"f8016cde",9619:"39430005",9661:"5e95c892",9664:"974d09da",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9754:"f3d96861",9817:"14eb3368",9861:"9ea180da",9895:"b7a138aa",9916:"f3a7b3b2",9966:"1748a406",9974:"dc65f2fa"}[e]||e)+"."+{53:"974ba5c9",69:"cd008c45",80:"9605d2b9",196:"1adc00f3",263:"77a22a74",417:"d61411b0",438:"96485ad6",498:"6faa31d3",513:"b7dc4067",530:"590aaa77",612:"06a655ad",876:"1630c731",915:"a22abade",997:"b5eb8c1f",1039:"4059474a",1049:"c1ea99eb",1053:"86c8f721",1089:"3c59d421",1110:"9621cd55",1317:"4c4de52b",1400:"67e1e8f6",1404:"2f578d87",1498:"46354ae6",1543:"0db38a50",1546:"63fc790e",1560:"5c626199",1581:"85fe0a10",1588:"716838d7",1626:"441d5055",1772:"22d645a1",1827:"32f85c6a",1860:"9979e720",1893:"61190a65",1949:"0e5d0aca",2026:"bc35b904",2143:"6764a52d",2172:"92669f93",2191:"c89c1ad8",2216:"f091b0b4",2289:"67d62bc7",2322:"d4c741a2",2403:"e70ad829",2418:"6d0332a4",2432:"6f2750fe",2464:"373601f7",2528:"bc878fd2",2529:"e8d26008",2535:"a329f4f2",2551:"a5207080",2701:"bd9e5db3",2707:"b8b2376c",2751:"9134d19a",2784:"44b0e2f8",2786:"1727bc64",2792:"abe48754",2830:"09fb73d7",2847:"23dc45be",2865:"4f5b83c0",2868:"f674fd38",2925:"297b2448",3034:"499cb318",3085:"fa8680eb",3089:"d410008f",3134:"2c6e3cc2",3135:"cc3b1fc9",3209:"a9a1492a",3263:"52660cd0",3280:"061043fc",3376:"f67c89a2",3389:"f6b6bc02",3432:"3d887583",3608:"8eec8b12",3651:"ac393a14",3655:"fb33b4f8",3684:"2b44684f",3715:"cad2678b",3808:"19309d4f",3832:"a617cf03",3942:"357fda3f",3969:"e72bec1a",3994:"4e7738e6",4013:"354f3ef2",4042:"b27dd161",4067:"8a1553e1",4195:"b82e09e8",4288:"afd23ce7",4368:"9ecc2e7c",4447:"1a361711",4450:"36ded4b4",4481:"b4866903",4599:"f4cd98e8",4618:"bc736dd3",4621:"5e069252",4725:"c7037dab",4733:"e93baa7c",4770:"0f5ea528",4823:"5d773431",4842:"26f21937",4873:"9d7a20ea",4984:"89a9f66b",5022:"c1ec8f85",5030:"a1e836e0",5094:"7e9bd8d8",5096:"12118f94",5106:"75507717",5151:"84cd75ac",5313:"037cee1f",5332:"39e635f8",5428:"f9a0557f",5431:"1006c799",5526:"3a7d06b9",5598:"e076f0aa",5609:"ba29a9c9",5617:"e9dc7a26",5619:"b6991f82",5635:"8d579786",5651:"cc6906df",5675:"672575c5",5695:"da8b2a78",5701:"5cb2744c",5739:"20cf0c37",5832:"e8be20d9",5854:"7a48ca40",5870:"3efbbdec",5921:"c6d6fca9",5954:"e2efa1de",6085:"59bf4311",6099:"4ccccd15",6103:"d9da7455",6114:"36c015ce",6118:"8502a18b",6142:"64bff290",6154:"3a34d537",6175:"f1ab7e4f",6193:"3dcc4b8f",6232:"a965c67c",6259:"afd6b9b2",6296:"608f3c26",6403:"e9454893",6518:"2d31b890",6526:"2629620e",6567:"a600d6fd",6662:"3f3e5636",6679:"b0847aa4",6685:"f8050b8c",6721:"01f754dc",6864:"1cde18b5",6893:"4e72fbe6",6902:"6af7179d",6917:"e0a5ac39",7060:"9e91e83f",7190:"1d07324a",7224:"86b0fccd",7335:"67d41d40",7414:"dbd0b852",7503:"41adfa01",7504:"dad1c705",7545:"45028282",7668:"e9bccc4f",7701:"4507b7bc",7836:"7661051c",7918:"15723699",8010:"2c7e4ba0",8084:"8f9d425a",8088:"e2d4c498",8110:"d14aa706",8210:"64d8e266",8240:"1e3413da",8300:"12442be0",8332:"18359e4f",8338:"8dd127cf",8341:"fcb26556",8350:"be6b644a",8518:"f93b23a7",8565:"c4719110",8610:"686aaf2c",8694:"379cce5b",8814:"01cc229d",8881:"8ec9cc5e",8990:"852c5e45",9027:"18934b93",9090:"6af19ea5",9095:"06c4879f",9139:"82cea7bf",9159:"a8ab2a92",9183:"359d3d24",9199:"38a8f426",9254:"b5e5000a",9259:"55365f9f",9319:"ff9078b6",9375:"35326f17",9410:"c174fd44",9413:"e5782ec2",9527:"67767120",9543:"206179fa",9619:"39096450",9661:"17c48d1d",9664:"d7fb4bd8",9671:"8ef80ab1",9677:"ea822b9e",9705:"1b99490f",9744:"00ff6043",9754:"df8d17f9",9817:"21d38987",9861:"5dedb635",9895:"b665d587",9916:"232f5b0b",9966:"7c49803d",9974:"2f72d63c"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,c)=>Object.prototype.hasOwnProperty.call(e,c),a={},b="docs:",r.l=(e,c,f,d)=>{if(a[e])a[e].push(c);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(f))),c)return c(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/",r.gca=function(e){return e={11366869:"5428",17588091:"4823",17896441:"7918",39430005:"9619",58132609:"6175","935f2afb":"53","018a1506":"69","2c0b54ac":"80",d9bab663:"196","5c062049":"263","080c9bd0":"417","5de4625c":"438","2cc1595c":"498",b6606f5f:"513",e5b11173:"530",d287f9e6:"612",b035a2d2:"876","648478e2":"915","5670b452":"997","35b233e8":"1039",b472294c:"1049",c51e9508:"1053","04b649ca":"1089","5eea6960":"1110","9cec3c93":"1317","495c719e":"1400",e511abbf:"1498","98ce8162":"1543","92f7ac8d":"1546","0275f7e4":"1560",f8777534:"1581",f80396ac:"1588",a449492b:"1626","5806a9e1":"1827","67bae27a":"1860","340f1526":"1893","7c9c7243":"1949","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191",c7f97b4e:"2216","51a4d3bf":"2289",f24a23d8:"2322",d16cbc15:"2403",e9b496d5:"2418","116fbef0":"2432",b5dfb830:"2464",ae31ff46:"2528","3143bd0d":"2529","814f3328":"2535",c37d3efc:"2551","1aab1ab5":"2701",ada9f060:"2707","890ef1f8":"2751",f65f6456:"2784","267f059f":"2786","0d1c87af":"2792","86e5cb88":"2830","7927a478":"2847","82487ba9":"2865",ce57b2d1:"2868",d848b1c8:"2925","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","86f810a5":"3134","7ba330a5":"3135","80a0c88e":"3209","91bd08ce":"3263","4bb9edb3":"3280","6c8708e3":"3376","4c713790":"3389",de4f60ff:"3432","9e4087bc":"3608","1514c4f3":"3651",b1a1bf59:"3655","797defb6":"3684","583d85fc":"3715",ce30cdaf:"3808",e6bd25e0:"3832","14c08683":"3942","5b27bc59":"3969","41abee02":"3994","01a85c17":"4013","65e4303d":"4042","4e3d17c1":"4067",c4f5d8e4:"4195",a732a165:"4288",a94703ab:"4368","28a86b5d":"4447",c60ded92:"4450","7d3539b2":"4481",a94a4682:"4599","8e2c1ca5":"4618","0479d12b":"4621","06e0043a":"4725","173c8b24":"4733",bf750d2c:"4770","0c7d33f3":"4842","83b73936":"4873",b8fd1f7e:"4984","3b36ca8e":"5022","7f50710c":"5030",a3b8b6db:"5094",bef23ce3:"5096","6c1ba8b1":"5106","43e6fa63":"5151","4919068e":"5313","8ded3f77":"5332","7329c3b8":"5431","2553c37c":"5526","65e4cc1e":"5598","5035b6a4":"5609","54ea3d6a":"5617",ecfd88b4:"5619","1cf5eacf":"5635","359eb289":"5651",bce42248:"5675","6d7ce909":"5695","5539901a":"5701","717af290":"5739","926843be":"5832","5057383c":"5854","4b91b61e":"5870","1b6fd54f":"5921",ff235272:"5954","3d438ec7":"6085","58092a00":"6099",ccc49370:"6103","89f39702":"6114",c9566e8a:"6118",f2bffab0:"6142",c38df086:"6154","864ebe97":"6193",f554ac40:"6232","55b57bd3":"6259","286c2c64":"6296",ad972684:"6403","3fefcd96":"6518","41a6ae87":"6526",b2b68e5a:"6567","555ecac1":"6662",a7cd7c6a:"6679","65dfabbc":"6685","38803c52":"6721",cbce90b2:"6864",d85491b0:"6893","024af9ce":"6902","7f65dfb7":"6917","9f9db465":"7060",ab32da60:"7190",d4a2dc55:"7224","850166d8":"7335","393be207":"7414","05ed0e1f":"7503","5297811e":"7504","2b9fd23c":"7545",acfad3c9:"7668",df5b4e08:"7701","02f62403":"7836","99d50e1d":"8010","34ff0b4c":"8084","293f9c83":"8088","56a68450":"8110","29e7adb3":"8210","832b8a10":"8240",e5a884f4:"8300","6607fcb6":"8332",f5938888:"8338","730fef4c":"8341","3f2877b5":"8350",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","30e9e8ba":"8694","11b282fc":"8814","05206b71":"8881",e7541c45:"8990","2b13119a":"9027","4fabf2f1":"9090",ebca17e9:"9095","09ecdeab":"9139",fbe708ec:"9159","2d4a7f47":"9183",f7c1e588:"9199","78c3c618":"9254",a62a85e6:"9259","851c2574":"9319","729d3e1e":"9375",c9c87310:"9410","38682d35":"9413","8ac96054":"9527",f8016cde:"9543","5e95c892":"9661","974d09da":"9664","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744",f3d96861:"9754","14eb3368":"9817","9ea180da":"9861",b7a138aa:"9895",f3a7b3b2:"9916","1748a406":"9966",dc65f2fa:"9974"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(c,f)=>{var a=r.o(e,c)?e[c]:void 0;if(0!==a)if(a)f.push(a[2]);else if(/^(1303|532)$/.test(c))e[c]=0;else{var b=new Promise(((f,b)=>a=e[c]=[f,b]));f.push(a[2]=b);var d=r.p+r.u(c),t=new Error;r.l(d,(f=>{if(r.o(e,c)&&(0!==(a=e[c])&&(e[c]=void 0),a)){var b=f&&("load"===f.type?"missing":f.type),d=f&&f.target&&f.target.src;t.message="Loading chunk "+c+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,a[1](t)}}),"chunk-"+c,c)}},r.O.j=c=>0===e[c];var c=(c,f)=>{var a,b,d=f[0],t=f[1],o=f[2],n=0;if(d.some((c=>0!==e[c]))){for(a in t)r.o(t,a)&&(r.m[a]=t[a]);if(o)var i=o(r)}for(c&&c(f);n{"use strict";var e,c,a,f,b,d={},t={};function r(e){var c=t[e];if(void 0!==c)return c.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=d,r.c=t,e=[],r.O=(c,a,f,b)=>{if(!a){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](a[o])))?a.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[a,f,b]},r.n=e=>{var c=e&&e.__esModule?()=>e.default:()=>e;return r.d(c,{a:c}),c},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};c=c||[null,a({}),a([]),a(a)];for(var t=2&f&&e;"object"==typeof t&&!~c.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach((c=>d[c]=()=>e[c]));return d.default=()=>e,r.d(b,d),b},r.d=(e,c)=>{for(var a in c)r.o(c,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:c[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((c,a)=>(r.f[a](e,c),c)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",69:"018a1506",80:"2c0b54ac",196:"d9bab663",263:"5c062049",417:"080c9bd0",438:"5de4625c",498:"2cc1595c",513:"b6606f5f",530:"e5b11173",612:"d287f9e6",876:"b035a2d2",915:"648478e2",997:"5670b452",1039:"35b233e8",1049:"b472294c",1053:"c51e9508",1089:"04b649ca",1110:"5eea6960",1317:"9cec3c93",1400:"495c719e",1498:"e511abbf",1543:"98ce8162",1546:"92f7ac8d",1560:"0275f7e4",1581:"f8777534",1588:"f80396ac",1626:"a449492b",1827:"5806a9e1",1860:"67bae27a",1893:"340f1526",1949:"7c9c7243",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2216:"c7f97b4e",2289:"51a4d3bf",2322:"f24a23d8",2403:"d16cbc15",2418:"e9b496d5",2432:"116fbef0",2464:"b5dfb830",2528:"ae31ff46",2529:"3143bd0d",2535:"814f3328",2551:"c37d3efc",2701:"1aab1ab5",2707:"ada9f060",2751:"890ef1f8",2784:"f65f6456",2786:"267f059f",2792:"0d1c87af",2830:"86e5cb88",2847:"7927a478",2865:"82487ba9",2868:"ce57b2d1",2925:"d848b1c8",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3134:"86f810a5",3135:"7ba330a5",3209:"80a0c88e",3263:"91bd08ce",3280:"4bb9edb3",3376:"6c8708e3",3389:"4c713790",3432:"de4f60ff",3608:"9e4087bc",3651:"1514c4f3",3655:"b1a1bf59",3684:"797defb6",3715:"583d85fc",3808:"ce30cdaf",3832:"e6bd25e0",3942:"14c08683",3969:"5b27bc59",3994:"41abee02",4013:"01a85c17",4042:"65e4303d",4067:"4e3d17c1",4195:"c4f5d8e4",4288:"a732a165",4368:"a94703ab",4447:"28a86b5d",4450:"c60ded92",4481:"7d3539b2",4599:"a94a4682",4618:"8e2c1ca5",4621:"0479d12b",4725:"06e0043a",4733:"173c8b24",4770:"bf750d2c",4823:"17588091",4842:"0c7d33f3",4873:"83b73936",4984:"b8fd1f7e",5022:"3b36ca8e",5030:"7f50710c",5094:"a3b8b6db",5096:"bef23ce3",5106:"6c1ba8b1",5151:"43e6fa63",5313:"4919068e",5332:"8ded3f77",5428:"11366869",5431:"7329c3b8",5526:"2553c37c",5598:"65e4cc1e",5609:"5035b6a4",5617:"54ea3d6a",5619:"ecfd88b4",5635:"1cf5eacf",5651:"359eb289",5675:"bce42248",5695:"6d7ce909",5701:"5539901a",5739:"717af290",5832:"926843be",5854:"5057383c",5870:"4b91b61e",5921:"1b6fd54f",5954:"ff235272",6085:"3d438ec7",6099:"58092a00",6103:"ccc49370",6114:"89f39702",6118:"c9566e8a",6142:"f2bffab0",6154:"c38df086",6175:"58132609",6193:"864ebe97",6232:"f554ac40",6259:"55b57bd3",6296:"286c2c64",6403:"ad972684",6518:"3fefcd96",6526:"41a6ae87",6567:"b2b68e5a",6662:"555ecac1",6679:"a7cd7c6a",6685:"65dfabbc",6721:"38803c52",6864:"cbce90b2",6893:"d85491b0",6902:"024af9ce",6917:"7f65dfb7",7060:"9f9db465",7190:"ab32da60",7224:"d4a2dc55",7335:"850166d8",7414:"393be207",7503:"05ed0e1f",7504:"5297811e",7545:"2b9fd23c",7668:"acfad3c9",7701:"df5b4e08",7836:"02f62403",7918:"17896441",8010:"99d50e1d",8084:"34ff0b4c",8088:"293f9c83",8110:"56a68450",8210:"29e7adb3",8240:"832b8a10",8300:"e5a884f4",8332:"6607fcb6",8338:"f5938888",8341:"730fef4c",8350:"3f2877b5",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",8694:"30e9e8ba",8814:"11b282fc",8881:"05206b71",8990:"e7541c45",9027:"2b13119a",9090:"4fabf2f1",9095:"ebca17e9",9139:"09ecdeab",9159:"fbe708ec",9183:"2d4a7f47",9199:"f7c1e588",9254:"78c3c618",9259:"a62a85e6",9319:"851c2574",9375:"729d3e1e",9410:"c9c87310",9413:"38682d35",9527:"8ac96054",9543:"f8016cde",9619:"39430005",9661:"5e95c892",9664:"974d09da",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9754:"f3d96861",9817:"14eb3368",9861:"9ea180da",9895:"b7a138aa",9916:"f3a7b3b2",9966:"1748a406",9974:"dc65f2fa"}[e]||e)+"."+{53:"974ba5c9",69:"cd008c45",80:"9605d2b9",196:"1adc00f3",263:"77a22a74",417:"d61411b0",438:"96485ad6",498:"6faa31d3",513:"b7dc4067",530:"590aaa77",612:"1b25ce7b",876:"1630c731",915:"a22abade",997:"5f7a58b6",1039:"4059474a",1049:"c1ea99eb",1053:"86c8f721",1089:"3c59d421",1110:"9621cd55",1317:"4c4de52b",1400:"67e1e8f6",1404:"2f578d87",1498:"46354ae6",1543:"287e62b5",1546:"63fc790e",1560:"5c626199",1581:"85fe0a10",1588:"716838d7",1626:"441d5055",1772:"22d645a1",1827:"32f85c6a",1860:"9979e720",1893:"61190a65",1949:"0e5d0aca",2026:"bc35b904",2143:"e978d988",2172:"92669f93",2191:"c89c1ad8",2216:"f091b0b4",2289:"67d62bc7",2322:"d4c741a2",2403:"5450aa44",2418:"6d0332a4",2432:"6f2750fe",2464:"373601f7",2528:"bc878fd2",2529:"e8d26008",2535:"a329f4f2",2551:"a5207080",2701:"bd9e5db3",2707:"b8b2376c",2751:"9134d19a",2784:"44b0e2f8",2786:"1727bc64",2792:"1af163d0",2830:"09fb73d7",2847:"23dc45be",2865:"4f5b83c0",2868:"f674fd38",2925:"297b2448",3034:"499cb318",3085:"fa8680eb",3089:"d410008f",3134:"2c6e3cc2",3135:"cc3b1fc9",3209:"b733f954",3263:"52660cd0",3280:"061043fc",3376:"f67c89a2",3389:"f6b6bc02",3432:"3d887583",3608:"8eec8b12",3651:"ac393a14",3655:"fb33b4f8",3684:"2b44684f",3715:"cad2678b",3808:"19309d4f",3832:"a617cf03",3942:"357fda3f",3969:"e72bec1a",3994:"4e7738e6",4013:"354f3ef2",4042:"b27dd161",4067:"8a1553e1",4195:"b82e09e8",4288:"afd23ce7",4368:"9ecc2e7c",4447:"1a361711",4450:"36ded4b4",4481:"06b94f08",4599:"f4cd98e8",4618:"bc736dd3",4621:"5e069252",4725:"c7037dab",4733:"e93baa7c",4770:"0f5ea528",4823:"5d773431",4842:"26f21937",4873:"9d7a20ea",4984:"89a9f66b",5022:"c1ec8f85",5030:"a1e836e0",5094:"7e9bd8d8",5096:"12118f94",5106:"75507717",5151:"84cd75ac",5313:"037cee1f",5332:"39e635f8",5428:"f9a0557f",5431:"1006c799",5526:"3a7d06b9",5598:"e076f0aa",5609:"ba29a9c9",5617:"e9dc7a26",5619:"b6991f82",5635:"8d579786",5651:"cc6906df",5675:"672575c5",5695:"da8b2a78",5701:"5cb2744c",5739:"20cf0c37",5832:"e8be20d9",5854:"ecf8e775",5870:"3efbbdec",5921:"c6d6fca9",5954:"e2efa1de",6085:"59bf4311",6099:"4ccccd15",6103:"d9da7455",6114:"36c015ce",6118:"8502a18b",6142:"64bff290",6154:"21aead31",6175:"f1ab7e4f",6193:"3dcc4b8f",6232:"a965c67c",6259:"648f91c3",6296:"608f3c26",6403:"e9454893",6518:"2d31b890",6526:"2629620e",6567:"a600d6fd",6662:"3f3e5636",6679:"b0847aa4",6685:"f8050b8c",6721:"01f754dc",6864:"1cde18b5",6893:"4e72fbe6",6902:"6af7179d",6917:"26d35ace",7060:"9e91e83f",7190:"7b00de2b",7224:"86b0fccd",7335:"67d41d40",7414:"dbd0b852",7503:"41adfa01",7504:"dad1c705",7545:"45028282",7668:"e9bccc4f",7701:"4507b7bc",7836:"7661051c",7918:"15723699",8010:"2c7e4ba0",8084:"8f9d425a",8088:"3b48b842",8110:"d14aa706",8210:"64d8e266",8240:"1e3413da",8300:"12442be0",8332:"4d9db996",8338:"8dd127cf",8341:"fcb26556",8350:"4796c932",8518:"f93b23a7",8565:"6827c4cb",8610:"686aaf2c",8694:"379cce5b",8814:"01cc229d",8881:"8ec9cc5e",8990:"852c5e45",9027:"18934b93",9090:"6af19ea5",9095:"06c4879f",9139:"82cea7bf",9159:"a8ab2a92",9183:"359d3d24",9199:"38a8f426",9254:"b5e5000a",9259:"55365f9f",9319:"ff9078b6",9375:"35326f17",9410:"c174fd44",9413:"e5782ec2",9527:"96187a17",9543:"206179fa",9619:"282e5018",9661:"17c48d1d",9664:"d7fb4bd8",9671:"8ef80ab1",9677:"ea822b9e",9705:"1b99490f",9744:"00ff6043",9754:"df8d17f9",9817:"21d38987",9861:"5dedb635",9895:"b665d587",9916:"b1e52f6b",9966:"7c49803d",9974:"2f72d63c"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,c)=>Object.prototype.hasOwnProperty.call(e,c),f={},b="docs:",r.l=(e,c,a,d)=>{if(f[e])f[e].push(c);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(a))),c)return c(a)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/",r.gca=function(e){return e={11366869:"5428",17588091:"4823",17896441:"7918",39430005:"9619",58132609:"6175","935f2afb":"53","018a1506":"69","2c0b54ac":"80",d9bab663:"196","5c062049":"263","080c9bd0":"417","5de4625c":"438","2cc1595c":"498",b6606f5f:"513",e5b11173:"530",d287f9e6:"612",b035a2d2:"876","648478e2":"915","5670b452":"997","35b233e8":"1039",b472294c:"1049",c51e9508:"1053","04b649ca":"1089","5eea6960":"1110","9cec3c93":"1317","495c719e":"1400",e511abbf:"1498","98ce8162":"1543","92f7ac8d":"1546","0275f7e4":"1560",f8777534:"1581",f80396ac:"1588",a449492b:"1626","5806a9e1":"1827","67bae27a":"1860","340f1526":"1893","7c9c7243":"1949","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191",c7f97b4e:"2216","51a4d3bf":"2289",f24a23d8:"2322",d16cbc15:"2403",e9b496d5:"2418","116fbef0":"2432",b5dfb830:"2464",ae31ff46:"2528","3143bd0d":"2529","814f3328":"2535",c37d3efc:"2551","1aab1ab5":"2701",ada9f060:"2707","890ef1f8":"2751",f65f6456:"2784","267f059f":"2786","0d1c87af":"2792","86e5cb88":"2830","7927a478":"2847","82487ba9":"2865",ce57b2d1:"2868",d848b1c8:"2925","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","86f810a5":"3134","7ba330a5":"3135","80a0c88e":"3209","91bd08ce":"3263","4bb9edb3":"3280","6c8708e3":"3376","4c713790":"3389",de4f60ff:"3432","9e4087bc":"3608","1514c4f3":"3651",b1a1bf59:"3655","797defb6":"3684","583d85fc":"3715",ce30cdaf:"3808",e6bd25e0:"3832","14c08683":"3942","5b27bc59":"3969","41abee02":"3994","01a85c17":"4013","65e4303d":"4042","4e3d17c1":"4067",c4f5d8e4:"4195",a732a165:"4288",a94703ab:"4368","28a86b5d":"4447",c60ded92:"4450","7d3539b2":"4481",a94a4682:"4599","8e2c1ca5":"4618","0479d12b":"4621","06e0043a":"4725","173c8b24":"4733",bf750d2c:"4770","0c7d33f3":"4842","83b73936":"4873",b8fd1f7e:"4984","3b36ca8e":"5022","7f50710c":"5030",a3b8b6db:"5094",bef23ce3:"5096","6c1ba8b1":"5106","43e6fa63":"5151","4919068e":"5313","8ded3f77":"5332","7329c3b8":"5431","2553c37c":"5526","65e4cc1e":"5598","5035b6a4":"5609","54ea3d6a":"5617",ecfd88b4:"5619","1cf5eacf":"5635","359eb289":"5651",bce42248:"5675","6d7ce909":"5695","5539901a":"5701","717af290":"5739","926843be":"5832","5057383c":"5854","4b91b61e":"5870","1b6fd54f":"5921",ff235272:"5954","3d438ec7":"6085","58092a00":"6099",ccc49370:"6103","89f39702":"6114",c9566e8a:"6118",f2bffab0:"6142",c38df086:"6154","864ebe97":"6193",f554ac40:"6232","55b57bd3":"6259","286c2c64":"6296",ad972684:"6403","3fefcd96":"6518","41a6ae87":"6526",b2b68e5a:"6567","555ecac1":"6662",a7cd7c6a:"6679","65dfabbc":"6685","38803c52":"6721",cbce90b2:"6864",d85491b0:"6893","024af9ce":"6902","7f65dfb7":"6917","9f9db465":"7060",ab32da60:"7190",d4a2dc55:"7224","850166d8":"7335","393be207":"7414","05ed0e1f":"7503","5297811e":"7504","2b9fd23c":"7545",acfad3c9:"7668",df5b4e08:"7701","02f62403":"7836","99d50e1d":"8010","34ff0b4c":"8084","293f9c83":"8088","56a68450":"8110","29e7adb3":"8210","832b8a10":"8240",e5a884f4:"8300","6607fcb6":"8332",f5938888:"8338","730fef4c":"8341","3f2877b5":"8350",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","30e9e8ba":"8694","11b282fc":"8814","05206b71":"8881",e7541c45:"8990","2b13119a":"9027","4fabf2f1":"9090",ebca17e9:"9095","09ecdeab":"9139",fbe708ec:"9159","2d4a7f47":"9183",f7c1e588:"9199","78c3c618":"9254",a62a85e6:"9259","851c2574":"9319","729d3e1e":"9375",c9c87310:"9410","38682d35":"9413","8ac96054":"9527",f8016cde:"9543","5e95c892":"9661","974d09da":"9664","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744",f3d96861:"9754","14eb3368":"9817","9ea180da":"9861",b7a138aa:"9895",f3a7b3b2:"9916","1748a406":"9966",dc65f2fa:"9974"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(c,a)=>{var f=r.o(e,c)?e[c]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(1303|532)$/.test(c))e[c]=0;else{var b=new Promise(((a,b)=>f=e[c]=[a,b]));a.push(f[2]=b);var d=r.p+r.u(c),t=new Error;r.l(d,(a=>{if(r.o(e,c)&&(0!==(f=e[c])&&(e[c]=void 0),f)){var b=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;t.message="Loading chunk "+c+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,f[1](t)}}),"chunk-"+c,c)}},r.O.j=c=>0===e[c];var c=(c,a)=>{var f,b,d=a[0],t=a[1],o=a[2],n=0;if(d.some((c=>0!==e[c]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(c&&c(a);nArchive | Touying
-
+
diff --git a/blog/index.html b/blog/index.html
index 15ad9b563..d8aac51f8 100644
--- a/blog/index.html
+++ b/blog/index.html
@@ -5,7 +5,7 @@
Blog | Touying
-
+
diff --git a/blog/tags/development/index.html b/blog/tags/development/index.html
index 5bd912d65..953670455 100644
--- a/blog/tags/development/index.html
+++ b/blog/tags/development/index.html
@@ -5,7 +5,7 @@
One post tagged with "development" | Touying
-
+
diff --git a/blog/tags/index.html b/blog/tags/index.html
index 09da6cddf..8eaf9d017 100644
--- a/blog/tags/index.html
+++ b/blog/tags/index.html
@@ -5,7 +5,7 @@
Tags | Touying
-
+
diff --git a/blog/touying-0-2-0/index.html b/blog/touying-0-2-0/index.html
index 9041df84b..6fe7ce7db 100644
--- a/blog/touying-0-2-0/index.html
+++ b/blog/touying-0-2-0/index.html
@@ -5,7 +5,7 @@
Touying 0.2.0 | Touying
-
+
diff --git a/docs/0.2.x/build-your-own-theme/index.html b/docs/0.2.x/build-your-own-theme/index.html
index 871e2d010..e79ae87b5 100644
--- a/docs/0.2.x/build-your-own-theme/index.html
+++ b/docs/0.2.x/build-your-own-theme/index.html
@@ -5,7 +5,7 @@
Build Your Own Theme | Touying
-
+
diff --git a/docs/0.2.x/category/dynamic-slides/index.html b/docs/0.2.x/category/dynamic-slides/index.html
index fc0e4f4dd..ec7eedd17 100644
--- a/docs/0.2.x/category/dynamic-slides/index.html
+++ b/docs/0.2.x/category/dynamic-slides/index.html
@@ -5,7 +5,7 @@
Dynamic Slides | Touying
-
+
diff --git a/docs/0.2.x/category/external-tools/index.html b/docs/0.2.x/category/external-tools/index.html
index 9b94959b0..87a6cf565 100644
--- a/docs/0.2.x/category/external-tools/index.html
+++ b/docs/0.2.x/category/external-tools/index.html
@@ -5,7 +5,7 @@
External Tools | Touying
-
+
diff --git a/docs/0.2.x/category/progress/index.html b/docs/0.2.x/category/progress/index.html
index e3762f335..49223d3ac 100644
--- a/docs/0.2.x/category/progress/index.html
+++ b/docs/0.2.x/category/progress/index.html
@@ -5,7 +5,7 @@
Progress | Touying
-
+
diff --git a/docs/0.2.x/category/themes/index.html b/docs/0.2.x/category/themes/index.html
index 3f58bfcb3..f2a5491fc 100644
--- a/docs/0.2.x/category/themes/index.html
+++ b/docs/0.2.x/category/themes/index.html
@@ -5,7 +5,7 @@
Themes | Touying
-
+
diff --git a/docs/0.2.x/category/utilities/index.html b/docs/0.2.x/category/utilities/index.html
index c232d3434..2af5c88e0 100644
--- a/docs/0.2.x/category/utilities/index.html
+++ b/docs/0.2.x/category/utilities/index.html
@@ -5,7 +5,7 @@
Utilities | Touying
-
+
diff --git a/docs/0.2.x/changelog/index.html b/docs/0.2.x/changelog/index.html
index 6c4fdad73..b02a03620 100644
--- a/docs/0.2.x/changelog/index.html
+++ b/docs/0.2.x/changelog/index.html
@@ -5,7 +5,7 @@
Changelog | Touying
-
+
diff --git a/docs/0.2.x/dynamic/complex/index.html b/docs/0.2.x/dynamic/complex/index.html
index cb46164bb..da49da03e 100644
--- a/docs/0.2.x/dynamic/complex/index.html
+++ b/docs/0.2.x/dynamic/complex/index.html
@@ -5,7 +5,7 @@
Complex Animations | Touying
-
+
diff --git a/docs/0.2.x/dynamic/cover/index.html b/docs/0.2.x/dynamic/cover/index.html
index cef26d371..af6cde215 100644
--- a/docs/0.2.x/dynamic/cover/index.html
+++ b/docs/0.2.x/dynamic/cover/index.html
@@ -5,7 +5,7 @@
Cover Function | Touying
-
+
diff --git a/docs/0.2.x/dynamic/equation/index.html b/docs/0.2.x/dynamic/equation/index.html
index 47c883ccf..d69de615c 100644
--- a/docs/0.2.x/dynamic/equation/index.html
+++ b/docs/0.2.x/dynamic/equation/index.html
@@ -5,7 +5,7 @@
Math Equation Animations | Touying
-
+
diff --git a/docs/0.2.x/dynamic/handout/index.html b/docs/0.2.x/dynamic/handout/index.html
index 956c955ad..9740f841b 100644
--- a/docs/0.2.x/dynamic/handout/index.html
+++ b/docs/0.2.x/dynamic/handout/index.html
@@ -5,7 +5,7 @@
Handout Mode | Touying
-
+
diff --git a/docs/0.2.x/dynamic/other/index.html b/docs/0.2.x/dynamic/other/index.html
index 9bdc2ab07..23bc298d7 100644
--- a/docs/0.2.x/dynamic/other/index.html
+++ b/docs/0.2.x/dynamic/other/index.html
@@ -5,7 +5,7 @@
Other Animations | Touying
-
+
diff --git a/docs/0.2.x/dynamic/simple/index.html b/docs/0.2.x/dynamic/simple/index.html
index 49c7f4ac7..9cf361ba7 100644
--- a/docs/0.2.x/dynamic/simple/index.html
+++ b/docs/0.2.x/dynamic/simple/index.html
@@ -5,7 +5,7 @@
Simple Animations | Touying
-
+
diff --git a/docs/0.2.x/external/pdfpc/index.html b/docs/0.2.x/external/pdfpc/index.html
index ef85f44c8..e6b697a39 100644
--- a/docs/0.2.x/external/pdfpc/index.html
+++ b/docs/0.2.x/external/pdfpc/index.html
@@ -5,7 +5,7 @@
Pdfpc | Touying
-
+
diff --git a/docs/0.2.x/external/typst-preview/index.html b/docs/0.2.x/external/typst-preview/index.html
index 5c835d2bf..9120e0286 100644
--- a/docs/0.2.x/external/typst-preview/index.html
+++ b/docs/0.2.x/external/typst-preview/index.html
@@ -5,7 +5,7 @@
Typst Preview | Touying
-
+
diff --git a/docs/0.2.x/intro/index.html b/docs/0.2.x/intro/index.html
index 44c178214..c2a737ccf 100644
--- a/docs/0.2.x/intro/index.html
+++ b/docs/0.2.x/intro/index.html
@@ -5,7 +5,7 @@
Introduction to Touying | Touying
-
+
diff --git a/docs/0.2.x/layout/index.html b/docs/0.2.x/layout/index.html
index 01019555e..5ef0a672f 100644
--- a/docs/0.2.x/layout/index.html
+++ b/docs/0.2.x/layout/index.html
@@ -5,7 +5,7 @@
Layout Your Contents | Touying
-
+
diff --git a/docs/0.2.x/progress/counters/index.html b/docs/0.2.x/progress/counters/index.html
index 4ea8c7e47..95c300421 100644
--- a/docs/0.2.x/progress/counters/index.html
+++ b/docs/0.2.x/progress/counters/index.html
@@ -5,7 +5,7 @@
Touying Counters | Touying
-
+
diff --git a/docs/0.2.x/progress/sections/index.html b/docs/0.2.x/progress/sections/index.html
index 580f96b58..c6f30aef1 100644
--- a/docs/0.2.x/progress/sections/index.html
+++ b/docs/0.2.x/progress/sections/index.html
@@ -5,7 +5,7 @@
Touying Sections | Touying
-
+
diff --git a/docs/0.2.x/start/index.html b/docs/0.2.x/start/index.html
index 5993bcd85..762607e75 100644
--- a/docs/0.2.x/start/index.html
+++ b/docs/0.2.x/start/index.html
@@ -5,7 +5,7 @@
Getting Started | Touying
-
+
diff --git a/docs/0.2.x/style/index.html b/docs/0.2.x/style/index.html
index 377a7a52e..7771e7463 100644
--- a/docs/0.2.x/style/index.html
+++ b/docs/0.2.x/style/index.html
@@ -5,7 +5,7 @@
Code Styles | Touying
-
+
diff --git a/docs/0.2.x/themes/dewdrop/index.html b/docs/0.2.x/themes/dewdrop/index.html
index 9666530ec..c663263e7 100644
--- a/docs/0.2.x/themes/dewdrop/index.html
+++ b/docs/0.2.x/themes/dewdrop/index.html
@@ -5,7 +5,7 @@
Dewdrop Theme | Touying
-
+
diff --git a/docs/0.2.x/themes/metropolis/index.html b/docs/0.2.x/themes/metropolis/index.html
index 6c8937b22..f256bd840 100644
--- a/docs/0.2.x/themes/metropolis/index.html
+++ b/docs/0.2.x/themes/metropolis/index.html
@@ -5,7 +5,7 @@
Metropolis Theme | Touying
-
+
diff --git a/docs/0.2.x/themes/simple/index.html b/docs/0.2.x/themes/simple/index.html
index 1bfaeb107..6a17d364f 100644
--- a/docs/0.2.x/themes/simple/index.html
+++ b/docs/0.2.x/themes/simple/index.html
@@ -5,7 +5,7 @@
Simple Theme | Touying
-
+
diff --git a/docs/0.2.x/themes/university/index.html b/docs/0.2.x/themes/university/index.html
index 217c3893c..8121ef3ab 100644
--- a/docs/0.2.x/themes/university/index.html
+++ b/docs/0.2.x/themes/university/index.html
@@ -5,7 +5,7 @@
University Theme | Touying
-
+
diff --git a/docs/0.2.x/utilities/fit-to/index.html b/docs/0.2.x/utilities/fit-to/index.html
index 093a7e31a..955b62ecf 100644
--- a/docs/0.2.x/utilities/fit-to/index.html
+++ b/docs/0.2.x/utilities/fit-to/index.html
@@ -5,7 +5,7 @@
Fit to Height / Width | Touying
-
+
diff --git a/docs/0.2.x/utilities/oop/index.html b/docs/0.2.x/utilities/oop/index.html
index e550349f6..6fdec371a 100644
--- a/docs/0.2.x/utilities/oop/index.html
+++ b/docs/0.2.x/utilities/oop/index.html
@@ -5,7 +5,7 @@
Object-Oriented Programming | Touying
-
+
diff --git a/docs/0.3.2+/build-your-own-theme/index.html b/docs/0.3.2+/build-your-own-theme/index.html
index c3c38085a..cbe0f03bb 100644
--- a/docs/0.3.2+/build-your-own-theme/index.html
+++ b/docs/0.3.2+/build-your-own-theme/index.html
@@ -5,7 +5,7 @@
Creating Your Own Theme | Touying
-
+
diff --git a/docs/0.3.2+/category/dynamic-slides/index.html b/docs/0.3.2+/category/dynamic-slides/index.html
index 0e17e79b8..a5ae14dc2 100644
--- a/docs/0.3.2+/category/dynamic-slides/index.html
+++ b/docs/0.3.2+/category/dynamic-slides/index.html
@@ -5,7 +5,7 @@
Dynamic Slides | Touying
-
+
diff --git a/docs/0.3.2+/category/external-tools/index.html b/docs/0.3.2+/category/external-tools/index.html
index e92dfd7ce..fbacc895d 100644
--- a/docs/0.3.2+/category/external-tools/index.html
+++ b/docs/0.3.2+/category/external-tools/index.html
@@ -5,7 +5,7 @@
External Tools | Touying
-
+
diff --git a/docs/0.3.2+/category/package-integration/index.html b/docs/0.3.2+/category/package-integration/index.html
index 8134fb503..874b9d02f 100644
--- a/docs/0.3.2+/category/package-integration/index.html
+++ b/docs/0.3.2+/category/package-integration/index.html
@@ -5,7 +5,7 @@
Package Integration | Touying
-
+
diff --git a/docs/0.3.2+/category/progress/index.html b/docs/0.3.2+/category/progress/index.html
index 44d542ae7..aeaa94bac 100644
--- a/docs/0.3.2+/category/progress/index.html
+++ b/docs/0.3.2+/category/progress/index.html
@@ -5,7 +5,7 @@
Progress | Touying
-
+
diff --git a/docs/0.3.2+/category/themes/index.html b/docs/0.3.2+/category/themes/index.html
index 50edfd6c7..6f5c52e1d 100644
--- a/docs/0.3.2+/category/themes/index.html
+++ b/docs/0.3.2+/category/themes/index.html
@@ -5,7 +5,7 @@
Themes | Touying
-
+
diff --git a/docs/0.3.2+/category/utilities/index.html b/docs/0.3.2+/category/utilities/index.html
index 41f85166d..4cbc9b92b 100644
--- a/docs/0.3.2+/category/utilities/index.html
+++ b/docs/0.3.2+/category/utilities/index.html
@@ -5,7 +5,7 @@
Utilities | Touying
-
+
diff --git a/docs/0.3.2+/changelog/index.html b/docs/0.3.2+/changelog/index.html
index a7ae13910..ccd491815 100644
--- a/docs/0.3.2+/changelog/index.html
+++ b/docs/0.3.2+/changelog/index.html
@@ -5,7 +5,7 @@
Changelog | Touying
-
+
diff --git a/docs/0.3.2+/code-styles/index.html b/docs/0.3.2+/code-styles/index.html
index 4359eb808..713eca0f1 100644
--- a/docs/0.3.2+/code-styles/index.html
+++ b/docs/0.3.2+/code-styles/index.html
@@ -5,7 +5,7 @@
Code Style | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/complex/index.html b/docs/0.3.2+/dynamic/complex/index.html
index d5b899501..bc927d538 100644
--- a/docs/0.3.2+/dynamic/complex/index.html
+++ b/docs/0.3.2+/dynamic/complex/index.html
@@ -5,7 +5,7 @@
Complex Animations | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/cover/index.html b/docs/0.3.2+/dynamic/cover/index.html
index 5accfe76d..c16a6ab2c 100644
--- a/docs/0.3.2+/dynamic/cover/index.html
+++ b/docs/0.3.2+/dynamic/cover/index.html
@@ -5,7 +5,7 @@
Cover Function | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/equation/index.html b/docs/0.3.2+/dynamic/equation/index.html
index 4c0823bf6..51a9de432 100644
--- a/docs/0.3.2+/dynamic/equation/index.html
+++ b/docs/0.3.2+/dynamic/equation/index.html
@@ -5,7 +5,7 @@
Math Equation Animations | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/handout/index.html b/docs/0.3.2+/dynamic/handout/index.html
index 41c5b0902..6e230bb98 100644
--- a/docs/0.3.2+/dynamic/handout/index.html
+++ b/docs/0.3.2+/dynamic/handout/index.html
@@ -5,7 +5,7 @@
Handout Mode | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/other/index.html b/docs/0.3.2+/dynamic/other/index.html
index 14a261012..7f83ca5b3 100644
--- a/docs/0.3.2+/dynamic/other/index.html
+++ b/docs/0.3.2+/dynamic/other/index.html
@@ -5,7 +5,7 @@
Other Animations | Touying
-
+
diff --git a/docs/0.3.2+/dynamic/simple/index.html b/docs/0.3.2+/dynamic/simple/index.html
index 13e21579e..bbed6f000 100644
--- a/docs/0.3.2+/dynamic/simple/index.html
+++ b/docs/0.3.2+/dynamic/simple/index.html
@@ -5,7 +5,7 @@
Simple Animations | Touying
-
+
diff --git a/docs/0.3.2+/external/pdfpc/index.html b/docs/0.3.2+/external/pdfpc/index.html
index cb325dc9e..c55d5a2e1 100644
--- a/docs/0.3.2+/external/pdfpc/index.html
+++ b/docs/0.3.2+/external/pdfpc/index.html
@@ -5,7 +5,7 @@
Pdfpc | Touying
-
+
diff --git a/docs/0.3.2+/external/typst-preview/index.html b/docs/0.3.2+/external/typst-preview/index.html
index 654158653..475632a38 100644
--- a/docs/0.3.2+/external/typst-preview/index.html
+++ b/docs/0.3.2+/external/typst-preview/index.html
@@ -5,7 +5,7 @@
Typst Preview | Touying
-
+
diff --git a/docs/0.3.2+/global-settings/index.html b/docs/0.3.2+/global-settings/index.html
index af30d50e2..afc8ba82a 100644
--- a/docs/0.3.2+/global-settings/index.html
+++ b/docs/0.3.2+/global-settings/index.html
@@ -5,7 +5,7 @@
Global Settings | Touying
-
+
diff --git a/docs/0.3.2+/integration/cetz/index.html b/docs/0.3.2+/integration/cetz/index.html
index 1497536bb..5cbb29c11 100644
--- a/docs/0.3.2+/integration/cetz/index.html
+++ b/docs/0.3.2+/integration/cetz/index.html
@@ -5,7 +5,7 @@
CeTZ | Touying
-
+
diff --git a/docs/0.3.2+/integration/codly/index.html b/docs/0.3.2+/integration/codly/index.html
index 5be5e36f4..a8cb477a5 100644
--- a/docs/0.3.2+/integration/codly/index.html
+++ b/docs/0.3.2+/integration/codly/index.html
@@ -5,7 +5,7 @@
Codly | Touying
-
+
diff --git a/docs/0.3.2+/integration/fletcher/index.html b/docs/0.3.2+/integration/fletcher/index.html
index 7f9f190cb..598465135 100644
--- a/docs/0.3.2+/integration/fletcher/index.html
+++ b/docs/0.3.2+/integration/fletcher/index.html
@@ -5,7 +5,7 @@
Fletcher | Touying
-
+
diff --git a/docs/0.3.2+/integration/mitex/index.html b/docs/0.3.2+/integration/mitex/index.html
index 48a0548e0..10d51a309 100644
--- a/docs/0.3.2+/integration/mitex/index.html
+++ b/docs/0.3.2+/integration/mitex/index.html
@@ -5,7 +5,7 @@
MiTeX | Touying
-
+
diff --git a/docs/0.3.2+/integration/pinit/index.html b/docs/0.3.2+/integration/pinit/index.html
index 038326629..bd1651aed 100644
--- a/docs/0.3.2+/integration/pinit/index.html
+++ b/docs/0.3.2+/integration/pinit/index.html
@@ -5,7 +5,7 @@
Pinit | Touying
-
+
diff --git a/docs/0.3.2+/integration/polylux/index.html b/docs/0.3.2+/integration/polylux/index.html
index 7e2170680..b6a944247 100644
--- a/docs/0.3.2+/integration/polylux/index.html
+++ b/docs/0.3.2+/integration/polylux/index.html
@@ -5,7 +5,7 @@
Polylux | Touying
-
+
diff --git a/docs/0.3.2+/intro/index.html b/docs/0.3.2+/intro/index.html
index e5999674c..056f663b4 100644
--- a/docs/0.3.2+/intro/index.html
+++ b/docs/0.3.2+/intro/index.html
@@ -5,7 +5,7 @@
Introduction to Touying | Touying
-
+
diff --git a/docs/0.3.2+/layout/index.html b/docs/0.3.2+/layout/index.html
index 6e80d121c..6499f0bbe 100644
--- a/docs/0.3.2+/layout/index.html
+++ b/docs/0.3.2+/layout/index.html
@@ -5,7 +5,7 @@
Page Layout | Touying
-
+
diff --git a/docs/0.3.2+/progress/counters/index.html b/docs/0.3.2+/progress/counters/index.html
index 7cc1ba909..18f1b3c46 100644
--- a/docs/0.3.2+/progress/counters/index.html
+++ b/docs/0.3.2+/progress/counters/index.html
@@ -5,7 +5,7 @@
Touying Counters | Touying
-
+
diff --git a/docs/0.3.2+/progress/sections/index.html b/docs/0.3.2+/progress/sections/index.html
index b67bf661b..ee65ff334 100644
--- a/docs/0.3.2+/progress/sections/index.html
+++ b/docs/0.3.2+/progress/sections/index.html
@@ -5,7 +5,7 @@
Touying Sections | Touying
-
+
diff --git a/docs/0.3.2+/sections/index.html b/docs/0.3.2+/sections/index.html
index ae671b63f..f5bc7d637 100644
--- a/docs/0.3.2+/sections/index.html
+++ b/docs/0.3.2+/sections/index.html
@@ -5,7 +5,7 @@
Sections and Subsections | Touying
-
+
diff --git a/docs/0.3.2+/start/index.html b/docs/0.3.2+/start/index.html
index ff43dd368..4390cfeec 100644
--- a/docs/0.3.2+/start/index.html
+++ b/docs/0.3.2+/start/index.html
@@ -5,7 +5,7 @@
Getting Started | Touying
-
+
diff --git a/docs/0.3.2+/themes/aqua/index.html b/docs/0.3.2+/themes/aqua/index.html
index d92d5a4d1..d1acdeafb 100644
--- a/docs/0.3.2+/themes/aqua/index.html
+++ b/docs/0.3.2+/themes/aqua/index.html
@@ -5,7 +5,7 @@
Aqua Theme | Touying
-
+
diff --git a/docs/0.3.2+/themes/dewdrop/index.html b/docs/0.3.2+/themes/dewdrop/index.html
index 5a0353a7a..f61ddfd69 100644
--- a/docs/0.3.2+/themes/dewdrop/index.html
+++ b/docs/0.3.2+/themes/dewdrop/index.html
@@ -5,7 +5,7 @@
Dewdrop Theme | Touying
-
+
diff --git a/docs/0.3.2+/themes/metropolis/index.html b/docs/0.3.2+/themes/metropolis/index.html
index b9176e5fd..52d90d82c 100644
--- a/docs/0.3.2+/themes/metropolis/index.html
+++ b/docs/0.3.2+/themes/metropolis/index.html
@@ -5,7 +5,7 @@
Metropolis Theme | Touying
-
+
diff --git a/docs/0.3.2+/themes/simple/index.html b/docs/0.3.2+/themes/simple/index.html
index 2fdb7a484..c3bb6b05d 100644
--- a/docs/0.3.2+/themes/simple/index.html
+++ b/docs/0.3.2+/themes/simple/index.html
@@ -5,7 +5,7 @@
Simple Theme | Touying
-
+
diff --git a/docs/0.3.2+/themes/university/index.html b/docs/0.3.2+/themes/university/index.html
index a3f210d86..554840099 100644
--- a/docs/0.3.2+/themes/university/index.html
+++ b/docs/0.3.2+/themes/university/index.html
@@ -5,7 +5,7 @@
University Theme | Touying
-
+
diff --git a/docs/0.3.2+/utilities/fit-to/index.html b/docs/0.3.2+/utilities/fit-to/index.html
index ef465314e..958af46f9 100644
--- a/docs/0.3.2+/utilities/fit-to/index.html
+++ b/docs/0.3.2+/utilities/fit-to/index.html
@@ -5,7 +5,7 @@
Fit to Height / Width | Touying
-
+
diff --git a/docs/0.3.2+/utilities/oop/index.html b/docs/0.3.2+/utilities/oop/index.html
index 5b738b4a2..ce1a110c0 100644
--- a/docs/0.3.2+/utilities/oop/index.html
+++ b/docs/0.3.2+/utilities/oop/index.html
@@ -5,7 +5,7 @@
Object-Oriented Programming | Touying
-
+
diff --git a/docs/0.3.x/build-your-own-theme/index.html b/docs/0.3.x/build-your-own-theme/index.html
index 5414c5eb3..4ec5546af 100644
--- a/docs/0.3.x/build-your-own-theme/index.html
+++ b/docs/0.3.x/build-your-own-theme/index.html
@@ -5,7 +5,7 @@
Creating Your Own Theme | Touying
-
+
diff --git a/docs/0.3.x/category/dynamic-slides/index.html b/docs/0.3.x/category/dynamic-slides/index.html
index a66074eeb..fb800a0f9 100644
--- a/docs/0.3.x/category/dynamic-slides/index.html
+++ b/docs/0.3.x/category/dynamic-slides/index.html
@@ -5,7 +5,7 @@
Dynamic Slides | Touying
-
+
diff --git a/docs/0.3.x/category/external-tools/index.html b/docs/0.3.x/category/external-tools/index.html
index 135394475..387bc33d8 100644
--- a/docs/0.3.x/category/external-tools/index.html
+++ b/docs/0.3.x/category/external-tools/index.html
@@ -5,7 +5,7 @@
External Tools | Touying
-
+
diff --git a/docs/0.3.x/category/package-integration/index.html b/docs/0.3.x/category/package-integration/index.html
index 7ac48f7cb..cf6911eef 100644
--- a/docs/0.3.x/category/package-integration/index.html
+++ b/docs/0.3.x/category/package-integration/index.html
@@ -5,7 +5,7 @@
Package Integration | Touying
-
+
diff --git a/docs/0.3.x/category/progress/index.html b/docs/0.3.x/category/progress/index.html
index 826b74e7d..641813ffd 100644
--- a/docs/0.3.x/category/progress/index.html
+++ b/docs/0.3.x/category/progress/index.html
@@ -5,7 +5,7 @@
Progress | Touying
-
+
diff --git a/docs/0.3.x/category/themes/index.html b/docs/0.3.x/category/themes/index.html
index 5e39ea695..256052f56 100644
--- a/docs/0.3.x/category/themes/index.html
+++ b/docs/0.3.x/category/themes/index.html
@@ -5,7 +5,7 @@
Themes | Touying
-
+
diff --git a/docs/0.3.x/category/utilities/index.html b/docs/0.3.x/category/utilities/index.html
index f1d33cf36..b2db4aed1 100644
--- a/docs/0.3.x/category/utilities/index.html
+++ b/docs/0.3.x/category/utilities/index.html
@@ -5,7 +5,7 @@
Utilities | Touying
-
+
diff --git a/docs/0.3.x/changelog/index.html b/docs/0.3.x/changelog/index.html
index 25ceee0fc..ca4cc97c6 100644
--- a/docs/0.3.x/changelog/index.html
+++ b/docs/0.3.x/changelog/index.html
@@ -5,7 +5,7 @@
Changelog | Touying
-
+
diff --git a/docs/0.3.x/code-styles/index.html b/docs/0.3.x/code-styles/index.html
index 5fa57a6a4..6bc725885 100644
--- a/docs/0.3.x/code-styles/index.html
+++ b/docs/0.3.x/code-styles/index.html
@@ -5,7 +5,7 @@
Code Style | Touying
-
+
diff --git a/docs/0.3.x/dynamic/complex/index.html b/docs/0.3.x/dynamic/complex/index.html
index 9d697d858..fb9d8b3ac 100644
--- a/docs/0.3.x/dynamic/complex/index.html
+++ b/docs/0.3.x/dynamic/complex/index.html
@@ -5,7 +5,7 @@
Complex Animations | Touying
-
+
diff --git a/docs/0.3.x/dynamic/cover/index.html b/docs/0.3.x/dynamic/cover/index.html
index 99b66bb78..048c16f77 100644
--- a/docs/0.3.x/dynamic/cover/index.html
+++ b/docs/0.3.x/dynamic/cover/index.html
@@ -5,7 +5,7 @@
Cover Function | Touying
-
+
diff --git a/docs/0.3.x/dynamic/equation/index.html b/docs/0.3.x/dynamic/equation/index.html
index c6aba1bd5..1dafb29ec 100644
--- a/docs/0.3.x/dynamic/equation/index.html
+++ b/docs/0.3.x/dynamic/equation/index.html
@@ -5,7 +5,7 @@
Math Equation Animations | Touying
-
+
diff --git a/docs/0.3.x/dynamic/handout/index.html b/docs/0.3.x/dynamic/handout/index.html
index 3f742e03e..b9691b6cc 100644
--- a/docs/0.3.x/dynamic/handout/index.html
+++ b/docs/0.3.x/dynamic/handout/index.html
@@ -5,7 +5,7 @@
Handout Mode | Touying
-
+
diff --git a/docs/0.3.x/dynamic/other/index.html b/docs/0.3.x/dynamic/other/index.html
index 4239f6660..d2e4a6218 100644
--- a/docs/0.3.x/dynamic/other/index.html
+++ b/docs/0.3.x/dynamic/other/index.html
@@ -5,7 +5,7 @@
Other Animations | Touying
-
+
diff --git a/docs/0.3.x/dynamic/simple/index.html b/docs/0.3.x/dynamic/simple/index.html
index f6226a52e..17aa40c1d 100644
--- a/docs/0.3.x/dynamic/simple/index.html
+++ b/docs/0.3.x/dynamic/simple/index.html
@@ -5,7 +5,7 @@
Simple Animations | Touying
-
+
diff --git a/docs/0.3.x/external/pdfpc/index.html b/docs/0.3.x/external/pdfpc/index.html
index 5944720cf..cdf3bcd3f 100644
--- a/docs/0.3.x/external/pdfpc/index.html
+++ b/docs/0.3.x/external/pdfpc/index.html
@@ -5,7 +5,7 @@
Pdfpc | Touying
-
+
diff --git a/docs/0.3.x/external/typst-preview/index.html b/docs/0.3.x/external/typst-preview/index.html
index 500d54332..212e911a5 100644
--- a/docs/0.3.x/external/typst-preview/index.html
+++ b/docs/0.3.x/external/typst-preview/index.html
@@ -5,7 +5,7 @@
Typst Preview | Touying
-
+
diff --git a/docs/0.3.x/global-settings/index.html b/docs/0.3.x/global-settings/index.html
index 6afbb5d4d..09a083b20 100644
--- a/docs/0.3.x/global-settings/index.html
+++ b/docs/0.3.x/global-settings/index.html
@@ -5,7 +5,7 @@
Global Settings | Touying
-
+
diff --git a/docs/0.3.x/integration/cetz/index.html b/docs/0.3.x/integration/cetz/index.html
index 570ab260c..fe5f559a1 100644
--- a/docs/0.3.x/integration/cetz/index.html
+++ b/docs/0.3.x/integration/cetz/index.html
@@ -5,7 +5,7 @@
CeTZ | Touying
-
+
diff --git a/docs/0.3.x/integration/codly/index.html b/docs/0.3.x/integration/codly/index.html
index c8724fc06..db3398e16 100644
--- a/docs/0.3.x/integration/codly/index.html
+++ b/docs/0.3.x/integration/codly/index.html
@@ -5,7 +5,7 @@
Codly | Touying
-
+
diff --git a/docs/0.3.x/integration/fletcher/index.html b/docs/0.3.x/integration/fletcher/index.html
index 57db9c626..f85995cbc 100644
--- a/docs/0.3.x/integration/fletcher/index.html
+++ b/docs/0.3.x/integration/fletcher/index.html
@@ -5,7 +5,7 @@
Fletcher | Touying
-
+
diff --git a/docs/0.3.x/integration/mitex/index.html b/docs/0.3.x/integration/mitex/index.html
index 045bf5888..b4b4cc219 100644
--- a/docs/0.3.x/integration/mitex/index.html
+++ b/docs/0.3.x/integration/mitex/index.html
@@ -5,7 +5,7 @@
MiTeX | Touying
-
+
diff --git a/docs/0.3.x/integration/pinit/index.html b/docs/0.3.x/integration/pinit/index.html
index 14735e1d2..0991671b5 100644
--- a/docs/0.3.x/integration/pinit/index.html
+++ b/docs/0.3.x/integration/pinit/index.html
@@ -5,7 +5,7 @@
Pinit | Touying
-
+
diff --git a/docs/0.3.x/integration/polylux/index.html b/docs/0.3.x/integration/polylux/index.html
index 9f7a251dd..b5e4d90ea 100644
--- a/docs/0.3.x/integration/polylux/index.html
+++ b/docs/0.3.x/integration/polylux/index.html
@@ -5,7 +5,7 @@
Polylux | Touying
-
+
diff --git a/docs/0.3.x/intro/index.html b/docs/0.3.x/intro/index.html
index adf8ec3b7..5cadeaeda 100644
--- a/docs/0.3.x/intro/index.html
+++ b/docs/0.3.x/intro/index.html
@@ -5,7 +5,7 @@
Introduction to Touying | Touying
-
+
diff --git a/docs/0.3.x/layout/index.html b/docs/0.3.x/layout/index.html
index 79277ae0d..ef31b07f8 100644
--- a/docs/0.3.x/layout/index.html
+++ b/docs/0.3.x/layout/index.html
@@ -5,7 +5,7 @@
Page Layout | Touying
-
+
diff --git a/docs/0.3.x/progress/counters/index.html b/docs/0.3.x/progress/counters/index.html
index a8775e9d2..8cd6fddeb 100644
--- a/docs/0.3.x/progress/counters/index.html
+++ b/docs/0.3.x/progress/counters/index.html
@@ -5,7 +5,7 @@
Touying Counters | Touying
-
+
diff --git a/docs/0.3.x/progress/sections/index.html b/docs/0.3.x/progress/sections/index.html
index 84c2d4f92..af9116864 100644
--- a/docs/0.3.x/progress/sections/index.html
+++ b/docs/0.3.x/progress/sections/index.html
@@ -5,7 +5,7 @@
Touying Sections | Touying
-
+
diff --git a/docs/0.3.x/sections/index.html b/docs/0.3.x/sections/index.html
index 128bd3965..942e07060 100644
--- a/docs/0.3.x/sections/index.html
+++ b/docs/0.3.x/sections/index.html
@@ -5,7 +5,7 @@
Sections and Subsections | Touying
-
+
diff --git a/docs/0.3.x/start/index.html b/docs/0.3.x/start/index.html
index a20997ac7..fd60c1758 100644
--- a/docs/0.3.x/start/index.html
+++ b/docs/0.3.x/start/index.html
@@ -5,7 +5,7 @@
Getting Started | Touying
-
+
diff --git a/docs/0.3.x/themes/dewdrop/index.html b/docs/0.3.x/themes/dewdrop/index.html
index 6816c9125..7d705948e 100644
--- a/docs/0.3.x/themes/dewdrop/index.html
+++ b/docs/0.3.x/themes/dewdrop/index.html
@@ -5,7 +5,7 @@
Dewdrop Theme | Touying
-
+
diff --git a/docs/0.3.x/themes/metropolis/index.html b/docs/0.3.x/themes/metropolis/index.html
index 7bb401d35..6b750027d 100644
--- a/docs/0.3.x/themes/metropolis/index.html
+++ b/docs/0.3.x/themes/metropolis/index.html
@@ -5,7 +5,7 @@
Metropolis Theme | Touying
-
+
diff --git a/docs/0.3.x/themes/simple/index.html b/docs/0.3.x/themes/simple/index.html
index 276a56106..0bde67db2 100644
--- a/docs/0.3.x/themes/simple/index.html
+++ b/docs/0.3.x/themes/simple/index.html
@@ -5,7 +5,7 @@
Simple Theme | Touying
-
+
diff --git a/docs/0.3.x/themes/university/index.html b/docs/0.3.x/themes/university/index.html
index 90a9a3cb0..e819b7249 100644
--- a/docs/0.3.x/themes/university/index.html
+++ b/docs/0.3.x/themes/university/index.html
@@ -5,7 +5,7 @@
University Theme | Touying
-
+
diff --git a/docs/0.3.x/utilities/fit-to/index.html b/docs/0.3.x/utilities/fit-to/index.html
index a1889b5a1..087080690 100644
--- a/docs/0.3.x/utilities/fit-to/index.html
+++ b/docs/0.3.x/utilities/fit-to/index.html
@@ -5,7 +5,7 @@
Fit to Height / Width | Touying
-
+
diff --git a/docs/0.3.x/utilities/oop/index.html b/docs/0.3.x/utilities/oop/index.html
index d50bdb76f..f66b98328 100644
--- a/docs/0.3.x/utilities/oop/index.html
+++ b/docs/0.3.x/utilities/oop/index.html
@@ -5,7 +5,7 @@
Object-Oriented Programming | Touying
-
+
diff --git a/docs/build-your-own-theme/index.html b/docs/build-your-own-theme/index.html
index 05718e5c1..1a986155e 100644
--- a/docs/build-your-own-theme/index.html
+++ b/docs/build-your-own-theme/index.html
@@ -5,7 +5,7 @@
Creating Your Own Theme | Touying
-
+
diff --git a/docs/category/dynamic-slides/index.html b/docs/category/dynamic-slides/index.html
index 6aba668ba..04b9c39e0 100644
--- a/docs/category/dynamic-slides/index.html
+++ b/docs/category/dynamic-slides/index.html
@@ -5,7 +5,7 @@
Dynamic Slides | Touying
-
+
diff --git a/docs/category/external-tools/index.html b/docs/category/external-tools/index.html
index 8451f3b61..c6f11491c 100644
--- a/docs/category/external-tools/index.html
+++ b/docs/category/external-tools/index.html
@@ -5,7 +5,7 @@
External Tools | Touying
-
+
diff --git a/docs/category/package-integration/index.html b/docs/category/package-integration/index.html
index 31477bd0a..efd66905e 100644
--- a/docs/category/package-integration/index.html
+++ b/docs/category/package-integration/index.html
@@ -5,7 +5,7 @@
Package Integration | Touying
-
+
diff --git a/docs/category/progress/index.html b/docs/category/progress/index.html
index 809f7cbee..1f4428bdc 100644
--- a/docs/category/progress/index.html
+++ b/docs/category/progress/index.html
@@ -5,7 +5,7 @@
Progress | Touying
-
+
diff --git a/docs/category/themes/index.html b/docs/category/themes/index.html
index a0c5bd195..eb482673d 100644
--- a/docs/category/themes/index.html
+++ b/docs/category/themes/index.html
@@ -5,7 +5,7 @@
Themes | Touying
-
+
diff --git a/docs/category/utilities/index.html b/docs/category/utilities/index.html
index fa8d5f70f..9929c7f05 100644
--- a/docs/category/utilities/index.html
+++ b/docs/category/utilities/index.html
@@ -5,7 +5,7 @@
Utilities | Touying
-
+
diff --git a/docs/changelog/index.html b/docs/changelog/index.html
index 46842e550..5422c0bc8 100644
--- a/docs/changelog/index.html
+++ b/docs/changelog/index.html
@@ -5,7 +5,7 @@
Changelog | Touying
-
+
diff --git a/docs/code-styles/index.html b/docs/code-styles/index.html
index b655820ba..80921ee95 100644
--- a/docs/code-styles/index.html
+++ b/docs/code-styles/index.html
@@ -5,7 +5,7 @@
Code Style | Touying
-
+
diff --git a/docs/dynamic/complex/index.html b/docs/dynamic/complex/index.html
index 18074565d..2584c1d35 100644
--- a/docs/dynamic/complex/index.html
+++ b/docs/dynamic/complex/index.html
@@ -5,7 +5,7 @@
Complex Animations | Touying
-
+
diff --git a/docs/dynamic/cover/index.html b/docs/dynamic/cover/index.html
index 89d746dfb..558da7a7d 100644
--- a/docs/dynamic/cover/index.html
+++ b/docs/dynamic/cover/index.html
@@ -5,7 +5,7 @@
Cover Function | Touying
-
+
diff --git a/docs/dynamic/equation/index.html b/docs/dynamic/equation/index.html
index 9656589d2..862469ec9 100644
--- a/docs/dynamic/equation/index.html
+++ b/docs/dynamic/equation/index.html
@@ -5,7 +5,7 @@
Math Equation Animations | Touying
-
+
diff --git a/docs/dynamic/handout/index.html b/docs/dynamic/handout/index.html
index ffc0b4a0b..48a695fb8 100644
--- a/docs/dynamic/handout/index.html
+++ b/docs/dynamic/handout/index.html
@@ -5,7 +5,7 @@
Handout Mode | Touying
-
+
diff --git a/docs/dynamic/other/index.html b/docs/dynamic/other/index.html
index f43609c24..5b94eebee 100644
--- a/docs/dynamic/other/index.html
+++ b/docs/dynamic/other/index.html
@@ -5,7 +5,7 @@
Other Animations | Touying
-
+
diff --git a/docs/dynamic/simple/index.html b/docs/dynamic/simple/index.html
index ac04df635..188ba64e3 100644
--- a/docs/dynamic/simple/index.html
+++ b/docs/dynamic/simple/index.html
@@ -5,7 +5,7 @@
Simple Animations | Touying
-
+
diff --git a/docs/external/pdfpc/index.html b/docs/external/pdfpc/index.html
index 4ba1ef58d..48180eb51 100644
--- a/docs/external/pdfpc/index.html
+++ b/docs/external/pdfpc/index.html
@@ -5,7 +5,7 @@
Pdfpc | Touying
-
+
diff --git a/docs/external/typst-preview/index.html b/docs/external/typst-preview/index.html
index 1a9eab411..a9b9dfcf7 100644
--- a/docs/external/typst-preview/index.html
+++ b/docs/external/typst-preview/index.html
@@ -5,7 +5,7 @@
Typst Preview | Touying
-
+
diff --git a/docs/global-settings/index.html b/docs/global-settings/index.html
index 62bab174f..1a410fa6a 100644
--- a/docs/global-settings/index.html
+++ b/docs/global-settings/index.html
@@ -5,7 +5,7 @@
Global Settings | Touying
-
+
diff --git a/docs/integration/cetz/index.html b/docs/integration/cetz/index.html
index 022a6324a..dc05f3d93 100644
--- a/docs/integration/cetz/index.html
+++ b/docs/integration/cetz/index.html
@@ -5,7 +5,7 @@
CeTZ | Touying
-
+
diff --git a/docs/integration/codly/index.html b/docs/integration/codly/index.html
index 1e24fdbb9..7f895c85e 100644
--- a/docs/integration/codly/index.html
+++ b/docs/integration/codly/index.html
@@ -5,7 +5,7 @@
Codly | Touying
-
+
diff --git a/docs/integration/ctheorems/index.html b/docs/integration/ctheorems/index.html
index 76fbf53a8..c938a4b73 100644
--- a/docs/integration/ctheorems/index.html
+++ b/docs/integration/ctheorems/index.html
@@ -5,7 +5,7 @@
Ctheorems | Touying
-
+
diff --git a/docs/integration/fletcher/index.html b/docs/integration/fletcher/index.html
index 4334664ca..899a571d0 100644
--- a/docs/integration/fletcher/index.html
+++ b/docs/integration/fletcher/index.html
@@ -5,7 +5,7 @@
Fletcher | Touying
-
+
diff --git a/docs/integration/mitex/index.html b/docs/integration/mitex/index.html
index dfa003c49..0454780ce 100644
--- a/docs/integration/mitex/index.html
+++ b/docs/integration/mitex/index.html
@@ -5,7 +5,7 @@
MiTeX | Touying
-
+
diff --git a/docs/integration/pinit/index.html b/docs/integration/pinit/index.html
index eaa6b90c9..b45b598b1 100644
--- a/docs/integration/pinit/index.html
+++ b/docs/integration/pinit/index.html
@@ -5,7 +5,7 @@
Pinit | Touying
-
+
diff --git a/docs/intro/index.html b/docs/intro/index.html
index cd52325cc..16f520441 100644
--- a/docs/intro/index.html
+++ b/docs/intro/index.html
@@ -5,7 +5,7 @@
Introduction to Touying | Touying
-
+
diff --git a/docs/layout/index.html b/docs/layout/index.html
index 934e7995c..88138dc2e 100644
--- a/docs/layout/index.html
+++ b/docs/layout/index.html
@@ -5,7 +5,7 @@
Page Layout | Touying
-
+
diff --git a/docs/multi-file/index.html b/docs/multi-file/index.html
index 1f2108193..172063315 100644
--- a/docs/multi-file/index.html
+++ b/docs/multi-file/index.html
@@ -5,7 +5,7 @@
Multi-File Architecture | Touying
-
+
diff --git a/docs/next/build-your-own-theme/index.html b/docs/next/build-your-own-theme/index.html
index c1d3fbf54..d63014b62 100644
--- a/docs/next/build-your-own-theme/index.html
+++ b/docs/next/build-your-own-theme/index.html
@@ -5,7 +5,7 @@
Creating Your Own Theme | Touying
-
+
@@ -28,16 +28,16 @@
Mo
Copy the theme code from the themes directory to your local machine. For example, copy themes/university.typ to a local file named university.typ.
Remove all #import "../xxx.typ" commands at the top of the university.typ file.
-
Add #import "@preview/touying:0.4.0": * at the top of the university.typ file to import all modules.
+
Add #import "@preview/touying:0.4.1": * at the top of the university.typ file to import all modules.
Replace self: s in the register function with self: themes.default.register()(Important).
You can then import and use the theme by:
-
#import "@preview/touying:0.4.0": * #import "university.typ" #let s = university.register(aspect-ratio: "16-9")
+
#import "@preview/touying:0.4.1": * #import "university.typ" #let s = university.register(aspect-ratio: "16-9")
Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted.
Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:
-
// bamboo.typ #import "@preview/touying:0.4.0": * #let register( self: themes.default.register(), aspect-ratio: "16-9", ) = { self.page-args += ( paper: "presentation-" + aspect-ratio, ) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.0": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide) = utils.slides(s) #show: slides = First Section == First Slide #slide[ A slide with a title and an *important* information. ]
+
// bamboo.typ #import "@preview/touying:0.4.1": * #let register( self: themes.default.register(), aspect-ratio: "16-9", ) = { self.page-args += ( paper: "presentation-" + aspect-ratio, ) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.1": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9") #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide) = utils.slides(s) #show: slides = First Section == First Slide #slide[ A slide with a title and an *important* information. ]
As you can see, we created a register function and passed an aspect-ratio parameter to set the page aspect ratio. We get default self by self: themes.default.register(). As you might already know, in Touying, we should not use set page(..) to set page parameters but rather use the syntax self.page-args += (..) to set them, as explained in the Page Layout section.
In addition, we registered a self.methods.init method, which can be used for some global style settings. For example, in this case, we added set text(size: 20pt) to set the font size. You can also place additional global style settings here, such as set par(justify: true). Since the init function is placed inside self.methods, it is a method, not a regular function. Therefore, we need to add the parameter self: none to use it properly.
As you can see, later in main.typ, we apply the global style settings in init using #show: init, where init is bound and unpacked through utils.methods(s).
@@ -72,7 +72,7 @@
Cus
We observe the usage of utils.call-or-display(self, self.bamboo-footer) to display self.bamboo-footer. This is used to handle situations like self.bamboo-footer = (self) => {..}, ensuring a unified approach to displaying content functions and content.
To ensure proper display of the header and footer and sufficient spacing from the main content, we also set margins, such as self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em)).
We also need to customize a slide method that accepts slide(self: none, title: auto, ..args). The first self: none is a required method parameter for getting the latest self. The second title is used to update self.bamboo-title for displaying in the header. The third ..args collects the remaining parameters and passes them to (self.methods.touying-slide)(self: self, ..args), which is necessary for the Touying slide functionality to work properly. Additionally, we need to register this method in the register function with self.methods.slide = slide.
-
// bamboo.typ #import "@preview/touying:0.4.0": * #let slide(self: none, title: auto, ..args) = { if title != auto { self.bamboo-title = title } (self.methods.touying-slide)(self: self, ..args) } #let register( self: themes.default.register(), aspect-ratio: "16-9", footer: [], ) = { // color theme self = (self.methods.colors)( self: self, primary: rgb("#5E8B65"), neutral-lightest: rgb("#ffffff"), neutral-darkest: rgb("#000000"), ) // variables for later use self.bamboo-title = [] self.bamboo-footer = footer // set page let header(self) = { set align(top) show: components.cell.with(fill: self.colors.primary, inset: 1em) set align(horizon) set text(fill: self.colors.neutral-lightest, size: .7em) states.current-section-title linebreak() set text(size: 1.5em) utils.call-or-display(self, self.bamboo-title) } let footer(self) = { set align(bottom) show: pad.with(.4em) set text(fill: self.colors.neutral-darkest, size: .8em) utils.call-or-display(self, self.bamboo-footer) h(1fr) states.slide-counter.display() + " / " + states.last-slide-number } self.page-args += ( paper: "presentation-" + aspect-ratio, header: header, footer: footer, margin: (top: 4em, bottom: 1.5em, x: 2em), ) // register methods self.methods.slide = slide self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.0": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide) = utils.slides(s) #show: slides = First Section == First Slide #slide[ A slide with a title and an *important* information. ]
+
// bamboo.typ #import "@preview/touying:0.4.1": * #let slide(self: none, title: auto, ..args) = { if title != auto { self.bamboo-title = title } (self.methods.touying-slide)(self: self, ..args) } #let register( self: themes.default.register(), aspect-ratio: "16-9", footer: [], ) = { // color theme self = (self.methods.colors)( self: self, primary: rgb("#5E8B65"), neutral-lightest: rgb("#ffffff"), neutral-darkest: rgb("#000000"), ) // variables for later use self.bamboo-title = [] self.bamboo-footer = footer // set page let header(self) = { set align(top) show: components.cell.with(fill: self.colors.primary, inset: 1em) set align(horizon) set text(fill: self.colors.neutral-lightest, size: .7em) states.current-section-title linebreak() set text(size: 1.5em) utils.call-or-display(self, self.bamboo-title) } let footer(self) = { set align(bottom) show: pad.with(.4em) set text(fill: self.colors.neutral-darkest, size: .8em) utils.call-or-display(self, self.bamboo-footer) h(1fr) states.slide-counter.display() + " / " + states.last-slide-number } self.page-args += ( paper: "presentation-" + aspect-ratio, header: header, footer: footer, margin: (top: 4em, bottom: 1.5em, x: 2em), ) // register methods self.methods.slide = slide self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.1": * #import "bamboo.typ" #let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution) #let (init, slides, touying-outline, alert) = utils.methods(s) #show: init #show strong: alert #let (slide, empty-slide) = utils.slides(s) #show: slides = First Section == First Slide #slide[ A slide with a title and an *important* information. ]
Building upon the basic slide, we further add some special slide functions such as title-slide, focus-slide, and a custom slides method.
@@ -81,7 +81,7 @@
Custom
For the new-section-slide method, the process is similar. The only thing to note is that in (self.methods.touying-slide)(self: self, repeat: none, section: section, body), we pass an additional section: section parameter to declare the creation of a new section. Another point to note is that besides self.methods.new-section-slide = new-section-slide, we also register self.methods.touying-new-section-slide = new-section-slide, so new-section-slide will be automatically called when encountering a first-level title.
For the focus-slide method, most of the content is similar, but it's worth noting that we use self.page-args += (..) to update the page's background color.
Finally, we update the slides(self: none, title-slide: true, slide-level: 1, ..args) method. When title-slide is true, using #show: slides will automatically create a title-slide. Setting slide-level: 1 indicates that the first-level and second-level titles correspond to section and title, respectively.
-
// bamboo.typ #import "@preview/touying:0.4.0": * #let slide(self: none, title: auto, ..args) = { if title != auto { self.bamboo-title = title } (self.methods.touying-slide)(self: self, ..args) } #let title-slide(self: none, ..args) = { self = utils.empty-page(self) let info = self.info + args.named() let body = { set align(center + horizon) block( fill: self.colors.primary, width: 80%, inset: (y: 1em), radius: 1em, text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title) ) set text(fill: self.colors.neutral-darkest) if info.author != none { block(info.author) } if info.date != none { block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date }) } } (self.methods.touying-slide)(self: self, repeat: none, body) } #let new-section-slide(self: none, section) = { self = utils.empty-page(self) let body = { set align(center + horizon) set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic") section } (self.methods.touying-slide)(self: self, repeat: none, section: section, body) } #let focus-slide(self: none, body) = { self = utils.empty-page(self) self.page-args += ( fill: self.colors.primary, margin: 2em, ) set text(fill: self.colors.neutral-lightest, size: 2em) (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body)) } #let slides(self: none, title-slide: true, slide-level: 1, ..args) = { if title-slide { (self.methods.title-slide)(self: self) } (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args) } #let register( self: themes.default.register(), aspect-ratio: "16-9", footer: [], ) = { // color theme self = (self.methods.colors)( self: self, primary: rgb("#5E8B65"), neutral-lightest: rgb("#ffffff"), neutral-darkest: rgb("#000000"), ) // variables for later use self.bamboo-title = [] self.bamboo-footer = footer // set page let header(self) = { set align(top) show: components.cell.with(fill: self.colors.primary, inset: 1em) set align(horizon) set text(fill: self.colors.neutral-lightest, size: .7em) states.current-section-title linebreak() set text(size: 1.5em) utils.call-or-display(self, self.bamboo-title) } let footer(self) = { set align(bottom) show: pad.with(.4em) set text(fill: self.colors.neutral-darkest, size: .8em) utils.call-or-display(self, self.bamboo-footer) h(1fr) states.slide-counter.display() + " / " + states.last-slide-number } self.page-args += ( paper: "presentation-" + aspect-ratio, header: header, footer: footer, margin: (top: 4em, bottom: 1.5em, x: 2em), ) // register methods self.methods.slide = slide self.methods.title-slide = title-slide self.methods.new-section-slide = new-section-slide self.methods.touying-new-section-slide = new-section-slide self.methods.focus-slide = focus-slide self.methods.slides = slides self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.0": * #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) = 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! ]
+
// bamboo.typ #import "@preview/touying:0.4.1": * #let slide(self: none, title: auto, ..args) = { if title != auto { self.bamboo-title = title } (self.methods.touying-slide)(self: self, ..args) } #let title-slide(self: none, ..args) = { self = utils.empty-page(self) let info = self.info + args.named() let body = { set align(center + horizon) block( fill: self.colors.primary, width: 80%, inset: (y: 1em), radius: 1em, text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title) ) set text(fill: self.colors.neutral-darkest) if info.author != none { block(info.author) } if info.date != none { block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date }) } } (self.methods.touying-slide)(self: self, repeat: none, body) } #let new-section-slide(self: none, section) = { self = utils.empty-page(self) let body = { set align(center + horizon) set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic") section } (self.methods.touying-slide)(self: self, repeat: none, section: section, body) } #let focus-slide(self: none, body) = { self = utils.empty-page(self) self.page-args += ( fill: self.colors.primary, margin: 2em, ) set text(fill: self.colors.neutral-lightest, size: 2em) (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body)) } #let slides(self: none, title-slide: true, slide-level: 1, ..args) = { if title-slide { (self.methods.title-slide)(self: self) } (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args) } #let register( self: themes.default.register(), aspect-ratio: "16-9", footer: [], ) = { // color theme self = (self.methods.colors)( self: self, primary: rgb("#5E8B65"), neutral-lightest: rgb("#ffffff"), neutral-darkest: rgb("#000000"), ) // variables for later use self.bamboo-title = [] self.bamboo-footer = footer // set page let header(self) = { set align(top) show: components.cell.with(fill: self.colors.primary, inset: 1em) set align(horizon) set text(fill: self.colors.neutral-lightest, size: .7em) states.current-section-title linebreak() set text(size: 1.5em) utils.call-or-display(self, self.bamboo-title) } let footer(self) = { set align(bottom) show: pad.with(.4em) set text(fill: self.colors.neutral-darkest, size: .8em) utils.call-or-display(self, self.bamboo-footer) h(1fr) states.slide-counter.display() + " / " + states.last-slide-number } self.page-args += ( paper: "presentation-" + aspect-ratio, header: header, footer: footer, margin: (top: 4em, bottom: 1.5em, x: 2em), ) // register methods self.methods.slide = slide self.methods.title-slide = title-slide self.methods.new-section-slide = new-section-slide self.methods.touying-new-section-slide = new-section-slide self.methods.focus-slide = focus-slide self.methods.slides = slides self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it) self.methods.init = (self: none, body) => { set text(size: 20pt) body } self } // main.typ #import "@preview/touying:0.4.1": * #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) = 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! ]
Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming.
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.
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:
You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an s.methods.touying-new-section-slide method, so Touying will automatically call this method.
If we don't want it to automatically create such a section slide, we can delete this method:
Similarly, we can modify s.methods.touying-new-subsection-slide to do the same for subsection.
In fact, besides s.methods.touying-new-section-slide, another special slide function is the s.methods.slide function, which will be called by default in simple style when #slide[...] is not explicitly used.
Also, since #slide[...] is registered in s.slides = ("slide",), the section, subsection, and title parameters will be automatically passed, while others like #focus-slide[...] will not automatically receive these three parameters.
-
Principle
In fact, you can also not use #show: slides and utils.slides(s), but only use utils.methods(s), for example:
Here, you need to manually pass in section, subsection, and title, but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages.
Here, you need to manually pass in section, subsection, and title, but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages.