From 4d47f4664242ee60c0f99ac1107355446a10ca37 Mon Sep 17 00:00:00 2001 From: OrangeX4 <34951714+OrangeX4@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:30:35 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20touying-?= =?UTF-8?q?typ/touying@7371f5e61446cd6c435e741862d1c2af1f26ba00=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- assets/js/2c0b54ac.12d8c55e.js | 1 + assets/js/2c0b54ac.86a3428b.js | 1 - assets/js/396cf6b9.8a088474.js | 1 + assets/js/396cf6b9.c8033c26.js | 1 - assets/js/472f8a66.3567e29a.js | 1 + assets/js/472f8a66.7efc0f2c.js | 1 - assets/js/4bb9edb3.c485fc1b.js | 1 + assets/js/4bb9edb3.eb5b5656.js | 1 - assets/js/51a4d3bf.3d956087.js | 1 + assets/js/51a4d3bf.6dcf872f.js | 1 - assets/js/5a57e638.79e50363.js | 1 + assets/js/5a57e638.7f12e2df.js | 1 - assets/js/6b839bb6.28c5ab65.js | 1 - assets/js/6b839bb6.95abb783.js | 1 + assets/js/80a0c88e.0b40e1f2.js | 1 - assets/js/80a0c88e.b2547112.js | 1 + .../{935f2afb.23d8684b.js => 935f2afb.fd7ce045.js} | 2 +- assets/js/98ce8162.89b1c59e.js | 1 + assets/js/98ce8162.b2fca771.js | 1 - assets/js/d16cbc15.8094c876.js | 1 - assets/js/d16cbc15.fd212767.js | 1 + ...e~main.63ef563a.js => runtime~main.a5613f9e.js} | 2 +- blog/archive/index.html | 2 +- blog/index.html | 2 +- blog/tags/development/index.html | 2 +- blog/tags/index.html | 2 +- blog/touying-0-2-0/index.html | 2 +- docs/build-your-own-theme/index.html | 2 +- docs/category/dynamic-slides/index.html | 2 +- docs/category/external-tools/index.html | 2 +- docs/category/progress/index.html | 2 +- docs/category/themes/index.html | 4 ++-- docs/category/utilities/index.html | 2 +- docs/changelog/index.html | 2 +- docs/dynamic/complex/index.html | 4 +++- docs/dynamic/cover/index.html | 2 +- docs/dynamic/equation/index.html | 4 +++- docs/dynamic/handout/index.html | 2 +- docs/dynamic/simple/index.html | 5 ++++- docs/external/pdfpc/index.html | 2 +- docs/external/typst-preview/index.html | 2 +- docs/intro/index.html | 2 +- docs/layout/index.html | 7 +++++-- docs/progress/counters/index.html | 2 +- docs/progress/sections/index.html | 2 +- docs/start/index.html | 4 +++- docs/style/index.html | 4 +++- docs/themes/dewdrop/index.html | 6 ++++-- docs/themes/metropolis/index.html | 6 ++++-- docs/themes/simple/index.html | 6 ++++-- docs/utilities/fit-to/index.html | 6 +++--- docs/utilities/oop/index.html | 2 +- index.html | 2 +- markdown-page/index.html | 2 +- zh/404.html | 2 +- .../{339ee8e1.9ca837f0.js => 339ee8e1.56905318.js} | 2 +- zh/assets/js/43883141.970f1684.js | 1 + zh/assets/js/43883141.dc54358b.js | 1 - zh/assets/js/6ab64546.aefc3306.js | 1 + zh/assets/js/6ab64546.b59333ef.js | 1 - zh/assets/js/737adc8d.83296a3e.js | 1 - zh/assets/js/737adc8d.db2503f5.js | 1 + zh/assets/js/8c4e5360.5fdc98ba.js | 1 - zh/assets/js/8c4e5360.c486956f.js | 1 + .../{935f2afb.3ba91ffb.js => 935f2afb.8fd5cac2.js} | 2 +- zh/assets/js/b885bf58.675e4625.js | 1 + zh/assets/js/b885bf58.7923b84a.js | 1 - zh/assets/js/ce05be13.7e685a8c.js | 1 - zh/assets/js/ce05be13.fb3adc95.js | 1 + zh/assets/js/d21a173f.80dafc04.js | 1 + zh/assets/js/d21a173f.b917e6e4.js | 1 - zh/assets/js/eb154561.0316d559.js | 1 + zh/assets/js/eb154561.4e972827.js | 1 - zh/assets/js/f6262a69.06fafcfe.js | 1 - zh/assets/js/f6262a69.9f62a746.js | 1 + ...e~main.1d08e914.js => runtime~main.e927673b.js} | 2 +- zh/blog/archive/index.html | 2 +- zh/blog/index.html | 2 +- zh/blog/tags/development/index.html | 2 +- zh/blog/tags/index.html | 2 +- zh/blog/touying-0-2-0/index.html | 2 +- zh/docs/build-your-own-theme/index.html | 2 +- zh/docs/category/dynamic-slides/index.html | 2 +- zh/docs/category/external-tools/index.html | 2 +- zh/docs/category/progress/index.html | 2 +- zh/docs/category/themes/index.html | 4 ++-- zh/docs/category/utilities/index.html | 2 +- zh/docs/changelog/index.html | 2 +- zh/docs/dynamic/complex/index.html | 6 ++++-- zh/docs/dynamic/cover/index.html | 2 +- zh/docs/dynamic/equation/index.html | 4 +++- zh/docs/dynamic/handout/index.html | 2 +- zh/docs/dynamic/simple/index.html | 5 ++++- zh/docs/external/pdfpc/index.html | 2 +- zh/docs/external/typst-preview/index.html | 2 +- zh/docs/intro/index.html | 2 +- zh/docs/layout/index.html | 9 ++++++--- zh/docs/progress/counters/index.html | 2 +- zh/docs/progress/sections/index.html | 2 +- zh/docs/start/index.html | 6 ++++-- zh/docs/style/index.html | 4 +++- zh/docs/themes/dewdrop/index.html | 14 ++++++++------ zh/docs/themes/metropolis/index.html | 6 ++++-- zh/docs/themes/simple/index.html | 8 +++++--- zh/docs/utilities/fit-to/index.html | 6 +++--- zh/docs/utilities/oop/index.html | 2 +- zh/index.html | 2 +- zh/markdown-page/index.html | 2 +- 109 files changed, 152 insertions(+), 112 deletions(-) create mode 100644 assets/js/2c0b54ac.12d8c55e.js delete mode 100644 assets/js/2c0b54ac.86a3428b.js create mode 100644 assets/js/396cf6b9.8a088474.js delete mode 100644 assets/js/396cf6b9.c8033c26.js create mode 100644 assets/js/472f8a66.3567e29a.js delete mode 100644 assets/js/472f8a66.7efc0f2c.js create mode 100644 assets/js/4bb9edb3.c485fc1b.js delete mode 100644 assets/js/4bb9edb3.eb5b5656.js create mode 100644 assets/js/51a4d3bf.3d956087.js delete mode 100644 assets/js/51a4d3bf.6dcf872f.js create mode 100644 assets/js/5a57e638.79e50363.js delete mode 100644 assets/js/5a57e638.7f12e2df.js delete mode 100644 assets/js/6b839bb6.28c5ab65.js create mode 100644 assets/js/6b839bb6.95abb783.js delete mode 100644 assets/js/80a0c88e.0b40e1f2.js create mode 100644 assets/js/80a0c88e.b2547112.js rename assets/js/{935f2afb.23d8684b.js => 935f2afb.fd7ce045.js} (88%) create mode 100644 assets/js/98ce8162.89b1c59e.js delete mode 100644 assets/js/98ce8162.b2fca771.js delete mode 100644 assets/js/d16cbc15.8094c876.js create mode 100644 assets/js/d16cbc15.fd212767.js rename assets/js/{runtime~main.63ef563a.js => runtime~main.a5613f9e.js} (59%) rename zh/assets/js/{339ee8e1.9ca837f0.js => 339ee8e1.56905318.js} (68%) create mode 100644 zh/assets/js/43883141.970f1684.js delete mode 100644 zh/assets/js/43883141.dc54358b.js create mode 100644 zh/assets/js/6ab64546.aefc3306.js delete mode 100644 zh/assets/js/6ab64546.b59333ef.js delete mode 100644 zh/assets/js/737adc8d.83296a3e.js create mode 100644 zh/assets/js/737adc8d.db2503f5.js delete mode 100644 zh/assets/js/8c4e5360.5fdc98ba.js create mode 100644 zh/assets/js/8c4e5360.c486956f.js rename zh/assets/js/{935f2afb.3ba91ffb.js => 935f2afb.8fd5cac2.js} (88%) create mode 100644 zh/assets/js/b885bf58.675e4625.js delete mode 100644 zh/assets/js/b885bf58.7923b84a.js delete mode 100644 zh/assets/js/ce05be13.7e685a8c.js create mode 100644 zh/assets/js/ce05be13.fb3adc95.js create mode 100644 zh/assets/js/d21a173f.80dafc04.js delete mode 100644 zh/assets/js/d21a173f.b917e6e4.js create mode 100644 zh/assets/js/eb154561.0316d559.js delete mode 100644 zh/assets/js/eb154561.4e972827.js delete mode 100644 zh/assets/js/f6262a69.06fafcfe.js create mode 100644 zh/assets/js/f6262a69.9f62a746.js rename zh/assets/js/{runtime~main.1d08e914.js => runtime~main.e927673b.js} (91%) diff --git a/404.html b/404.html index 9f134ac72..e83e58f7f 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@ Page Not Found | Touying - + diff --git a/assets/js/2c0b54ac.12d8c55e.js b/assets/js/2c0b54ac.12d8c55e.js new file mode 100644 index 000000000..af19e8353 --- /dev/null +++ b/assets/js/2c0b54ac.12d8c55e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[80],{8925:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>a,frontMatter:()=>o,metadata:()=>d,toc:()=>h});var n=i(5893),s=i(1151);const o={sidebar_position:2},r="Fit to Height / Width",d={id:"utilities/fit-to",title:"Fit to Height / Width",description:"Thanks to ntjess for the code.",source:"@site/docs/utilities/fit-to.md",sourceDirName:"utilities",slug:"/utilities/fit-to",permalink:"/touying/docs/utilities/fit-to",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/utilities/fit-to.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Object-Oriented Programming",permalink:"/touying/docs/utilities/oop"},next:{title:"External Tools",permalink:"/touying/docs/category/external-tools"}},c={},h=[{value:"Fit to Height",id:"fit-to-height",level:2},{value:"Fit to Width",id:"fit-to-width",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"fit-to-height--width",children:"Fit to Height / Width"}),"\n",(0,n.jsxs)(t.p,{children:["Thanks to ",(0,n.jsx)(t.a,{href:"https://github.com/ntjess",children:"ntjess"})," for the code."]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-height",children:"Fit to Height"}),"\n",(0,n.jsxs)(t.p,{children:["If you need to make an image fill the remaining slide height, you can try the ",(0,n.jsx)(t.code,{children:"fit-to-height"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#utils.fit-to-height(1fr)[BIG]\n"})}),"\n",(0,n.jsx)(t.p,{children:"Function definition:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-height(\n width: none, prescale-width: none, grow: true, shrink: true, height, body\n) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"Parameters:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": If specified, this will determine the width of the content after scaling. So, if you want the scaled content to fill half of the slide width, you can use ",(0,n.jsx)(t.code,{children:"width: 50%"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"prescale-width"}),": This parameter allows you to make Typst's layout assume that the given content is to be laid out in a container of a certain width before scaling. For example, you can use ",(0,n.jsx)(t.code,{children:"prescale-width: 200%"})," assuming the slide's width is twice the original."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": Whether it can grow, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": Whether it can shrink, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"height"}),": The specified height."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": The specific content."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-width",children:"Fit to Width"}),"\n",(0,n.jsxs)(t.p,{children:["If you need to limit the title width to exactly fill the slide width, you can try the ",(0,n.jsx)(t.code,{children:"fit-to-width"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#utils.fit-to-width(1fr)[#lorem(20)]\n"})}),"\n",(0,n.jsx)(t.p,{children:"Function definition:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-width(grow: true, shrink: true, width, body) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"Parameters:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": Whether it can grow, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": Whether it can shrink, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": The specified width."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": The specific content."]}),"\n"]})]})}function a(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,i)=>{i.d(t,{Z:()=>d,a:()=>r});var n=i(7294);const s={},o=n.createContext(s);function r(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2c0b54ac.86a3428b.js b/assets/js/2c0b54ac.86a3428b.js deleted file mode 100644 index a02bf6db6..000000000 --- a/assets/js/2c0b54ac.86a3428b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[80],{8925:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>a,frontMatter:()=>o,metadata:()=>d,toc:()=>h});var n=i(5893),s=i(1151);const o={sidebar_position:2},r="Fit to Height / Width",d={id:"utilities/fit-to",title:"Fit to Height / Width",description:"Thanks to ntjess for the code.",source:"@site/docs/utilities/fit-to.md",sourceDirName:"utilities",slug:"/utilities/fit-to",permalink:"/touying/docs/utilities/fit-to",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/utilities/fit-to.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Object-Oriented Programming",permalink:"/touying/docs/utilities/oop"},next:{title:"External Tools",permalink:"/touying/docs/category/external-tools"}},c={},h=[{value:"Fit to Height",id:"fit-to-height",level:2},{value:"Fit to Width",id:"fit-to-width",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"fit-to-height--width",children:"Fit to Height / Width"}),"\n",(0,n.jsxs)(t.p,{children:["Thanks to ",(0,n.jsx)(t.a,{href:"https://github.com/ntjess",children:"ntjess"})," for the code."]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-height",children:"Fit to Height"}),"\n",(0,n.jsxs)(t.p,{children:["If you need to make an image fill the remaining slide height, you can try the ",(0,n.jsx)(t.code,{children:"fit-to-height"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#fit-to-height(1fr)[BIG]\n"})}),"\n",(0,n.jsx)(t.p,{children:"Function definition:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-height(\n width: none, prescale-width: none, grow: true, shrink: true, height, body\n) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"Parameters:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": If specified, this will determine the width of the content after scaling. So, if you want the scaled content to fill half of the slide width, you can use ",(0,n.jsx)(t.code,{children:"width: 50%"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"prescale-width"}),": This parameter allows you to make Typst's layout assume that the given content is to be laid out in a container of a certain width before scaling. For example, you can use ",(0,n.jsx)(t.code,{children:"prescale-width: 200%"})," assuming the slide's width is twice the original."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": Whether it can grow, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": Whether it can shrink, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"height"}),": The specified height."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": The specific content."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-width",children:"Fit to Width"}),"\n",(0,n.jsxs)(t.p,{children:["If you need to limit the title width to exactly fill the slide width, you can try the ",(0,n.jsx)(t.code,{children:"fit-to-width"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#fit-to-width(1fr)[#lorem(20)]\n"})}),"\n",(0,n.jsx)(t.p,{children:"Function definition:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-width(grow: true, shrink: true, width, body) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"Parameters:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": Whether it can grow, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": Whether it can shrink, default is ",(0,n.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": The specified width."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": The specific content."]}),"\n"]})]})}function a(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,i)=>{i.d(t,{Z:()=>d,a:()=>r});var n=i(7294);const s={},o=n.createContext(s);function r(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/396cf6b9.8a088474.js b/assets/js/396cf6b9.8a088474.js new file mode 100644 index 000000000..24535249a --- /dev/null +++ b/assets/js/396cf6b9.8a088474.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9705],{4885:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>l});var i=s(5893),t=s(1151);const o={sidebar_position:1},a="Simple Animations",d={id:"dynamic/simple",title:"Simple Animations",description:"Touying provides two markers for simple animation effects: #pause and #meanwhile.",source:"@site/docs/dynamic/simple.md",sourceDirName:"dynamic",slug:"/dynamic/simple",permalink:"/touying/docs/dynamic/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Dynamic Slides",permalink:"/touying/docs/category/dynamic-slides"},next:{title:"Complex Animations",permalink:"/touying/docs/dynamic/complex"}},c={},l=[{value:"pause",id:"pause",level:2},{value:"meanwhile",id:"meanwhile",level:2},{value:"Handling set-show rules",id:"handling-set-show-rules",level:2}];function r(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides two markers for simple animation effects: ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pause",children:"pause"}),"\n",(0,i.jsxs)(n.p,{children:["The purpose of ",(0,i.jsx)(n.code,{children:"#pause"})," is straightforward \u2013 it separates the subsequent content into the next subslide. You can use multiple ",(0,i.jsx)(n.code,{children:"#pause"})," to create multiple subslides. Here's a simple example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First #pause Second\n\n #pause\n\n Third\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a3bed1d3-e660-456d-8a54-a914436f43bf",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"This example will create three subslides, gradually revealing the content."}),"\n",(0,i.jsxs)(n.p,{children:["As you can see, ",(0,i.jsx)(n.code,{children:"#pause"})," can be used inline or on a separate line."]}),"\n",(0,i.jsx)(n.h2,{id:"meanwhile",children:"meanwhile"}),"\n",(0,i.jsxs)(n.p,{children:["In some cases, you may need to display additional content simultaneously with ",(0,i.jsx)(n.code,{children:"#pause"}),". In such cases, you can use ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First\n \n #pause\n \n Second\n\n #meanwhile\n\n Third\n\n #pause\n\n Fourth\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/24ca19a3-b27c-4d31-ab75-09c37911e6ac",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:'This example will create only two subslides, with "First" and "Third" displayed simultaneously, and "Second" and "Fourth" displayed simultaneously.'}),"\n",(0,i.jsx)(n.h2,{id:"handling-set-show-rules",children:"Handling set-show rules"}),"\n",(0,i.jsxs)(n.p,{children:["If you use set-show rules inside ",(0,i.jsx)(n.code,{children:"slide[..]"}),", you might be surprised to find that subsequent ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"})," do not work. This is because Touying cannot detect the content inside ",(0,i.jsx)(n.code,{children:"styled(..)"})," (content after set-show rules is encompassed by ",(0,i.jsx)(n.code,{children:"styled"}),")."]}),"\n",(0,i.jsxs)(n.p,{children:["To address this issue, Touying provides a ",(0,i.jsx)(n.code,{children:"setting"})," parameter for the ",(0,i.jsx)(n.code,{children:"#slide()"})," function. You can place your set-show rules in the ",(0,i.jsx)(n.code,{children:"setting"})," parameter. For example, changing the font color:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(setting: body => {\n set text(fill: blue)\n body\n})[\n First\n \n #pause\n \n Second\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["Similarly, Touying currently does not support ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"})," inside layout functions like ",(0,i.jsx)(n.code,{children:"grid"}),". This is due to the same limitation, but you can use the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"#slide()"})," to meet most requirements."]}),"\n",(0,i.jsx)(n.admonition,{title:"Internals",type:"tip",children:(0,i.jsxs)(n.p,{children:["Touying doesn't rely on ",(0,i.jsx)(n.code,{children:"counter"})," and ",(0,i.jsx)(n.code,{children:"locate"})," to implement ",(0,i.jsx)(n.code,{children:"#pause"}),". Instead, it has a parser written in Typst script. It parses the input content block as a sequence and then transforms and reorganizes this sequence into the series of subslides we need."]})})]})}function u(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>a});var i=s(7294);const t={},o=i.createContext(t);function a(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(t):e.components||t:a(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/396cf6b9.c8033c26.js b/assets/js/396cf6b9.c8033c26.js deleted file mode 100644 index 9a6471164..000000000 --- a/assets/js/396cf6b9.c8033c26.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9705],{4885:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>r});var i=s(5893),t=s(1151);const o={sidebar_position:1},d="Simple Animations",a={id:"dynamic/simple",title:"Simple Animations",description:"Touying provides two markers for simple animation effects: #pause and #meanwhile.",source:"@site/docs/dynamic/simple.md",sourceDirName:"dynamic",slug:"/dynamic/simple",permalink:"/touying/docs/dynamic/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Dynamic Slides",permalink:"/touying/docs/category/dynamic-slides"},next:{title:"Complex Animations",permalink:"/touying/docs/dynamic/complex"}},l={},r=[{value:"pause",id:"pause",level:2},{value:"meanwhile",id:"meanwhile",level:2},{value:"Handling set-show rules",id:"handling-set-show-rules",level:2}];function c(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides two markers for simple animation effects: ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pause",children:"pause"}),"\n",(0,i.jsxs)(n.p,{children:["The purpose of ",(0,i.jsx)(n.code,{children:"#pause"})," is straightforward \u2013 it separates the subsequent content into the next subslide. You can use multiple ",(0,i.jsx)(n.code,{children:"#pause"})," to create multiple subslides. Here's a simple example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First #pause Second\n\n #pause\n\n Third\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"This example will create three subslides, gradually revealing the content."}),"\n",(0,i.jsxs)(n.p,{children:["As you can see, ",(0,i.jsx)(n.code,{children:"#pause"})," can be used inline or on a separate line."]}),"\n",(0,i.jsx)(n.h2,{id:"meanwhile",children:"meanwhile"}),"\n",(0,i.jsxs)(n.p,{children:["In some cases, you may need to display additional content simultaneously with ",(0,i.jsx)(n.code,{children:"#pause"}),". In such cases, you can use ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First\n \n #pause\n \n Second\n\n #meanwhile\n\n Third\n\n #pause\n\n Fourth\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:'This example will create only two subslides, with "First" and "Third" displayed simultaneously, and "Second" and "Fourth" displayed simultaneously.'}),"\n",(0,i.jsx)(n.h2,{id:"handling-set-show-rules",children:"Handling set-show rules"}),"\n",(0,i.jsxs)(n.p,{children:["If you use set-show rules inside ",(0,i.jsx)(n.code,{children:"slide[..]"}),", you might be surprised to find that subsequent ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"})," do not work. This is because Touying cannot detect the content inside ",(0,i.jsx)(n.code,{children:"styled(..)"})," (content after set-show rules is encompassed by ",(0,i.jsx)(n.code,{children:"styled"}),")."]}),"\n",(0,i.jsxs)(n.p,{children:["To address this issue, Touying provides a ",(0,i.jsx)(n.code,{children:"setting"})," parameter for the ",(0,i.jsx)(n.code,{children:"#slide()"})," function. You can place your set-show rules in the ",(0,i.jsx)(n.code,{children:"setting"})," parameter. For example, changing the font color:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(setting: body => {\n set text(fill: blue)\n body\n})[\n First\n \n #pause\n \n Second\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Similarly, Touying currently does not support ",(0,i.jsx)(n.code,{children:"#pause"})," and ",(0,i.jsx)(n.code,{children:"#meanwhile"})," inside layout functions like ",(0,i.jsx)(n.code,{children:"grid"}),". This is due to the same limitation, but you can use the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"#slide()"})," to meet most requirements."]}),"\n",(0,i.jsx)(n.admonition,{title:"Internals",type:"tip",children:(0,i.jsxs)(n.p,{children:["Touying doesn't rely on ",(0,i.jsx)(n.code,{children:"counter"})," and ",(0,i.jsx)(n.code,{children:"locate"})," to implement ",(0,i.jsx)(n.code,{children:"#pause"}),". Instead, it has a parser written in Typst script. It parses the input content block as a sequence and then transforms and reorganizes this sequence into the series of subslides we need."]})})]})}function u(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>d});var i=s(7294);const t={},o=i.createContext(t);function d(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(t):e.components||t:d(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/472f8a66.3567e29a.js b/assets/js/472f8a66.3567e29a.js new file mode 100644 index 000000000..dc2c4a35a --- /dev/null +++ b/assets/js/472f8a66.3567e29a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},a="Layout Your Contents",c={id:"layout",title:"Layout Your Contents",description:"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes.",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/start"},next:{title:"Code Styles",permalink:"/touying/docs/style"}},l={},d=[{value:"Global Information",id:"global-information",level:2},{value:"Sections and Subsections",id:"sections-and-subsections",level:2},{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Page Columns",id:"page-columns",level:2}];function r(e){const n={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)(n.h1,{id:"layout-your-contents",children:"Layout Your Contents"}),"\n",(0,s.jsx)(n.p,{children:"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes."}),"\n",(0,s.jsx)(n.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(n.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"date"})," parameter can accept ",(0,s.jsx)(n.code,{children:"datetime"})," format and ",(0,s.jsx)(n.code,{children:"content"})," format. The display format of the date in ",(0,s.jsx)(n.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(n.admonition,{title:"Internals",type:"tip",children:[(0,s.jsx)(n.p,{children:"Here, we introduce a bit of the OOP concept in Touying."}),(0,s.jsxs)(n.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering. That is, Typst caches the results of previous function calls. This requires Typst to have only pure functions, meaning functions that do not change external variables. Therefore, it's challenging to modify a global variable in the true sense, as done in LaTeX. Even if you use ",(0,s.jsx)(n.code,{children:"state"})," or ",(0,s.jsx)(n.code,{children:"counter"}),", you need to use ",(0,s.jsx)(n.code,{children:"locate"})," and callback functions to access their values, and this approach has a significant impact on performance."]}),(0,s.jsxs)(n.p,{children:["Touying does not use ",(0,s.jsx)(n.code,{children:"state"})," and ",(0,s.jsx)(n.code,{children:"counter"}),", nor does it violate the Internals of Typst's pure functions. Instead, it cleverly uses a method in an object-oriented style to maintain a global singleton ",(0,s.jsx)(n.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We have a convention that methods have a named parameter ",(0,s.jsx)(n.code,{children:"self"})," to pass the object itself, and all methods are placed in the ",(0,s.jsx)(n.code,{children:".methods"})," domain. With this concept, it's not difficult to write a method to update ",(0,s.jsx)(n.code,{children:"info"}),":"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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)(n.p,{children:["This way, you can also understand the purpose of the ",(0,s.jsx)(n.code,{children:"utils.methods()"})," function: it binds ",(0,s.jsx)(n.code,{children:"self"})," to all methods of ",(0,s.jsx)(n.code,{children:"s"})," and returns it. It simplifies the subsequent use through unpacking syntax."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let (init, slide, slides) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concepts of sections and subsections."}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"#show: slides"})," mode, sections and subsections correspond to first-level and second-level titles, respectively. For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Section\n\n== Subsection\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/600876bb-941d-4841-af5c-27137bb04c54",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"However, the second-level title does not always correspond to the subsection. The specific mapping may vary depending on the theme."}),"\n",(0,s.jsxs)(n.p,{children:["In the more general ",(0,s.jsx)(n.code,{children:"#slide[..]"})," mode, sections and subsections are passed as parameters to the ",(0,s.jsx)(n.code,{children:"slide"})," function, for example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(section: [Let's start a new section!])[..]\n\n#slide(subsection: [Let's start a new subsection!])[..]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["This will create a new section and a new subsection, respectively. However, this change typically only affects the internal ",(0,s.jsx)(n.code,{children:"sections"})," state of Touying and is not displayed on the slide by default. The specific display may vary depending on the theme."]}),"\n",(0,s.jsxs)(n.p,{children:["Note that the ",(0,s.jsx)(n.code,{children:"section"})," and ",(0,s.jsx)(n.code,{children:"subsection"})," parameters of ",(0,s.jsx)(n.code,{children:"slide"})," can accept both content blocks and arrays in the format ",(0,s.jsx)(n.code,{children:"([title], [short-title])"})," or dictionaries in the format ",(0,s.jsx)(n.code,{children:"(title: [title], short-title: [short-title])"}),". The ",(0,s.jsx)(n.code,{children:"short-title"})," will be used in some special cases, such as in the navigation of the ",(0,s.jsx)(n.code,{children:"dewdrop"})," theme."]}),"\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.2.0": *\n\n#let (init, slide, touying-outline) = utils.methods(s)\n#show: init\n\n#slide[\n == Table of contents\n\n #touying-outline()\n]\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The definition of ",(0,s.jsx)(n.code,{children:"touying-oultine()"})," 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 internal enum parameters with ",(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:"#slide[\n == Table of contents\n\n #states.touying-final-sections(sections => ..)\n]\n"})}),"\n",(0,s.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,s.jsxs)(n.p,{children:["Due to the use of the ",(0,s.jsx)(n.code,{children:"set page(..)"})," command in Typst, which creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,s.jsx)(n.code,{children:"s.page-args"})," member variable in the singleton ",(0,s.jsx)(n.code,{children:"s"}),". These parameters are only applied when creating a new slide."]}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,s.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,s.jsx)(n.code,{children:"set page(..)"})," command yourself. Instead, you should modify the ",(0,s.jsx)(n.code,{children:"s.page-args"})," member variable inside ",(0,s.jsx)(n.code,{children:"s"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["This way, we can query the parameters of the current page in real-time using ",(0,s.jsx)(n.code,{children:"s.page-args"}),". This is useful for some functions that need to get page margins or the current page background color, such as ",(0,s.jsx)(n.code,{children:"transparent-cover"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,s.jsxs)(n.p,{children:["If you need to divide a page into two or three columns, you can use the default ",(0,s.jsx)(n.code,{children:"compose"})," feature provided by the Touying ",(0,s.jsx)(n.code,{children:"slide"})," function. The simplest examples are:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a39f88a2-f1ba-4420-8f78-6a0fc644704e",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,s.jsx)(n.code,{children:"composer"})," parameter of ",(0,s.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,s.jsx)(n.code,{children:"utils.with.side-by-side(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.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,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>a});var s=t(7294);const i={},o=s.createContext(i);function a(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:a(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/472f8a66.7efc0f2c.js b/assets/js/472f8a66.7efc0f2c.js deleted file mode 100644 index 0712a3f0c..000000000 --- a/assets/js/472f8a66.7efc0f2c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},a="Layout Your Contents",c={id:"layout",title:"Layout Your Contents",description:"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes.",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/start"},next:{title:"Code Styles",permalink:"/touying/docs/style"}},l={},d=[{value:"Global Information",id:"global-information",level:2},{value:"Sections and Subsections",id:"sections-and-subsections",level:2},{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Page Columns",id:"page-columns",level:2}];function r(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"layout-your-contents",children:"Layout Your Contents"}),"\n",(0,s.jsx)(n.p,{children:"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes."}),"\n",(0,s.jsx)(n.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(n.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"date"})," parameter can accept ",(0,s.jsx)(n.code,{children:"datetime"})," format and ",(0,s.jsx)(n.code,{children:"content"})," format. The display format of the date in ",(0,s.jsx)(n.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(n.admonition,{title:"Internals",type:"tip",children:[(0,s.jsx)(n.p,{children:"Here, we introduce a bit of the OOP concept in Touying."}),(0,s.jsxs)(n.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering. That is, Typst caches the results of previous function calls. This requires Typst to have only pure functions, meaning functions that do not change external variables. Therefore, it's challenging to modify a global variable in the true sense, as done in LaTeX. Even if you use ",(0,s.jsx)(n.code,{children:"state"})," or ",(0,s.jsx)(n.code,{children:"counter"}),", you need to use ",(0,s.jsx)(n.code,{children:"locate"})," and callback functions to access their values, and this approach has a significant impact on performance."]}),(0,s.jsxs)(n.p,{children:["Touying does not use ",(0,s.jsx)(n.code,{children:"state"})," and ",(0,s.jsx)(n.code,{children:"counter"}),", nor does it violate the Internals of Typst's pure functions. Instead, it cleverly uses a method in an object-oriented style to maintain a global singleton ",(0,s.jsx)(n.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We have a convention that methods have a named parameter ",(0,s.jsx)(n.code,{children:"self"})," to pass the object itself, and all methods are placed in the ",(0,s.jsx)(n.code,{children:".methods"})," domain. With this concept, it's not difficult to write a method to update ",(0,s.jsx)(n.code,{children:"info"}),":"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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)(n.p,{children:["This way, you can also understand the purpose of the ",(0,s.jsx)(n.code,{children:"utils.methods()"})," function: it binds ",(0,s.jsx)(n.code,{children:"self"})," to all methods of ",(0,s.jsx)(n.code,{children:"s"})," and returns it. It simplifies the subsequent use through unpacking syntax."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let (init, slide, slides) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concepts of sections and subsections."}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"#show: slides"})," mode, sections and subsections correspond to first-level and second-level titles, respectively. For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Section\n\n== Subsection\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:"However, the second-level title does not always correspond to the subsection. The specific mapping may vary depending on the theme."}),"\n",(0,s.jsxs)(n.p,{children:["In the more general ",(0,s.jsx)(n.code,{children:"#slide[..]"})," mode, sections and subsections are passed as parameters to the ",(0,s.jsx)(n.code,{children:"slide"})," function, for example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(section: [Let's start a new section!])[..]\n\n#slide(subsection: [Let's start a new subsection!])[..]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["This will create a new section and a new subsection, respectively. However, this change typically only affects the internal ",(0,s.jsx)(n.code,{children:"sections"})," state of Touying and is not displayed on the slide by default. The specific display may vary depending on the theme."]}),"\n",(0,s.jsxs)(n.p,{children:["Note that the ",(0,s.jsx)(n.code,{children:"section"})," and ",(0,s.jsx)(n.code,{children:"subsection"})," parameters of ",(0,s.jsx)(n.code,{children:"slide"})," can accept both content blocks and arrays in the format ",(0,s.jsx)(n.code,{children:"([title], [short-title])"})," or dictionaries in the format ",(0,s.jsx)(n.code,{children:"(title: [title], short-title: [short-title])"}),". The ",(0,s.jsx)(n.code,{children:"short-title"})," will be used in some special cases, such as in the navigation of the ",(0,s.jsx)(n.code,{children:"dewdrop"})," theme."]}),"\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.2.0": *\n\n#let (init, slide, touying-outline) = utils.methods(s)\n#show: init\n\n#slide[\n == Table of contents\n\n #touying-outline()\n]\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The definition of ",(0,s.jsx)(n.code,{children:"touying-oultine()"})," 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 internal enum parameters with ",(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:"#slide[\n == Table of contents\n\n #states.touying-final-sections(sections => ..)\n]\n"})}),"\n",(0,s.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,s.jsxs)(n.p,{children:["Due to the use of the ",(0,s.jsx)(n.code,{children:"set page(..)"})," command in Typst, which creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,s.jsx)(n.code,{children:"s.page-args"})," member variable in the singleton ",(0,s.jsx)(n.code,{children:"s"}),". These parameters are only applied when creating a new slide."]}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,s.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,s.jsx)(n.code,{children:"set page(..)"})," command yourself. Instead, you should modify the ",(0,s.jsx)(n.code,{children:"s.page-args"})," member variable inside ",(0,s.jsx)(n.code,{children:"s"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["This way, we can query the parameters of the current page in real-time using ",(0,s.jsx)(n.code,{children:"s.page-args"}),". This is useful for some functions that need to get page margins or the current page background color, such as ",(0,s.jsx)(n.code,{children:"transparent-cover"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,s.jsxs)(n.p,{children:["If you need to divide a page into two or three columns, you can use the default ",(0,s.jsx)(n.code,{children:"compose"})," feature provided by the Touying ",(0,s.jsx)(n.code,{children:"slide"})," function. The simplest examples are:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,s.jsx)(n.code,{children:"composer"})," parameter of ",(0,s.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,s.jsx)(n.code,{children:"utils.with.side-by-side(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[\n First column.\n][\n Second column.\n]\n"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>a});var s=t(7294);const i={},o=s.createContext(i);function a(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:a(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4bb9edb3.c485fc1b.js b/assets/js/4bb9edb3.c485fc1b.js new file mode 100644 index 000000000..a3010be3c --- /dev/null +++ b/assets/js/4bb9edb3.c485fc1b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3280],{567:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var t=i(5893),o=i(1151);const s={sidebar_position:3},a="Math Equation Animations",c={id:"dynamic/equation",title:"Math Equation Animations",description:"Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use pause and meanwhile within math equations.",source:"@site/docs/dynamic/equation.md",sourceDirName:"dynamic",slug:"/dynamic/equation",permalink:"/touying/docs/dynamic/equation",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/equation.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Complex Animations",permalink:"/touying/docs/dynamic/complex"},next:{title:"Cover Function",permalink:"/touying/docs/dynamic/cover"}},r={},l=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"Complex Animation",id:"complex-animation",level:2},{value:"Parameters",id:"parameters",level:2}];function u(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"math-equation-animations",children:"Math Equation Animations"}),"\n",(0,t.jsxs)(n.p,{children:["Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use ",(0,t.jsx)(n.code,{children:"pause"})," and ",(0,t.jsx)(n.code,{children:"meanwhile"})," within math equations."]}),"\n",(0,t.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,t.jsx)(n.p,{children:"Let's start with an example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide[\n Touying 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\n Touying equation is very simple.\n]\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d176e61f-c0da-4c2a-a1bf-52621be5adb2",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["We use the ",(0,t.jsx)(n.code,{children:"touying-equation"})," function to incorporate ",(0,t.jsx)(n.code,{children:"pause"})," and ",(0,t.jsx)(n.code,{children:"meanwhile"})," within the text of math equations (in fact, you can also use ",(0,t.jsx)(n.code,{children:"#pause"})," or ",(0,t.jsx)(n.code,{children:"#pause;"}),")."]}),"\n",(0,t.jsx)(n.p,{children:"As you would expect, the math equation is displayed step by step, making it suitable for presenters to demonstrate their math reasoning."}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,t.jsxs)(n.p,{children:["While the ",(0,t.jsx)(n.code,{children:"touying-equation"})," function is convenient, you should always be aware that it doesn't perform complex syntax analysis. It simply splits the string using regular expressions. Therefore, you should not use ",(0,t.jsx)(n.code,{children:"pause"})," or ",(0,t.jsx)(n.code,{children:"meanwhile"})," within functions like ",(0,t.jsx)(n.code,{children:"display(..)"}),"!"]})}),"\n",(0,t.jsx)(n.h2,{id:"complex-animation",children:"Complex Animation"}),"\n",(0,t.jsxs)(n.p,{children:["In fact, we can also use ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," within ",(0,t.jsx)(n.code,{children:"touying-equation"})," with a little trick:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #touying-equation(scope: (uncover: uncover), `\n f(x) &= pause x^2 + 2x + uncover("3-", 1) \\\n &= pause (x + 1)^2 \\\n `)\n])\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f2df14a2-6424-4c53-81f7-1595aa330660",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["We can pass the functions we need into the ",(0,t.jsx)(n.code,{children:"touying-equation"})," through the ",(0,t.jsx)(n.code,{children:"scope"})," parameter, such as ",(0,t.jsx)(n.code,{children:"uncover"})," in this example."]}),"\n",(0,t.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,t.jsxs)(n.p,{children:["The function definition of ",(0,t.jsx)(n.code,{children:"touying-equation"})," is:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let touying-equation(block: true, numbering: none, supplement: auto, scope: (:), body) = { .. }\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Therefore, you can pass parameters like ",(0,t.jsx)(n.code,{children:"block"}),", ",(0,t.jsx)(n.code,{children:"numbering"}),", and ",(0,t.jsx)(n.code,{children:"supplement"})," to ",(0,t.jsx)(n.code,{children:"touying-equation"})," just like using normal math equations."]})]})}function d(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>c,a:()=>a});var t=i(7294);const o={},s=t.createContext(o);function a(e){const n=t.useContext(s);return t.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(o):e.components||o:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4bb9edb3.eb5b5656.js b/assets/js/4bb9edb3.eb5b5656.js deleted file mode 100644 index d9170e2ec..000000000 --- a/assets/js/4bb9edb3.eb5b5656.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3280],{567:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var t=i(5893),o=i(1151);const s={sidebar_position:3},a="Math Equation Animations",c={id:"dynamic/equation",title:"Math Equation Animations",description:"Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use pause and meanwhile within math equations.",source:"@site/docs/dynamic/equation.md",sourceDirName:"dynamic",slug:"/dynamic/equation",permalink:"/touying/docs/dynamic/equation",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/equation.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Complex Animations",permalink:"/touying/docs/dynamic/complex"},next:{title:"Cover Function",permalink:"/touying/docs/dynamic/cover"}},r={},l=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"Complex Animation",id:"complex-animation",level:2},{value:"Parameters",id:"parameters",level:2}];function u(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"math-equation-animations",children:"Math Equation Animations"}),"\n",(0,t.jsxs)(n.p,{children:["Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use ",(0,t.jsx)(n.code,{children:"pause"})," and ",(0,t.jsx)(n.code,{children:"meanwhile"})," within math equations."]}),"\n",(0,t.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,t.jsx)(n.p,{children:"Let's start with an example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide[\n Touying 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\n Touying equation is very simple.\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["We use the ",(0,t.jsx)(n.code,{children:"touying-equation"})," function to incorporate ",(0,t.jsx)(n.code,{children:"pause"})," and ",(0,t.jsx)(n.code,{children:"meanwhile"})," within the text of math equations (in fact, you can also use ",(0,t.jsx)(n.code,{children:"#pause"})," or ",(0,t.jsx)(n.code,{children:"#pause;"}),")."]}),"\n",(0,t.jsx)(n.p,{children:"As you would expect, the math equation is displayed step by step, making it suitable for presenters to demonstrate their math reasoning."}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,t.jsxs)(n.p,{children:["While the ",(0,t.jsx)(n.code,{children:"touying-equation"})," function is convenient, you should always be aware that it doesn't perform complex syntax analysis. It simply splits the string using regular expressions. Therefore, you should not use ",(0,t.jsx)(n.code,{children:"pause"})," or ",(0,t.jsx)(n.code,{children:"meanwhile"})," within functions like ",(0,t.jsx)(n.code,{children:"display(..)"}),"!"]})}),"\n",(0,t.jsx)(n.h2,{id:"complex-animation",children:"Complex Animation"}),"\n",(0,t.jsxs)(n.p,{children:["In fact, we can also use ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," within ",(0,t.jsx)(n.code,{children:"touying-equation"})," with a little trick:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #touying-equation(scope: (uncover: uncover), `\n f(x) &= pause x^2 + 2x + uncover("3-", 1) \\\n &= pause (x + 1)^2 \\\n `)\n])\n'})}),"\n",(0,t.jsxs)(n.p,{children:["We can pass the functions we need into the ",(0,t.jsx)(n.code,{children:"touying-equation"})," through the ",(0,t.jsx)(n.code,{children:"scope"})," parameter, such as ",(0,t.jsx)(n.code,{children:"uncover"})," in this example."]}),"\n",(0,t.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,t.jsxs)(n.p,{children:["The function definition of ",(0,t.jsx)(n.code,{children:"touying-equation"})," is:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let touying-equation(block: true, numbering: none, supplement: auto, scope: (:), body) = { .. }\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Therefore, you can pass parameters like ",(0,t.jsx)(n.code,{children:"block"}),", ",(0,t.jsx)(n.code,{children:"numbering"}),", and ",(0,t.jsx)(n.code,{children:"supplement"})," to ",(0,t.jsx)(n.code,{children:"touying-equation"})," just like using normal math equations."]})]})}function d(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>c,a:()=>a});var t=i(7294);const o={},s=t.createContext(o);function a(e){const n=t.useContext(s);return t.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(o):e.components||o:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/51a4d3bf.3d956087.js b/assets/js/51a4d3bf.3d956087.js new file mode 100644 index 000000000..8e544fbd2 --- /dev/null +++ b/assets/js/51a4d3bf.3d956087.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2289],{4728:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var t=s(5893),i=s(1151);const o={sidebar_position:2},c="Complex Animations",l={id:"dynamic/complex",title:"Complex Animations",description:"Thanks to the syntax provided by Polylux, we can also use only, uncover, and alternatives in Touying.",source:"@site/docs/dynamic/complex.md",sourceDirName:"dynamic",slug:"/dynamic/complex",permalink:"/touying/docs/dynamic/complex",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/complex.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Animations",permalink:"/touying/docs/dynamic/simple"},next:{title:"Math Equation Animations",permalink:"/touying/docs/dynamic/equation"}},a={},d=[{value:"Callback-Style Functions",id:"callback-style-functions",level:2},{value:"only",id:"only",level:2},{value:"uncover",id:"uncover",level:2},{value:"alternatives",id:"alternatives",level:2}];function r(e){const n={a:"a",admonition:"admonition",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)(n.h1,{id:"complex-animations",children:"Complex Animations"}),"\n",(0,t.jsxs)(n.p,{children:["Thanks to the syntax provided by ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/syntax.html",children:"Polylux"}),", we can also use ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," in Touying."]}),"\n",(0,t.jsx)(n.h2,{id:"callback-style-functions",children:"Callback-Style Functions"}),"\n",(0,t.jsxs)(n.p,{children:["To overcome the limitations of ",(0,t.jsx)(n.code,{children:"styled"})," and ",(0,t.jsx)(n.code,{children:"layout"})," mentioned earlier, Touying cleverly implements always-effective ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," using callback functions. Specifically, you need to introduce these three functions as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n In subslide #self.subslide,\n\n test #uncover("2-")[uncover] function,\n\n and test #only("2-")[only] function,\n\n #pause\n\n and paused text.\n])\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/e9a6b8c5-daf0-4cf2-8d39-1a768ce1dfea",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["Notice that we no longer pass a content block but instead pass a callback function with a ",(0,t.jsx)(n.code,{children:"self"})," parameter. Later, we extract ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," functions from ",(0,t.jsx)(n.code,{children:"self"})," using:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let (uncover, only, alternatives) = utils.methods(self)\n"})}),"\n",(0,t.jsx)(n.p,{children:"We then call these functions in subsequent steps."}),"\n",(0,t.jsxs)(n.p,{children:["Here's an interesting fact: the ",(0,t.jsx)(n.code,{children:"self.subslide"})," of type int indicates the current subslide index, and in fact, the ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," functions rely on ",(0,t.jsx)(n.code,{children:"self.subslide"})," to determine the current subslide index."]}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,t.jsxs)(n.p,{children:["We manually specify the ",(0,t.jsx)(n.code,{children:"repeat: 3"})," parameter, indicating the display of 3 subslides. We need to do this manually because Touying cannot infer how many subslides ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," should display."]})}),"\n",(0,t.jsx)(n.h2,{id:"only",children:"only"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"only"})," function means it \"appears\" only on selected subslides. If it doesn't appear, it completely disappears and doesn't occupy any space. In other words, ",(0,t.jsx)(n.code,{children:"#only(index, body)"})," is either ",(0,t.jsx)(n.code,{children:"body"})," or ",(0,t.jsx)(n.code,{children:"none"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The index can be an int type or a str type like ",(0,t.jsx)(n.code,{children:'"2-"'})," or ",(0,t.jsx)(n.code,{children:'"2-3"'}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"uncover",children:"uncover"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"uncover"}),' function means it "displays" only on selected subslides; otherwise, it will be covered by the ',(0,t.jsx)(n.code,{children:"cover"})," function but still occupies the original space. In other words, ",(0,t.jsx)(n.code,{children:"#uncover(index, body)"})," is either ",(0,t.jsx)(n.code,{children:"body"})," or ",(0,t.jsx)(n.code,{children:"cover(body)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The index can be an int type or a str type like ",(0,t.jsx)(n.code,{children:'"2-"'})," or ",(0,t.jsx)(n.code,{children:'"2-3"'}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["You may also have noticed that ",(0,t.jsx)(n.code,{children:"#pause"})," actually uses the ",(0,t.jsx)(n.code,{children:"cover"})," function, providing a more convenient syntax. In reality, their effects are almost identical."]}),"\n",(0,t.jsx)(n.h2,{id:"alternatives",children:"alternatives"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"alternatives"})," function displays a series of different content in different subslides. For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #alternatives[Ann][Bob][Christopher]\n likes\n #alternatives[chocolate][strawberry][vanilla]\n ice cream.\n])\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/392707ea-0bcd-426b-b232-5bc63b9a13a3",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["As you can see, ",(0,t.jsx)(n.code,{children:"alternatives"})," can automatically expand to the most suitable width and height, a capability that ",(0,t.jsx)(n.code,{children:"only"})," and ",(0,t.jsx)(n.code,{children:"uncover"})," lack. In fact, ",(0,t.jsx)(n.code,{children:"alternatives"})," has other parameters, such as ",(0,t.jsx)(n.code,{children:"start: 2"}),", ",(0,t.jsx)(n.code,{children:"repeat-last: true"}),", and ",(0,t.jsx)(n.code,{children:"position: center + horizon"}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/alternatives.html",children:"Polylux"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>c});var t=s(7294);const i={},o=t.createContext(i);function c(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/51a4d3bf.6dcf872f.js b/assets/js/51a4d3bf.6dcf872f.js deleted file mode 100644 index e47b8bdac..000000000 --- a/assets/js/51a4d3bf.6dcf872f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2289],{4728:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var t=s(5893),i=s(1151);const o={sidebar_position:2},l="Complex Animations",c={id:"dynamic/complex",title:"Complex Animations",description:"Thanks to the syntax provided by Polylux, we can also use only, uncover, and alternatives in Touying.",source:"@site/docs/dynamic/complex.md",sourceDirName:"dynamic",slug:"/dynamic/complex",permalink:"/touying/docs/dynamic/complex",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/complex.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Animations",permalink:"/touying/docs/dynamic/simple"},next:{title:"Math Equation Animations",permalink:"/touying/docs/dynamic/equation"}},a={},d=[{value:"Callback-Style Functions",id:"callback-style-functions",level:2},{value:"only",id:"only",level:2},{value:"uncover",id:"uncover",level:2},{value:"alternatives",id:"alternatives",level:2}];function r(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"complex-animations",children:"Complex Animations"}),"\n",(0,t.jsxs)(n.p,{children:["Thanks to the syntax provided by ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/syntax.html",children:"Polylux"}),", we can also use ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," in Touying."]}),"\n",(0,t.jsx)(n.h2,{id:"callback-style-functions",children:"Callback-Style Functions"}),"\n",(0,t.jsxs)(n.p,{children:["To overcome the limitations of ",(0,t.jsx)(n.code,{children:"styled"})," and ",(0,t.jsx)(n.code,{children:"layout"})," mentioned earlier, Touying cleverly implements always-effective ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," using callback functions. Specifically, you need to introduce these three functions as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n In subslide #self.subslide,\n\n test #uncover("2-")[uncover] function,\n\n and test #only("2-")[only] function,\n\n #pause\n\n and paused text.\n])\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Notice that we no longer pass a content block but instead pass a callback function with a ",(0,t.jsx)(n.code,{children:"self"})," parameter. Later, we extract ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," functions from ",(0,t.jsx)(n.code,{children:"self"})," using:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let (uncover, only, alternatives) = utils.methods(self)\n"})}),"\n",(0,t.jsx)(n.p,{children:"We then call these functions in subsequent steps."}),"\n",(0,t.jsxs)(n.p,{children:["Here's an interesting fact: the ",(0,t.jsx)(n.code,{children:"self.subslide"})," of type int indicates the current subslide index, and in fact, the ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," functions rely on ",(0,t.jsx)(n.code,{children:"self.subslide"})," to determine the current subslide index."]}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,t.jsxs)(n.p,{children:["We manually specify the ",(0,t.jsx)(n.code,{children:"repeat: 3"})," parameter, indicating the display of 3 subslides. We need to do this manually because Touying cannot infer how many subslides ",(0,t.jsx)(n.code,{children:"only"}),", ",(0,t.jsx)(n.code,{children:"uncover"}),", and ",(0,t.jsx)(n.code,{children:"alternatives"})," should display."]})}),"\n",(0,t.jsx)(n.h2,{id:"only",children:"only"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"only"})," function means it \"appears\" only on selected subslides. If it doesn't appear, it completely disappears and doesn't occupy any space. In other words, ",(0,t.jsx)(n.code,{children:"#only(index, body)"})," is either ",(0,t.jsx)(n.code,{children:"body"})," or ",(0,t.jsx)(n.code,{children:"none"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The index can be an int type or a str type like ",(0,t.jsx)(n.code,{children:'"2-"'})," or ",(0,t.jsx)(n.code,{children:'"2-3"'}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"uncover",children:"uncover"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"uncover"}),' function means it "displays" only on selected subslides; otherwise, it will be covered by the ',(0,t.jsx)(n.code,{children:"cover"})," function but still occupies the original space. In other words, ",(0,t.jsx)(n.code,{children:"#uncover(index, body)"})," is either ",(0,t.jsx)(n.code,{children:"body"})," or ",(0,t.jsx)(n.code,{children:"cover(body)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The index can be an int type or a str type like ",(0,t.jsx)(n.code,{children:'"2-"'})," or ",(0,t.jsx)(n.code,{children:'"2-3"'}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["You may also have noticed that ",(0,t.jsx)(n.code,{children:"#pause"})," actually uses the ",(0,t.jsx)(n.code,{children:"cover"})," function, providing a more convenient syntax. In reality, their effects are almost identical."]}),"\n",(0,t.jsx)(n.h2,{id:"alternatives",children:"alternatives"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"alternatives"})," function displays a series of different content in different subslides. For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #alternatives[Ann][Bob][Christopher]\n likes\n #alternatives[chocolate][strawberry][vanilla]\n ice cream.\n])\n"})}),"\n",(0,t.jsxs)(n.p,{children:["As you can see, ",(0,t.jsx)(n.code,{children:"alternatives"})," can automatically expand to the most suitable width and height, a capability that ",(0,t.jsx)(n.code,{children:"only"})," and ",(0,t.jsx)(n.code,{children:"uncover"})," lack. In fact, ",(0,t.jsx)(n.code,{children:"alternatives"})," has other parameters, such as ",(0,t.jsx)(n.code,{children:"start: 2"}),", ",(0,t.jsx)(n.code,{children:"repeat-last: true"}),", and ",(0,t.jsx)(n.code,{children:"position: center + horizon"}),". For more usage, refer to ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/alternatives.html",children:"Polylux"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var t=s(7294);const i={},o=t.createContext(i);function l(e){const n=t.useContext(o);return t.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),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5a57e638.79e50363.js b/assets/js/5a57e638.79e50363.js new file mode 100644 index 000000000..aaa7145aa --- /dev/null +++ b/assets/js/5a57e638.79e50363.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",r={id:"themes/simple",title:"Simple Theme",description:"image",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/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/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/themes/metropolis"}},d={},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 is derived 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 simple theme, you can use it to create straightforward slides and easily incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize the Simple theme using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content to be displayed in the footer, with the default being ",(0,i.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, with the default being black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, with the default being ",(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 series 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 on the slide. 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 just 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:"This is the default ordinary slide function with a header and footer. The header is set to the current section, and the footer is as per your settings."}),"\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 (default is ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (default is ",(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.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n\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.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\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#slide[\n == First slide\n\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n#centered-slide(section: [Let\'s start a new section!])\n\n#slide[\n == Dynamic slide\n Did you know that...\n\n #pause\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:()=>r,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 r(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/5a57e638.7f12e2df.js b/assets/js/5a57e638.7f12e2df.js deleted file mode 100644 index 29ce663e2..000000000 --- a/assets/js/5a57e638.7f12e2df.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",r={id:"themes/simple",title:"Simple Theme",description:"This theme is derived from Polylux, created by Andreas Kr\xf6pelin.",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/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/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/themes/metropolis"}},d={},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",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.jsxs)(n.p,{children:["This theme is derived 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 simple theme, you can use it to create straightforward slides and easily incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize the Simple theme using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content to be displayed in the footer, with the default being ",(0,i.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, with the default being black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, with the default being ",(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 series 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 on the slide. 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 just 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:"This is the default ordinary slide function with a header and footer. The header is set to the current section, and the footer is as per your settings."}),"\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 (default is ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (default is ",(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.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n\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.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.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\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#slide[\n == First slide\n\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n#centered-slide(section: [Let\'s start a new section!])\n\n#slide[\n == Dynamic slide\n Did you know that...\n\n #pause\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:()=>r,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 r(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/6b839bb6.28c5ab65.js b/assets/js/6b839bb6.28c5ab65.js deleted file mode 100644 index 954a5e596..000000000 --- a/assets/js/6b839bb6.28c5ab65.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4863],{7310:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>r});var t=n(5893),i=n(1151);const o={sidebar_position:4},l="Code Styles",d={id:"style",title:"Code Styles",description:"show-slides Style",source:"@site/docs/style.md",sourceDirName:".",slug:"/style",permalink:"/touying/docs/style",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/style.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Layout Your Contents",permalink:"/touying/docs/layout"},next:{title:"Dynamic Slides",permalink:"/touying/docs/category/dynamic-slides"}},c={},r=[{value:"show-slides Style",id:"show-slides-style",level:2},{value:"slide-block Style",id:"slide-block-style",level:2}];function a(e){const s={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"code-styles",children:"Code Styles"}),"\n",(0,t.jsx)(s.h2,{id:"show-slides-style",children:"show-slides Style"}),"\n",(0,t.jsxs)(s.p,{children:["If we only need simplicity, we can use ",(0,t.jsx)(s.code,{children:"#show: slides"})," for a cleaner syntax."]}),"\n",(0,t.jsxs)(s.p,{children:["However, this approach has corresponding drawbacks: firstly, this method may significantly impact document rendering performance. Secondly, subsequent ",(0,t.jsx)(s.code,{children:"#slide(..)"})," cannot be added directly. Instead, you need to manually mark ",(0,t.jsx)(s.code,{children:"#slides-end"}),". The most significant drawback is that complex functionalities cannot be achieved."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n\n#slides-end\n\n#slide[\n A new slide.\n]\n'})}),"\n",(0,t.jsx)(s.h2,{id:"slide-block-style",children:"slide-block Style"}),"\n",(0,t.jsx)(s.p,{children:"For better performance and more powerful capabilities, in most cases, we still need to use the code style like:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:"#slide[\n A new slide.\n]\n"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>l});var t=n(7294);const i={},o=t.createContext(i);function l(e){const s=t.useContext(o);return t.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(i):e.components||i:l(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6b839bb6.95abb783.js b/assets/js/6b839bb6.95abb783.js new file mode 100644 index 000000000..5d14b48ee --- /dev/null +++ b/assets/js/6b839bb6.95abb783.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4863],{7310:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>r});var t=n(5893),i=n(1151);const o={sidebar_position:4},l="Code Styles",d={id:"style",title:"Code Styles",description:"show-slides Style",source:"@site/docs/style.md",sourceDirName:".",slug:"/style",permalink:"/touying/docs/style",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/style.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Layout Your Contents",permalink:"/touying/docs/layout"},next:{title:"Dynamic Slides",permalink:"/touying/docs/category/dynamic-slides"}},c={},r=[{value:"show-slides Style",id:"show-slides-style",level:2},{value:"slide-block Style",id:"slide-block-style",level:2}];function a(e){const s={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:"code-styles",children:"Code Styles"}),"\n",(0,t.jsx)(s.h2,{id:"show-slides-style",children:"show-slides Style"}),"\n",(0,t.jsxs)(s.p,{children:["If we only need simplicity, we can use ",(0,t.jsx)(s.code,{children:"#show: slides"})," for a cleaner syntax."]}),"\n",(0,t.jsxs)(s.p,{children:["However, this approach has corresponding drawbacks: firstly, this method may significantly impact document rendering performance. Secondly, subsequent ",(0,t.jsx)(s.code,{children:"#slide(..)"})," cannot be added directly. Instead, you need to manually mark ",(0,t.jsx)(s.code,{children:"#slides-end"}),". The most significant drawback is that complex functionalities cannot be achieved."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n\n#slides-end\n\n#slide[\n A new slide.\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/db2a1b60-bc56-4fa9-a317-ee9ecc6f3895",alt:"image"})}),"\n",(0,t.jsxs)(s.p,{children:["And you can create a new page with the empty header ",(0,t.jsx)(s.code,{children:"=="}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"slide-block-style",children:"slide-block Style"}),"\n",(0,t.jsx)(s.p,{children:"For better performance and more powerful capabilities, in most cases, we still need to use the code style like:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:"#slide[\n A new slide.\n]\n"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>l});var t=n(7294);const i={},o=t.createContext(i);function l(e){const s=t.useContext(o);return t.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(i):e.components||i:l(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/80a0c88e.0b40e1f2.js b/assets/js/80a0c88e.0b40e1f2.js deleted file mode 100644 index beb13d5c5..000000000 --- a/assets/js/80a0c88e.0b40e1f2.js +++ /dev/null @@ -1 +0,0 @@ -"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:"This theme is inspired by the Metropolis beamer theme created by Matthias Vogelgesang and transformed by Enivex.",source:"@site/docs/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/docs/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/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/themes/dewdrop"}},d={},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",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.jsxs)(n.p,{children:["This theme is inspired by the ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme created by Matthias Vogelgesang and transformed 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 daily use. For the best results, it is recommended to install the Fira Sans and Fira Math fonts on your computer."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize the Metropolis theme using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content to be displayed in the header, with the default being ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),". You can also pass 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 to be displayed in the footer, with the default being ",(0,s.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being ",(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 that you can use with the ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\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 the 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:"Metropolis theme provides a series 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:["The ",(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display. You can also pass 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 margin: (top: 3em, bottom: 1em, left: 0em, right: 0em),\n padding: 2em,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["This is the default ordinary slide function with a title and footer according to your settings. The ",(0,s.jsx)(n.code,{children:"title"})," is set to the current section title by default, and the footer is as per your settings."]}),"\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. The background color is ",(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:"Opens 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:"outline-title"}),": Default is ",(0,s.jsx)(n.code,{children:"[Table of contents]"}),"."]}),"\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.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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.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.2.0": *\n\n#let s = themes.metropolis.register(s, 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, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide(extra: [Extra])\n\n#slide(title: [Table of contents])[\n #touying-outline()\n]\n\n#slide(title: [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 A slide with some maths:\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n#new-section-slide[First section]\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n#new-section-slide[Second section]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\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, new-section-slide) = utils.methods(s)\n\n#new-section-slide[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/80a0c88e.b2547112.js b/assets/js/80a0c88e.b2547112.js new file mode 100644 index 000000000..97caa7850 --- /dev/null +++ b/assets/js/80a0c88e.b2547112.js @@ -0,0 +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/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/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/themes/dewdrop"}},d={},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,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/a1b34b11-6797-42fd-b50f-477a0d672ba2",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is inspired by the ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme created by Matthias Vogelgesang and transformed 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 daily use. For the best results, it is recommended to install the Fira Sans and Fira Math fonts on your computer."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize the Metropolis theme using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content to be displayed in the header, with the default being ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),". You can also pass 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 to be displayed in the footer, with the default being ",(0,s.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being ",(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 that you can use with the ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\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 the 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:"Metropolis theme provides a series 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:["The ",(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display. You can also pass 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 margin: (top: 3em, bottom: 1em, left: 0em, right: 0em),\n padding: 2em,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["This is the default ordinary slide function with a title and footer according to your settings. The ",(0,s.jsx)(n.code,{children:"title"})," is set to the current section title by default, and the footer is as per your settings."]}),"\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. The background color is ",(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:"Opens 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:"outline-title"}),": Default is ",(0,s.jsx)(n.code,{children:"[Table of contents]"}),"."]}),"\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.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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.2.0": *\n\n#let s = themes.metropolis.register(s, 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, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide(extra: [Extra])\n\n#slide(title: [Table of contents])[\n #touying-outline()\n]\n\n#slide(title: [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 A slide with some maths:\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n#new-section-slide[First section]\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n#new-section-slide[Second section]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\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, new-section-slide) = utils.methods(s)\n\n#new-section-slide[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/935f2afb.23d8684b.js b/assets/js/935f2afb.fd7ce045.js similarity index 88% rename from assets/js/935f2afb.23d8684b.js rename to assets/js/935f2afb.fd7ce045.js index 2a9f81018..2327953de 100644 --- a/assets/js/935f2afb.23d8684b.js +++ b/assets/js/935f2afb.fd7ce045.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Introduction to Touying","href":"/touying/docs/intro","docId":"intro","unlisted":false},{"type":"link","label":"Getting Started","href":"/touying/docs/start","docId":"start","unlisted":false},{"type":"link","label":"Layout Your Contents","href":"/touying/docs/layout","docId":"layout","unlisted":false},{"type":"link","label":"Code Styles","href":"/touying/docs/style","docId":"style","unlisted":false},{"type":"category","label":"Dynamic Slides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple Animations","href":"/touying/docs/dynamic/simple","docId":"dynamic/simple","unlisted":false},{"type":"link","label":"Complex Animations","href":"/touying/docs/dynamic/complex","docId":"dynamic/complex","unlisted":false},{"type":"link","label":"Math Equation Animations","href":"/touying/docs/dynamic/equation","docId":"dynamic/equation","unlisted":false},{"type":"link","label":"Cover Function","href":"/touying/docs/dynamic/cover","docId":"dynamic/cover","unlisted":false},{"type":"link","label":"Handout Mode","href":"/touying/docs/dynamic/handout","docId":"dynamic/handout","unlisted":false}],"href":"/touying/docs/category/dynamic-slides"},{"type":"category","label":"Themes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple Theme","href":"/touying/docs/themes/simple","docId":"themes/simple","unlisted":false},{"type":"link","label":"Metropolis Theme","href":"/touying/docs/themes/metropolis","docId":"themes/metropolis","unlisted":false},{"type":"link","label":"Dewdrop Theme","href":"/touying/docs/themes/dewdrop","docId":"themes/dewdrop","unlisted":false}],"href":"/touying/docs/category/themes"},{"type":"link","label":"Build Your Own Theme","href":"/touying/docs/build-your-own-theme","docId":"build-your-own-theme","unlisted":false},{"type":"category","label":"Progress","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Touying Counters","href":"/touying/docs/progress/counters","docId":"progress/counters","unlisted":false},{"type":"link","label":"Touying Sections","href":"/touying/docs/progress/sections","docId":"progress/sections","unlisted":false}],"href":"/touying/docs/category/progress"},{"type":"category","label":"Utilities","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Object-Oriented Programming","href":"/touying/docs/utilities/oop","docId":"utilities/oop","unlisted":false},{"type":"link","label":"Fit to Height / Width","href":"/touying/docs/utilities/fit-to","docId":"utilities/fit-to","unlisted":false}],"href":"/touying/docs/category/utilities"},{"type":"category","label":"External Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Pdfpc","href":"/touying/docs/external/pdfpc","docId":"external/pdfpc","unlisted":false},{"type":"link","label":"Typst Preview","href":"/touying/docs/external/typst-preview","docId":"external/typst-preview","unlisted":false}],"href":"/touying/docs/category/external-tools"},{"type":"link","label":"Changelog","href":"/touying/docs/changelog","docId":"changelog","unlisted":false}]},"docs":{"build-your-own-theme":{"id":"build-your-own-theme","title":"Build Your Own Theme","description":"You can refer to the source code of themes. The main things to implement are:","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"Changelog","description":"v0.2.0","sidebar":"tutorialSidebar"},"dynamic/complex":{"id":"dynamic/complex","title":"Complex Animations","description":"Thanks to the syntax provided by Polylux, we can also use only, uncover, and alternatives in Touying.","sidebar":"tutorialSidebar"},"dynamic/cover":{"id":"dynamic/cover","title":"Cover Function","description":"As you already know, both uncover and #pause use the cover function to conceal content that is not visible. So, what exactly is the cover function here?","sidebar":"tutorialSidebar"},"dynamic/equation":{"id":"dynamic/equation","title":"Math Equation Animations","description":"Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use pause and meanwhile within math equations.","sidebar":"tutorialSidebar"},"dynamic/handout":{"id":"dynamic/handout","title":"Handout Mode","description":"While watching slides and attending lectures, the audience often wishes to have handouts for reviewing challenging concepts. Therefore, it\'s beneficial for the author to provide handouts for the audience, preferably before the lecture for better preparation.","sidebar":"tutorialSidebar"},"dynamic/simple":{"id":"dynamic/simple","title":"Simple Animations","description":"Touying provides two markers for simple animation effects: #pause and #meanwhile.","sidebar":"tutorialSidebar"},"external/pdfpc":{"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.","sidebar":"tutorialSidebar"},"external/typst-preview":{"id":"external/typst-preview","title":"Typst Preview","description":"The Typst Preview extension for VS Code provides an excellent slide mode, allowing us to preview and present slides.","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Introduction to Touying","description":"Touying is a slide/presentation package developed for Typst, based on Polylux. Touying is similar to LaTeX Beamer but benefits from Typst, providing faster rendering speed and a more concise syntax. Hereafter, we use \\"slides\\" to refer to slideshows, \\"slide\\" for a single slide, and \\"subslide\\" for a sub-slide.","sidebar":"tutorialSidebar"},"layout":{"id":"layout","title":"Layout Your Contents","description":"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes.","sidebar":"tutorialSidebar"},"progress/counters":{"id":"progress/counters","title":"Touying Counters","description":"The states of Touying are placed under the states namespace, including all counters.","sidebar":"tutorialSidebar"},"progress/sections":{"id":"progress/sections","title":"Touying Sections","description":"Touying maintains its own sections state to record the sections and subsections of slides.","sidebar":"tutorialSidebar"},"start":{"id":"start","title":"Getting Started","description":"Before you begin, make sure you have installed the Typst environment. If not, you can use the Web App or the Typst LSP and Typst Preview plugins for VS Code.","sidebar":"tutorialSidebar"},"style":{"id":"style","title":"Code Styles","description":"show-slides Style","sidebar":"tutorialSidebar"},"themes/dewdrop":{"id":"themes/dewdrop","title":"Dewdrop Theme","description":"This theme is inspired by BeamerTheme created by Zhibo Wang and transformed by OrangeX4.","sidebar":"tutorialSidebar"},"themes/metropolis":{"id":"themes/metropolis","title":"Metropolis Theme","description":"This theme is inspired by the Metropolis beamer theme created by Matthias Vogelgesang and transformed by Enivex.","sidebar":"tutorialSidebar"},"themes/simple":{"id":"themes/simple","title":"Simple Theme","description":"This theme is derived from Polylux, created by Andreas Kr\xf6pelin.","sidebar":"tutorialSidebar"},"utilities/fit-to":{"id":"utilities/fit-to","title":"Fit to Height / Width","description":"Thanks to ntjess for the code.","sidebar":"tutorialSidebar"},"utilities/oop":{"id":"utilities/oop","title":"Object-Oriented Programming","description":"Touying provides some convenient utility functions for object-oriented programming.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Introduction to Touying","href":"/touying/docs/intro","docId":"intro","unlisted":false},{"type":"link","label":"Getting Started","href":"/touying/docs/start","docId":"start","unlisted":false},{"type":"link","label":"Layout Your Contents","href":"/touying/docs/layout","docId":"layout","unlisted":false},{"type":"link","label":"Code Styles","href":"/touying/docs/style","docId":"style","unlisted":false},{"type":"category","label":"Dynamic Slides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple Animations","href":"/touying/docs/dynamic/simple","docId":"dynamic/simple","unlisted":false},{"type":"link","label":"Complex Animations","href":"/touying/docs/dynamic/complex","docId":"dynamic/complex","unlisted":false},{"type":"link","label":"Math Equation Animations","href":"/touying/docs/dynamic/equation","docId":"dynamic/equation","unlisted":false},{"type":"link","label":"Cover Function","href":"/touying/docs/dynamic/cover","docId":"dynamic/cover","unlisted":false},{"type":"link","label":"Handout Mode","href":"/touying/docs/dynamic/handout","docId":"dynamic/handout","unlisted":false}],"href":"/touying/docs/category/dynamic-slides"},{"type":"category","label":"Themes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple Theme","href":"/touying/docs/themes/simple","docId":"themes/simple","unlisted":false},{"type":"link","label":"Metropolis Theme","href":"/touying/docs/themes/metropolis","docId":"themes/metropolis","unlisted":false},{"type":"link","label":"Dewdrop Theme","href":"/touying/docs/themes/dewdrop","docId":"themes/dewdrop","unlisted":false}],"href":"/touying/docs/category/themes"},{"type":"link","label":"Build Your Own Theme","href":"/touying/docs/build-your-own-theme","docId":"build-your-own-theme","unlisted":false},{"type":"category","label":"Progress","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Touying Counters","href":"/touying/docs/progress/counters","docId":"progress/counters","unlisted":false},{"type":"link","label":"Touying Sections","href":"/touying/docs/progress/sections","docId":"progress/sections","unlisted":false}],"href":"/touying/docs/category/progress"},{"type":"category","label":"Utilities","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Object-Oriented Programming","href":"/touying/docs/utilities/oop","docId":"utilities/oop","unlisted":false},{"type":"link","label":"Fit to Height / Width","href":"/touying/docs/utilities/fit-to","docId":"utilities/fit-to","unlisted":false}],"href":"/touying/docs/category/utilities"},{"type":"category","label":"External Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Pdfpc","href":"/touying/docs/external/pdfpc","docId":"external/pdfpc","unlisted":false},{"type":"link","label":"Typst Preview","href":"/touying/docs/external/typst-preview","docId":"external/typst-preview","unlisted":false}],"href":"/touying/docs/category/external-tools"},{"type":"link","label":"Changelog","href":"/touying/docs/changelog","docId":"changelog","unlisted":false}]},"docs":{"build-your-own-theme":{"id":"build-your-own-theme","title":"Build Your Own Theme","description":"You can refer to the source code of themes. The main things to implement are:","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"Changelog","description":"v0.2.0","sidebar":"tutorialSidebar"},"dynamic/complex":{"id":"dynamic/complex","title":"Complex Animations","description":"Thanks to the syntax provided by Polylux, we can also use only, uncover, and alternatives in Touying.","sidebar":"tutorialSidebar"},"dynamic/cover":{"id":"dynamic/cover","title":"Cover Function","description":"As you already know, both uncover and #pause use the cover function to conceal content that is not visible. So, what exactly is the cover function here?","sidebar":"tutorialSidebar"},"dynamic/equation":{"id":"dynamic/equation","title":"Math Equation Animations","description":"Touying also provides a unique and highly useful feature\u2014math equation animations, allowing you to conveniently use pause and meanwhile within math equations.","sidebar":"tutorialSidebar"},"dynamic/handout":{"id":"dynamic/handout","title":"Handout Mode","description":"While watching slides and attending lectures, the audience often wishes to have handouts for reviewing challenging concepts. Therefore, it\'s beneficial for the author to provide handouts for the audience, preferably before the lecture for better preparation.","sidebar":"tutorialSidebar"},"dynamic/simple":{"id":"dynamic/simple","title":"Simple Animations","description":"Touying provides two markers for simple animation effects: #pause and #meanwhile.","sidebar":"tutorialSidebar"},"external/pdfpc":{"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.","sidebar":"tutorialSidebar"},"external/typst-preview":{"id":"external/typst-preview","title":"Typst Preview","description":"The Typst Preview extension for VS Code provides an excellent slide mode, allowing us to preview and present slides.","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Introduction to Touying","description":"Touying is a slide/presentation package developed for Typst, based on Polylux. Touying is similar to LaTeX Beamer but benefits from Typst, providing faster rendering speed and a more concise syntax. Hereafter, we use \\"slides\\" to refer to slideshows, \\"slide\\" for a single slide, and \\"subslide\\" for a sub-slide.","sidebar":"tutorialSidebar"},"layout":{"id":"layout","title":"Layout Your Contents","description":"To better manage every detail in the slides and achieve better rendering results, like Beamer, Touying has introduced some unique concepts. This helps you maintain global information better and easily switch between different themes.","sidebar":"tutorialSidebar"},"progress/counters":{"id":"progress/counters","title":"Touying Counters","description":"The states of Touying are placed under the states namespace, including all counters.","sidebar":"tutorialSidebar"},"progress/sections":{"id":"progress/sections","title":"Touying Sections","description":"Touying maintains its own sections state to record the sections and subsections of slides.","sidebar":"tutorialSidebar"},"start":{"id":"start","title":"Getting Started","description":"Before you begin, make sure you have installed the Typst environment. If not, you can use the Web App or the Typst LSP and Typst Preview plugins for VS Code.","sidebar":"tutorialSidebar"},"style":{"id":"style","title":"Code Styles","description":"show-slides Style","sidebar":"tutorialSidebar"},"themes/dewdrop":{"id":"themes/dewdrop","title":"Dewdrop Theme","description":"image","sidebar":"tutorialSidebar"},"themes/metropolis":{"id":"themes/metropolis","title":"Metropolis Theme","description":"image","sidebar":"tutorialSidebar"},"themes/simple":{"id":"themes/simple","title":"Simple Theme","description":"image","sidebar":"tutorialSidebar"},"utilities/fit-to":{"id":"utilities/fit-to","title":"Fit to Height / Width","description":"Thanks to ntjess for the code.","sidebar":"tutorialSidebar"},"utilities/oop":{"id":"utilities/oop","title":"Object-Oriented Programming","description":"Touying provides some convenient utility functions for object-oriented programming.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/98ce8162.89b1c59e.js b/assets/js/98ce8162.89b1c59e.js new file mode 100644 index 000000000..5ca450b27 --- /dev/null +++ b/assets/js/98ce8162.89b1c59e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>o,metadata:()=>r,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="Getting Started",r={id:"start",title:"Getting Started",description:"Before you begin, make sure you have installed the Typst environment. If not, you can use the Web App or the Typst LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/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/intro"},next:{title:"Layout Your Contents",permalink:"/touying/docs/layout"}},a={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function u(e){const n={a:"a",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:"getting-started",children:"Getting Started"}),"\n",(0,s.jsxs)(n.p,{children:["Before you begin, make sure you have installed the Typst environment. If not, you can use the ",(0,s.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or the Typst LSP and Typst Preview plugins for VS Code."]}),"\n",(0,s.jsx)(n.p,{children:"To use Touying, you only need to include the following code in your document:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\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/6f15b500-b825-4db1-88ff-34212f43723e",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"It's simple. Congratulations on creating your first Touying slide! \ud83c\udf89"}),"\n",(0,s.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,s.jsxs)(n.p,{children:["In fact, Touying provides various styles for writing slides. For example, the above example uses first-level and second-level titles to create new slides. However, you can also use the ",(0,s.jsx)(n.code,{children:"#slide[..]"})," format to access more powerful features provided by Touying."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide) = utils.methods(s)\n#show: init\n\n// simple animations\n#slide[\n a simple #pause *dynamic*\n\n #pause\n \n slide.\n\n #meanwhile\n\n meanwhile #pause with pause.\n][\n second #pause pause.\n]\n\n// complex animations\n#slide(setting: body => {\n set text(fill: blue)\n body\n}, repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n in subslide #self.subslide\n\n test #uncover("2-")[uncover] function\n\n test #only("2-")[only] function\n\n #pause\n\n and paused text.\n])\n\n// math equation animations\n#slide[\n == Touying Equation\n\n #touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n `)\n\n #meanwhile\n\n Touying equation is very simple.\n]\n\n// multiple pages for one slide\n#slide[\n == Multiple Pages for One Slide\n\n #lorem(200)\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide,) = utils.methods(s)\n\n#slide[\n == Appendix\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/192b13f9-e3fb-4327-864b-fd9084a8ca24",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"In addition, Touying provides many built-in themes to easily create beautiful slides. Basically, you just need to add a line at the top of your document:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'#let s = themes.metropolis.register(s, aspect-ratio: "16-9")\n'})}),"\n",(0,s.jsx)(n.p,{children:"This will allow you to use the Metropolis theme. For more detailed tutorials, you can refer to the following chapters."})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(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/98ce8162.b2fca771.js b/assets/js/98ce8162.b2fca771.js deleted file mode 100644 index 8ce40c7e1..000000000 --- a/assets/js/98ce8162.b2fca771.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>d});var s=t(5893),o=t(1151);const i={sidebar_position:2},l="Getting Started",r={id:"start",title:"Getting Started",description:"Before you begin, make sure you have installed the Typst environment. If not, you can use the Web App or the Typst LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/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/intro"},next:{title:"Layout Your Contents",permalink:"/touying/docs/layout"}},a={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,s.jsxs)(n.p,{children:["Before you begin, make sure you have installed the Typst environment. If not, you can use the ",(0,s.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or the Typst LSP and Typst Preview plugins for VS Code."]}),"\n",(0,s.jsx)(n.p,{children:"To use Touying, you only need to include the following code in your document:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\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:"It's simple. Congratulations on creating your first Touying slide! \ud83c\udf89"}),"\n",(0,s.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,s.jsxs)(n.p,{children:["In fact, Touying provides various styles for writing slides. For example, the above example uses first-level and second-level titles to create new slides. However, you can also use the ",(0,s.jsx)(n.code,{children:"#slide[..]"})," format to access more powerful features provided by Touying."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide) = utils.methods(s)\n#show: init\n\n// simple animations\n#slide[\n a simple #pause *dynamic*\n\n #pause\n \n slide.\n\n #meanwhile\n\n meanwhile #pause with pause.\n][\n second #pause pause.\n]\n\n// complex animations\n#slide(setting: body => {\n set text(fill: blue)\n body\n}, repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n in subslide #self.subslide\n\n test #uncover("2-")[uncover] function\n\n test #only("2-")[only] function\n\n #pause\n\n and paused text.\n])\n\n// math equation animations\n#slide[\n == Touying Equation\n\n #touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n `)\n\n #meanwhile\n\n Touying equation is very simple.\n]\n\n// multiple pages for one slide\n#slide[\n == Multiple Pages for One Slide\n\n #lorem(200)\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide,) = utils.methods(s)\n\n#slide[\n == Appendix\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:"In addition, Touying provides many built-in themes to easily create beautiful slides. Basically, you just need to add a line at the top of your document:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'#let s = themes.metropolis.register(s, aspect-ratio: "16-9")\n'})}),"\n",(0,s.jsx)(n.p,{children:"This will allow you to use the Metropolis theme. For more detailed tutorials, you can refer to the following chapters."})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>l});var s=t(7294);const o={},i=s.createContext(o);function l(e){const n=s.useContext(i);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(o):e.components||o:l(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d16cbc15.8094c876.js b/assets/js/d16cbc15.8094c876.js deleted file mode 100644 index ca4442276..000000000 --- a/assets/js/d16cbc15.8094c876.js +++ /dev/null @@ -1 +0,0 @@ -"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:()=>a});var s=i(5893),t=i(1151);const l={sidebar_position:3},o="Dewdrop Theme",d={id:"themes/dewdrop",title:"Dewdrop Theme",description:"This theme is inspired by BeamerTheme created by Zhibo Wang and transformed by OrangeX4.",source:"@site/docs/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/docs/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/themes/metropolis"},next:{title:"Build Your Own Theme",permalink:"/touying/docs/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:"Special Functions",id:"special-functions",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",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.jsxs)(n.p,{children:["This theme is inspired by ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," created by Zhibo Wang and transformed 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 elegant and aesthetic navigation, including ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"})," modes."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize the Dewdrop theme using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),': Style of the navigation bar, which can be "sidebar," "mini-slides," or ',(0,s.jsx)(n.code,{children:"none"}),', with the default being "sidebar."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Settings for the sidebar navigation, with the default being ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Settings for mini-slides, with the default being ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content to be displayed in the footer, with the default being ",(0,s.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, with the default being ",(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 that you can use with the ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\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 the 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:"Dewdrop theme provides a series 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:["The ",(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display. You can also pass 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:"This is the default ordinary slide function with a navigation bar and footer according to your settings."}),"\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. The background color is ",(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 outline. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections that are inactive."]}),"\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 for displaying 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 for displaying 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 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:"outline-title"}),": Default is ",(0,s.jsx)(n.code,{children:"[Outline]"}),"."]}),"\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.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-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.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.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n// #let s = (s.methods.appendix-in-outline)(self: s, false)\n#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide()\n\n#slide[\n == Outline\n \n #touying-outline(cover: false)\n]\n\n#slide(section: [Section A])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection A.1])[\n == Title\n\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n#slide(subsection: [Subsection A.2])[\n == Important\n\n A slide without a title but with *important* infos\n]\n\n#slide(section: [Section B])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection B.1])[\n == Another Subsection\n\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\n#slide(subsection: [Subsection B.2])[\n == Dynamic\n\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,) = utils.methods(s)\n\n#slide(section: [Appendix])[\n == Outline\n \n #touying-outline()\n]\n\n#slide[\n appendix\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/d16cbc15.fd212767.js b/assets/js/d16cbc15.fd212767.js new file mode 100644 index 000000000..2a5c08c5a --- /dev/null +++ b/assets/js/d16cbc15.fd212767.js @@ -0,0 +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:()=>a});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/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/themes/metropolis"},next:{title:"Build Your Own Theme",permalink:"/touying/docs/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:"Special Functions",id:"special-functions",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:"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/23a8a9be-1f7c-43f7-88d4-40604dd6b01b",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is inspired by ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," created by Zhibo Wang and transformed 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 elegant and aesthetic navigation, including ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"})," modes."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize the Dewdrop theme using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes parameters such as:"]}),"\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," with the default being "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),': Style of the navigation bar, which can be "sidebar," "mini-slides," or ',(0,s.jsx)(n.code,{children:"none"}),', with the default being "sidebar."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Settings for the sidebar navigation, with the default being ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Settings for mini-slides, with the default being ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content to be displayed in the footer, with the default being ",(0,s.jsx)(n.code,{children:"[]"}),". You can also pass 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 to be displayed on the right side of the footer, with the default being ",(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, with the default being ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, with the default being ",(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 that you can use with the ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\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 the 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:"Dewdrop theme provides a series 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:["The ",(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display. You can also pass 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:"This is the default ordinary slide function with a navigation bar and footer according to your settings."}),"\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. The background color is ",(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 outline. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections that are inactive."]}),"\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 for displaying 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 for displaying 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 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:"outline-title"}),": Default is ",(0,s.jsx)(n.code,{children:"[Outline]"}),"."]}),"\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.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-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/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.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n// #let s = (s.methods.appendix-in-outline)(self: s, false)\n#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide()\n\n#slide[\n == Outline\n \n #touying-outline(cover: false)\n]\n\n#slide(section: [Section A])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection A.1])[\n == Title\n\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n#slide(subsection: [Subsection A.2])[\n == Important\n\n A slide without a title but with *important* infos\n]\n\n#slide(section: [Section B])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection B.1])[\n == Another Subsection\n\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\n#slide(subsection: [Subsection B.2])[\n == Dynamic\n\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,) = utils.methods(s)\n\n#slide(section: [Appendix])[\n == Outline\n \n #touying-outline()\n]\n\n#slide[\n appendix\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/runtime~main.63ef563a.js b/assets/js/runtime~main.a5613f9e.js similarity index 59% rename from assets/js/runtime~main.63ef563a.js rename to assets/js/runtime~main.a5613f9e.js index 6a967305d..60d6935aa 100644 --- a/assets/js/runtime~main.63ef563a.js +++ b/assets/js/runtime~main.a5613f9e.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,t,c,r,f={},b={};function d(e){var a=b[e];if(void 0!==a)return a.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return f[e].call(t.exports,t,t.exports,d),t.loaded=!0,t.exports}d.m=f,d.c=b,e=[],d.O=(a,t,c,r)=>{if(!t){var f=1/0;for(i=0;i=r)&&Object.keys(d.O).every((e=>d.O[e](t[o])))?t.splice(o--,1):(b=!1,r0&&e[i-1][2]>r;i--)e[i]=e[i-1];e[i]=[t,c,r]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var r=Object.create(null);d.r(r);var f={};a=a||[null,t({}),t([]),t(t)];for(var b=2&c&&e;"object"==typeof b&&!~a.indexOf(b);b=t(b))Object.getOwnPropertyNames(b).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,d.d(r,f),r},d.d=(e,a)=>{for(var t in a)d.o(a,t)&&!d.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((a,t)=>(d.f[t](e,a),a)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",80:"2c0b54ac",997:"5670b452",1543:"98ce8162",1581:"f8777534",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2289:"51a4d3bf",2403:"d16cbc15",2535:"814f3328",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3209:"80a0c88e",3280:"4bb9edb3",3608:"9e4087bc",3969:"5b27bc59",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4599:"a94a4682",4725:"06e0043a",4842:"0c7d33f3",4863:"6b839bb6",4873:"83b73936",5022:"3b36ca8e",5332:"8ded3f77",5609:"5035b6a4",5617:"54ea3d6a",5695:"6d7ce909",6085:"3d438ec7",6103:"ccc49370",6118:"c9566e8a",6526:"41a6ae87",7414:"393be207",7918:"17896441",8338:"f5938888",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",9139:"09ecdeab",9183:"2d4a7f47",9527:"8ac96054",9661:"5e95c892",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9817:"14eb3368"}[e]||e)+"."+{53:"23d8684b",80:"86a3428b",997:"7985430f",1404:"2f578d87",1543:"b2fca771",1581:"85fe0a10",1772:"22d645a1",2026:"bc35b904",2143:"7f12e2df",2172:"c1636df2",2191:"1cd1772e",2289:"6dcf872f",2403:"8094c876",2535:"a329f4f2",3034:"90d4a404",3085:"fa8680eb",3089:"d410008f",3209:"0b40e1f2",3280:"eb5b5656",3608:"8eec8b12",3969:"e9658089",4013:"354f3ef2",4195:"52703ab9",4368:"9ecc2e7c",4599:"f4cd98e8",4725:"c7037dab",4842:"48f611b9",4863:"28c5ab65",4873:"b2207eb7",5022:"c1ec8f85",5332:"39e635f8",5609:"ba29a9c9",5617:"f96dd531",5695:"f02bfc93",6085:"664d2788",6103:"d9da7455",6118:"82328414",6526:"2629620e",7414:"dbd0b852",7918:"15723699",8338:"8dd127cf",8518:"f93b23a7",8565:"7efc0f2c",8610:"686aaf2c",9139:"15c13872",9183:"359d3d24",9527:"cf3179a7",9661:"17c48d1d",9671:"44a27d42",9677:"ea822b9e",9705:"c8033c26",9744:"00ff6043",9817:"21d38987"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},r="docs:",d.l=(e,a,t,f)=>{if(c[e])c[e].push(a);else{var b,o;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{b.onerror=b.onload=null,clearTimeout(s);var r=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),r&&r.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=l.bind(null,b.onerror),b.onload=l.bind(null,b.onload),o&&document.head.appendChild(b)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/touying/",d.gca=function(e){return e={17896441:"7918","935f2afb":"53","2c0b54ac":"80","5670b452":"997","98ce8162":"1543",f8777534:"1581","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191","51a4d3bf":"2289",d16cbc15:"2403","814f3328":"2535","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","80a0c88e":"3209","4bb9edb3":"3280","9e4087bc":"3608","5b27bc59":"3969","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368",a94a4682:"4599","06e0043a":"4725","0c7d33f3":"4842","6b839bb6":"4863","83b73936":"4873","3b36ca8e":"5022","8ded3f77":"5332","5035b6a4":"5609","54ea3d6a":"5617","6d7ce909":"5695","3d438ec7":"6085",ccc49370:"6103",c9566e8a:"6118","41a6ae87":"6526","393be207":"7414",f5938888:"8338",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","09ecdeab":"9139","2d4a7f47":"9183","8ac96054":"9527","5e95c892":"9661","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744","14eb3368":"9817"}[e]||e,d.p+d.u(e)},(()=>{var e={1303:0,532:0};d.f.j=(a,t)=>{var c=d.o(e,a)?e[a]:void 0;if(0!==c)if(c)t.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var r=new Promise(((t,r)=>c=e[a]=[t,r]));t.push(c[2]=r);var f=d.p+d.u(a),b=new Error;d.l(f,(t=>{if(d.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var r=t&&("load"===t.type?"missing":t.type),f=t&&t.target&&t.target.src;b.message="Loading chunk "+a+" failed.\n("+r+": "+f+")",b.name="ChunkLoadError",b.type=r,b.request=f,c[1](b)}}),"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,t)=>{var c,r,f=t[0],b=t[1],o=t[2],n=0;if(f.some((a=>0!==e[a]))){for(c in b)d.o(b,c)&&(d.m[c]=b[c]);if(o)var i=o(d)}for(a&&a(t);n{"use strict";var e,a,t,r,c,f={},b={};function d(e){var a=b[e];if(void 0!==a)return a.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return f[e].call(t.exports,t,t.exports,d),t.loaded=!0,t.exports}d.m=f,d.c=b,e=[],d.O=(a,t,r,c)=>{if(!t){var f=1/0;for(i=0;i=c)&&Object.keys(d.O).every((e=>d.O[e](t[o])))?t.splice(o--,1):(b=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);d.r(c);var f={};a=a||[null,t({}),t([]),t(t)];for(var b=2&r&&e;"object"==typeof b&&!~a.indexOf(b);b=t(b))Object.getOwnPropertyNames(b).forEach((a=>f[a]=()=>e[a]));return f.default=()=>e,d.d(c,f),c},d.d=(e,a)=>{for(var t in a)d.o(a,t)&&!d.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((a,t)=>(d.f[t](e,a),a)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",80:"2c0b54ac",997:"5670b452",1543:"98ce8162",1581:"f8777534",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2289:"51a4d3bf",2403:"d16cbc15",2535:"814f3328",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3209:"80a0c88e",3280:"4bb9edb3",3608:"9e4087bc",3969:"5b27bc59",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4599:"a94a4682",4725:"06e0043a",4842:"0c7d33f3",4863:"6b839bb6",4873:"83b73936",5022:"3b36ca8e",5332:"8ded3f77",5609:"5035b6a4",5617:"54ea3d6a",5695:"6d7ce909",6085:"3d438ec7",6103:"ccc49370",6118:"c9566e8a",6526:"41a6ae87",7414:"393be207",7918:"17896441",8338:"f5938888",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",9139:"09ecdeab",9183:"2d4a7f47",9527:"8ac96054",9661:"5e95c892",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9817:"14eb3368"}[e]||e)+"."+{53:"fd7ce045",80:"12d8c55e",997:"7985430f",1404:"2f578d87",1543:"89b1c59e",1581:"85fe0a10",1772:"22d645a1",2026:"bc35b904",2143:"79e50363",2172:"c1636df2",2191:"1cd1772e",2289:"3d956087",2403:"fd212767",2535:"a329f4f2",3034:"90d4a404",3085:"fa8680eb",3089:"d410008f",3209:"b2547112",3280:"c485fc1b",3608:"8eec8b12",3969:"e9658089",4013:"354f3ef2",4195:"52703ab9",4368:"9ecc2e7c",4599:"f4cd98e8",4725:"c7037dab",4842:"48f611b9",4863:"95abb783",4873:"b2207eb7",5022:"c1ec8f85",5332:"39e635f8",5609:"ba29a9c9",5617:"f96dd531",5695:"f02bfc93",6085:"664d2788",6103:"d9da7455",6118:"82328414",6526:"2629620e",7414:"dbd0b852",7918:"15723699",8338:"8dd127cf",8518:"f93b23a7",8565:"3567e29a",8610:"686aaf2c",9139:"15c13872",9183:"359d3d24",9527:"cf3179a7",9661:"17c48d1d",9671:"44a27d42",9677:"ea822b9e",9705:"8a088474",9744:"00ff6043",9817:"21d38987"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",d.l=(e,a,t,f)=>{if(r[e])r[e].push(a);else{var b,o;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{b.onerror=b.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],b.parentNode&&b.parentNode.removeChild(b),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=l.bind(null,b.onerror),b.onload=l.bind(null,b.onload),o&&document.head.appendChild(b)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/touying/",d.gca=function(e){return e={17896441:"7918","935f2afb":"53","2c0b54ac":"80","5670b452":"997","98ce8162":"1543",f8777534:"1581","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191","51a4d3bf":"2289",d16cbc15:"2403","814f3328":"2535","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","80a0c88e":"3209","4bb9edb3":"3280","9e4087bc":"3608","5b27bc59":"3969","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368",a94a4682:"4599","06e0043a":"4725","0c7d33f3":"4842","6b839bb6":"4863","83b73936":"4873","3b36ca8e":"5022","8ded3f77":"5332","5035b6a4":"5609","54ea3d6a":"5617","6d7ce909":"5695","3d438ec7":"6085",ccc49370:"6103",c9566e8a:"6118","41a6ae87":"6526","393be207":"7414",f5938888:"8338",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","09ecdeab":"9139","2d4a7f47":"9183","8ac96054":"9527","5e95c892":"9661","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744","14eb3368":"9817"}[e]||e,d.p+d.u(e)},(()=>{var e={1303:0,532:0};d.f.j=(a,t)=>{var r=d.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var f=d.p+d.u(a),b=new Error;d.l(f,(t=>{if(d.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),f=t&&t.target&&t.target.src;b.message="Loading chunk "+a+" failed.\n("+c+": "+f+")",b.name="ChunkLoadError",b.type=c,b.request=f,r[1](b)}}),"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,f=t[0],b=t[1],o=t[2],n=0;if(f.some((a=>0!==e[a]))){for(r in b)d.o(b,r)&&(d.m[r]=b[r]);if(o)var i=o(d)}for(a&&a(t);n Archive | Touying - + diff --git a/blog/index.html b/blog/index.html index 68d75be9c..613fe7909 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 0be638dfe..e3f0d16d4 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 956966ac2..20673ec8b 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 bcfcb38cc..1f4370bba 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/build-your-own-theme/index.html b/docs/build-your-own-theme/index.html index 6460c5183..dfe2fd4ec 100644 --- a/docs/build-your-own-theme/index.html +++ b/docs/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Build Your Own Theme | Touying - + diff --git a/docs/category/dynamic-slides/index.html b/docs/category/dynamic-slides/index.html index aa3fee74c..e837b0b8f 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 1f56368ab..b42129271 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/progress/index.html b/docs/category/progress/index.html index eac2cb1f2..d7ffb99d9 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 52b610a22..b4c3909ea 100644 --- a/docs/category/themes/index.html +++ b/docs/category/themes/index.html @@ -5,10 +5,10 @@ Themes | Touying - + - + \ No newline at end of file diff --git a/docs/category/utilities/index.html b/docs/category/utilities/index.html index 906d95b31..7425acef7 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 3f1fecccf..2595e11a0 100644 --- a/docs/changelog/index.html +++ b/docs/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/dynamic/complex/index.html b/docs/dynamic/complex/index.html index 72cb4903f..01194db52 100644 --- a/docs/dynamic/complex/index.html +++ b/docs/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + @@ -14,6 +14,7 @@

Callback-Style Functions

To overcome the limitations of styled and layout mentioned earlier, Touying cleverly implements always-effective only, uncover, and alternatives using callback functions. Specifically, you need to introduce these three functions as follows:

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

In subslide #self.subslide,

test #uncover("2-")[uncover] function,

and test #only("2-")[only] function,

#pause

and paused text.
])
+

image

Notice that we no longer pass a content block but instead pass a callback function with a self parameter. Later, we extract only, uncover, and alternatives functions from self using:

#let (uncover, only, alternatives) = utils.methods(self)

We then call these functions in subsequent steps.

@@ -29,6 +30,7 @@

uncoveralternatives

The alternatives function displays a series of different content in different subslides. For example:

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

#alternatives[Ann][Bob][Christopher]
likes
#alternatives[chocolate][strawberry][vanilla]
ice cream.
])
+

image

As you can see, alternatives can automatically expand to the most suitable width and height, a capability that only and uncover lack. In fact, alternatives has other parameters, such as start: 2, repeat-last: true, and position: center + horizon. For more usage, refer to Polylux.

\ No newline at end of file diff --git a/docs/dynamic/cover/index.html b/docs/dynamic/cover/index.html index ce84518ed..84db69614 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 7374e3ade..cb8ae5064 100644 --- a/docs/dynamic/equation/index.html +++ b/docs/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + @@ -14,12 +14,14 @@

Simple Animation

Let's start with an example:

#slide[
Touying equation with pause:

#touying-equation(`
f(x) &= pause x^2 + 2x + 1 \
&= pause (x + 1)^2 \
`)

#meanwhile

Touying equation is very simple.
]
+

image

We use the touying-equation function to incorporate pause and meanwhile within the text of math equations (in fact, you can also use #pause or #pause;).

As you would expect, the math equation is displayed step by step, making it suitable for presenters to demonstrate their math reasoning.

Warning

While the touying-equation function is convenient, you should always be aware that it doesn't perform complex syntax analysis. It simply splits the string using regular expressions. Therefore, you should not use pause or meanwhile within functions like display(..)!

Complex Animation

In fact, we can also use only, uncover, and alternatives within touying-equation with a little trick:

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

#touying-equation(scope: (uncover: uncover), `
f(x) &= pause x^2 + 2x + uncover("3-", 1) \
&= pause (x + 1)^2 \
`)
])
+

image

We can pass the functions we need into the touying-equation through the scope parameter, such as uncover in this example.

Parameters

The function definition of touying-equation is:

diff --git a/docs/dynamic/handout/index.html b/docs/dynamic/handout/index.html index 22031ba1a..23f450784 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/simple/index.html b/docs/dynamic/simple/index.html index 74a7201a8..dfef268aa 100644 --- a/docs/dynamic/simple/index.html +++ b/docs/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + @@ -14,16 +14,19 @@

pause

The purpose of #pause is straightforward – it separates the subsequent content into the next subslide. You can use multiple #pause to create multiple subslides. Here's a simple example:

#slide[
First #pause Second

#pause

Third
]
+

image

This example will create three subslides, gradually revealing the content.

As you can see, #pause can be used inline or on a separate line.

meanwhile

In some cases, you may need to display additional content simultaneously with #pause. In such cases, you can use #meanwhile.

#slide[
First

#pause

Second

#meanwhile

Third

#pause

Fourth
]
+

image

This example will create only two subslides, with "First" and "Third" displayed simultaneously, and "Second" and "Fourth" displayed simultaneously.

Handling set-show rules

If you use set-show rules inside slide[..], you might be surprised to find that subsequent #pause and #meanwhile do not work. This is because Touying cannot detect the content inside styled(..) (content after set-show rules is encompassed by styled).

To address this issue, Touying provides a setting parameter for the #slide() function. You can place your set-show rules in the setting parameter. For example, changing the font color:

#slide(setting: body => {
set text(fill: blue)
body
})[
First

#pause

Second
]
+

image

Similarly, Touying currently does not support #pause and #meanwhile inside layout functions like grid. This is due to the same limitation, but you can use the composer parameter of #slide() to meet most requirements.

Internals

Touying doesn't rely on counter and locate to implement #pause. Instead, it has a parser written in Typst script. It parses the input content block as a sequence and then transforms and reorganizes this sequence into the series of subslides we need.

diff --git a/docs/external/pdfpc/index.html b/docs/external/pdfpc/index.html index 6c294731d..4c02e3b33 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 cf841c6f7..81f08e5ff 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/intro/index.html b/docs/intro/index.html index 3e5d13f55..978d0db6b 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 b722125c0..0bdfe5596 100644 --- a/docs/layout/index.html +++ b/docs/layout/index.html @@ -5,7 +5,7 @@ Layout Your Contents | Touying - + @@ -21,6 +21,7 @@

Sec

Similar to Beamer, Touying also has the concepts of sections and subsections.

In the #show: slides mode, sections and subsections correspond to first-level and second-level titles, respectively. For example:

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Section

== Subsection

Hello, Touying!
+

image

However, the second-level title does not always correspond to the subsection. The specific mapping may vary depending on the theme.

In the more general #slide[..] mode, sections and subsections are passed as parameters to the slide function, for example:

#slide(section: [Let's start a new section!])[..]

#slide(subsection: [Let's start a new subsection!])[..]
@@ -41,7 +42,9 @@

Page Managem

Page Columns

If you need to divide a page into two or three columns, you can use the default compose feature provided by the Touying slide function. The simplest examples are:

#slide[
First column.
][
Second column.
]
+

image

If you need to change the way columns are composed, you can modify the composer parameter of slide. The default parameter is utils.with.side-by-side(columns: auto, gutter: 1em). If we want the left column to occupy the remaining width, we can use:

-
#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[
First column.
][
Second column.
]
+
#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[
First column.
][
Second column.
]
+

image

\ No newline at end of file diff --git a/docs/progress/counters/index.html b/docs/progress/counters/index.html index cb9e0f481..6cfd735d1 100644 --- a/docs/progress/counters/index.html +++ b/docs/progress/counters/index.html @@ -5,7 +5,7 @@ Touying Counters | Touying - + diff --git a/docs/progress/sections/index.html b/docs/progress/sections/index.html index 99ffc3352..44393d3ec 100644 --- a/docs/progress/sections/index.html +++ b/docs/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/start/index.html b/docs/start/index.html index bc13bc9d3..ee46819c3 100644 --- a/docs/start/index.html +++ b/docs/start/index.html @@ -5,7 +5,7 @@ Getting Started | Touying - + @@ -13,10 +13,12 @@

Before you begin, make sure you have installed the Typst environment. If not, you can use the Web App or the Typst LSP and Typst Preview plugins for VS Code.

To use Touying, you only need to include the following code in your document:

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

It's simple. Congratulations on creating your first Touying slide! 🎉

More Complex Examples

In fact, Touying provides various styles for writing slides. For example, the above example uses first-level and second-level titles to create new slides. However, you can also use the #slide[..] format to access more powerful features provided by Touying.

#import "@preview/touying:0.2.0": *

#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide) = utils.methods(s)
#show: init

// simple animations
#slide[
a simple #pause *dynamic*

#pause

slide.

#meanwhile

meanwhile #pause with pause.
][
second #pause pause.
]

// complex animations
#slide(setting: body => {
set text(fill: blue)
body
}, repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

in subslide #self.subslide

test #uncover("2-")[uncover] function

test #only("2-")[only] function

#pause

and paused text.
])

// math equation animations
#slide[
== Touying Equation

#touying-equation(`
f(x) &= pause x^2 + 2x + 1 \
&= pause (x + 1)^2 \
`)

#meanwhile

Touying equation is very simple.
]

// multiple pages for one slide
#slide[
== Multiple Pages for One Slide

#lorem(200)
]

// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide,) = utils.methods(s)

#slide[
== Appendix
]
+

image

In addition, Touying provides many built-in themes to easily create beautiful slides. Basically, you just need to add a line at the top of your document:

#let s = themes.metropolis.register(s, aspect-ratio: "16-9")

This will allow you to use the Metropolis theme. For more detailed tutorials, you can refer to the following chapters.

diff --git a/docs/style/index.html b/docs/style/index.html index 2036b84c9..0c16742ca 100644 --- a/docs/style/index.html +++ b/docs/style/index.html @@ -5,7 +5,7 @@ Code Styles | Touying - + @@ -14,6 +14,8 @@

show-slide

If we only need simplicity, we can use #show: slides for a cleaner syntax.

However, this approach has corresponding drawbacks: firstly, this method may significantly impact document rendering performance. Secondly, subsequent #slide(..) cannot be added directly. Instead, you need to manually mark #slides-end. The most significant drawback is that complex functionalities cannot be achieved.

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

#slides-end

#slide[
A new slide.
]
+

image

+

And you can create a new page with the empty header ==.

slide-block Style

For better performance and more powerful capabilities, in most cases, we still need to use the code style like:

#slide[
A new slide.
]
diff --git a/docs/themes/dewdrop/index.html b/docs/themes/dewdrop/index.html index 28fa9b051..e200a0321 100644 --- a/docs/themes/dewdrop/index.html +++ b/docs/themes/dewdrop/index.html @@ -3,13 +3,14 @@ -Dewdrop Theme | Touying +Dewdrop Theme | Touying - +

Dewdrop Theme

+

image

This theme is inspired by BeamerTheme created by Zhibo Wang and transformed by OrangeX4.

The Dewdrop theme features an elegant and aesthetic navigation, including sidebar and mini-slides modes.

Initialization

@@ -59,6 +60,7 @@

slides

You can set these using #show: slides.with(..).

#import "@preview/touying:0.2.0": *

#let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop])
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

Example

#import "@preview/touying:0.2.0": *

#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
// navigation: "sidebar",
// navigation: none,
)
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
// #let s = (s.methods.appendix-in-outline)(self: s, false)
#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#title-slide()

#slide[
== Outline

#touying-outline(cover: false)
]

#slide(section: [Section A])[
== Outline

#touying-outline()
]

#slide(subsection: [Subsection A.1])[
== Title

A slide with equation:

$ x_(n+1) = (x_n + a/x_n) / 2 $
]

#slide(subsection: [Subsection A.2])[
== Important

A slide without a title but with *important* infos
]

#slide(section: [Section B])[
== Outline

#touying-outline()
]

#slide(subsection: [Subsection B.1])[
== Another Subsection

#lorem(80)
]

#focus-slide[
Wake up!
]

// simple animations
#slide(subsection: [Subsection B.2])[
== Dynamic

a simple #pause dynamic slide with #alert[alert]

#pause

text.
]

// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide,) = utils.methods(s)

#slide(section: [Appendix])[
== Outline

#touying-outline()
]

#slide[
appendix
]

diff --git a/docs/themes/metropolis/index.html b/docs/themes/metropolis/index.html index 9474b6d96..11cc77f76 100644 --- a/docs/themes/metropolis/index.html +++ b/docs/themes/metropolis/index.html @@ -3,13 +3,14 @@ -Metropolis Theme | Touying +Metropolis Theme | Touying - +

Metropolis Theme

+

image

This theme is inspired by the Metropolis beamer theme created by Matthias Vogelgesang and transformed by Enivex.

The Metropolis theme is elegant and suitable for daily use. For the best results, it is recommended to install the Fira Sans and Fira Math fonts on your computer.

Initialization

@@ -50,6 +51,7 @@

slides

You can set these using #show: slides.with(..).

#import "@preview/touying:0.2.0": *

#let s = themes.metropolis.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

Example

#import "@preview/touying:0.2.0": *

#let s = themes.metropolis.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#title-slide(extra: [Extra])

#slide(title: [Table of contents])[
#touying-outline()
]

#slide(title: [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])[
A slide with some maths:
$ x_(n+1) = (x_n + a/x_n) / 2 $

#lorem(200)
]

#new-section-slide[First section]

#slide[
A slide without a title but with *important* infos
]

#new-section-slide[Second section]

#focus-slide[
Wake up!
]

// simple animations
#slide[
a simple #pause dynamic slide with #alert[alert]

#pause

text.
]

// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide, new-section-slide) = utils.methods(s)

#new-section-slide[Appendix]

#slide[
appendix
]

diff --git a/docs/themes/simple/index.html b/docs/themes/simple/index.html index 8514f333d..7af2b2f0b 100644 --- a/docs/themes/simple/index.html +++ b/docs/themes/simple/index.html @@ -3,13 +3,14 @@ -Simple Theme | Touying +Simple Theme | Touying - +

Simple Theme

+

image

This theme is derived from Polylux, created by Andreas Kröpelin.

Considered a relatively simple theme, you can use it to create straightforward slides and easily incorporate features you like.

Initialization

@@ -39,6 +40,7 @@

Slide

Used to draw attention. It optionally accepts a foreground color (default is white) and a background color (default is auto, i.e., self.colors.primary).

slides Function

#import "@preview/touying:0.2.0": *

#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

Example

#import "@preview/touying:0.2.0": *

#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)
#show: init

#title-slide[
= Keep it simple!
#v(2em)

Alpha #footnote[Uni Augsburg] #h(1em)
Bravo #footnote[Uni Bayreuth] #h(1em)
Charlie #footnote[Uni Chemnitz] #h(1em)

July 23
]

#slide[
== First slide

#lorem(20)
]

#focus-slide[
_Focus!_

This is very important.
]

#centered-slide(section: [Let's start a new section!])

#slide[
== Dynamic slide
Did you know that...

#pause
...you can see the current section at the top of the slide?
]
diff --git a/docs/utilities/fit-to/index.html b/docs/utilities/fit-to/index.html index 83fa973c1..534f305a2 100644 --- a/docs/utilities/fit-to/index.html +++ b/docs/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + @@ -13,7 +13,7 @@

Thanks to ntjess for the code.

Fit to Height

If you need to make an image fill the remaining slide height, you can try the fit-to-height function:

-
#fit-to-height(1fr)[BIG]
+
#utils.fit-to-height(1fr)[BIG]

Function definition:

#let fit-to-height(
width: none, prescale-width: none, grow: true, shrink: true, height, body
) = { .. }

Parameters:

@@ -27,7 +27,7 @@

Fit to Height<

Fit to Width

If you need to limit the title width to exactly fill the slide width, you can try the fit-to-width function:

-
#fit-to-width(1fr)[#lorem(20)]
+
#utils.fit-to-width(1fr)[#lorem(20)]

Function definition:

#let fit-to-width(grow: true, shrink: true, width, body) = { .. }

Parameters:

diff --git a/docs/utilities/oop/index.html b/docs/utilities/oop/index.html index 505258b47..088e570f2 100644 --- a/docs/utilities/oop/index.html +++ b/docs/utilities/oop/index.html @@ -5,7 +5,7 @@ Object-Oriented Programming | Touying - + diff --git a/index.html b/index.html index 0d5f969f7..bfde4364d 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Touying in Typst | Touying - + diff --git a/markdown-page/index.html b/markdown-page/index.html index d259e873e..c13f94411 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -5,7 +5,7 @@ Markdown page example | Touying - + diff --git a/zh/404.html b/zh/404.html index 9e8387939..29337a877 100644 --- a/zh/404.html +++ b/zh/404.html @@ -5,7 +5,7 @@ 找不到页面 | Touying - + diff --git a/zh/assets/js/339ee8e1.9ca837f0.js b/zh/assets/js/339ee8e1.56905318.js similarity index 68% rename from zh/assets/js/339ee8e1.9ca837f0.js rename to zh/assets/js/339ee8e1.56905318.js index 8b49d8075..b13d5f3fd 100644 --- a/zh/assets/js/339ee8e1.9ca837f0.js +++ b/zh/assets/js/339ee8e1.56905318.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8506],{607:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=s(5893),i=s(1151);const l={sidebar_position:2},o="Metropolis \u4e3b\u9898",r={id:"themes/metropolis",title:"Metropolis \u4e3b\u9898",description:"\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Matthias Vogelgesang \u521b\u4f5c\u7684 Metropolis beamer \u4e3b\u9898\uff0c\u7531 Enivex \u6539\u9020\u800c\u6765\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/zh/docs/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 \u4e3b\u9898",permalink:"/touying/zh/docs/themes/simple"},next:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/themes/dewdrop"}},d={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"metropolis-\u4e3b\u9898",children:"Metropolis \u4e3b\u9898"}),"\n",(0,t.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Matthias Vogelgesang \u521b\u4f5c\u7684 ",(0,t.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," \u4e3b\u9898\uff0c\u7531 ",(0,t.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"})," \u6539\u9020\u800c\u6765\u3002"]}),"\n",(0,t.jsx)(n.p,{children:"\u8fd9\u4e2a\u4e3b\u9898\u7f8e\u89c2\u5927\u65b9\uff0c\u5f88\u9002\u5408\u65e5\u5e38\u4f7f\u7528\uff0c\u5e76\u4e14\u4f60\u6700\u597d\u5728\u7535\u8111\u4e0a\u5b89\u88c5 Fira Sans \u548c Fira Math \u5b57\u4f53\uff0c\u4ee5\u53d6\u5f97\u6700\u4f73\u6548\u679c\u3002"}),"\n",(0,t.jsx)(n.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,t.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"header"}),": \u663e\u793a\u5728\u9875\u7709\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"states.current-section-title"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,t.jsx)(n.code,{children:"self => self.info.title"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,t.jsx)(n.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-progress"}),": \u662f\u5426\u663e\u793a slide \u5e95\u90e8\u7684\u8fdb\u5ea6\u6761\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5e76\u4e14 Metropolis \u4e3b\u9898\u4f1a\u63d0\u4f9b\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:"#alert[..]"})," \u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," \u6765\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"*alert text*"})," \u8bed\u6cd5\u3002"]}),"\n",(0,t.jsx)(n.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,t.jsx)(n.p,{children:"Metropolis \u9ed8\u8ba4\u4f7f\u7528\u4e86"}),"\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 neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["\u989c\u8272\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"})," \u5bf9\u5176\u8fdb\u884c\u4fee\u6539\u3002"]}),"\n",(0,t.jsx)(n.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,t.jsx)(n.p,{children:"Metropolis \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"title-slide"})," \u4f1a\u8bfb\u53d6 ",(0,t.jsx)(n.code,{children:"self.info"})," \u91cc\u7684\u4fe1\u606f\u7528\u4e8e\u663e\u793a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e3a\u5176\u4f20\u5165 ",(0,t.jsx)(n.code,{children:"extra"})," \u53c2\u6570\uff0c\u663e\u793a\u989d\u5916\u7684\u4fe1\u606f\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\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 // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n margin: (top: 3em, bottom: 1em, left: 0em, right: 0em),\n padding: 2em,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"title"})," \u9ed8\u8ba4\u4e3a\u5f53\u524d section title\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u80cc\u666f\u8272\u4e3a ",(0,t.jsx)(n.code,{children:"self.colors.primary-dark"}),"\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,t.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\u3002"}),"\n",(0,t.jsxs)(n.h2,{id:"slides-\u51fd\u6570",children:[(0,t.jsx)(n.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"outline-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"outline-title"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"[Table of contents]"}),"\u3002"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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,t.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide(extra: [Extra])\n\n#slide(title: [Table of contents])[\n #touying-outline()\n]\n\n#slide(title: [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 A slide with some maths:\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n#new-section-slide[First section]\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n#new-section-slide[Second section]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\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, new-section-slide) = utils.methods(s)\n\n#new-section-slide[Appendix]\n\n#slide[\n appendix\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>r,a:()=>o});var t=s(7294);const i={},l=t.createContext(i);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(i):e.components||i:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8506],{607:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=s(5893),i=s(1151);const l={sidebar_position:2},o="Metropolis \u4e3b\u9898",r={id:"themes/metropolis",title:"Metropolis \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/zh/docs/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 \u4e3b\u9898",permalink:"/touying/zh/docs/themes/simple"},next:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/themes/dewdrop"}},d={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",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,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"metropolis-\u4e3b\u9898",children:"Metropolis \u4e3b\u9898"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a1b34b11-6797-42fd-b50f-477a0d672ba2",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Matthias Vogelgesang \u521b\u4f5c\u7684 ",(0,t.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," \u4e3b\u9898\uff0c\u7531 ",(0,t.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"})," \u6539\u9020\u800c\u6765\u3002"]}),"\n",(0,t.jsx)(n.p,{children:"\u8fd9\u4e2a\u4e3b\u9898\u7f8e\u89c2\u5927\u65b9\uff0c\u5f88\u9002\u5408\u65e5\u5e38\u4f7f\u7528\uff0c\u5e76\u4e14\u4f60\u6700\u597d\u5728\u7535\u8111\u4e0a\u5b89\u88c5 Fira Sans \u548c Fira Math \u5b57\u4f53\uff0c\u4ee5\u53d6\u5f97\u6700\u4f73\u6548\u679c\u3002"}),"\n",(0,t.jsx)(n.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,t.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"header"}),": \u663e\u793a\u5728\u9875\u7709\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"states.current-section-title"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,t.jsx)(n.code,{children:"self => self.info.title"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,t.jsx)(n.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-progress"}),": \u662f\u5426\u663e\u793a slide \u5e95\u90e8\u7684\u8fdb\u5ea6\u6761\uff0c\u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5e76\u4e14 Metropolis \u4e3b\u9898\u4f1a\u63d0\u4f9b\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:"#alert[..]"})," \u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," \u6765\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"*alert text*"})," \u8bed\u6cd5\u3002"]}),"\n",(0,t.jsx)(n.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,t.jsx)(n.p,{children:"Metropolis \u9ed8\u8ba4\u4f7f\u7528\u4e86"}),"\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 neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["\u989c\u8272\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"})," \u5bf9\u5176\u8fdb\u884c\u4fee\u6539\u3002"]}),"\n",(0,t.jsx)(n.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,t.jsx)(n.p,{children:"Metropolis \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"title-slide"})," \u4f1a\u8bfb\u53d6 ",(0,t.jsx)(n.code,{children:"self.info"})," \u91cc\u7684\u4fe1\u606f\u7528\u4e8e\u663e\u793a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e3a\u5176\u4f20\u5165 ",(0,t.jsx)(n.code,{children:"extra"})," \u53c2\u6570\uff0c\u663e\u793a\u989d\u5916\u7684\u4fe1\u606f\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\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 // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n margin: (top: 3em, bottom: 1em, left: 0em, right: 0em),\n padding: 2em,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"title"})," \u9ed8\u8ba4\u4e3a\u5f53\u524d section title\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u80cc\u666f\u8272\u4e3a ",(0,t.jsx)(n.code,{children:"self.colors.primary-dark"}),"\u3002"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,t.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\u3002"}),"\n",(0,t.jsxs)(n.h2,{id:"slides-\u51fd\u6570",children:[(0,t.jsx)(n.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"outline-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"outline-title"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"[Table of contents]"}),"\u3002"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4ab45ee6-09f7-498b-b349-e889d6e42e3e",alt:"image"})}),"\n",(0,t.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.metropolis.register(s, 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, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide(extra: [Extra])\n\n#slide(title: [Table of contents])[\n #touying-outline()\n]\n\n#slide(title: [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 A slide with some maths:\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n#new-section-slide[First section]\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n#new-section-slide[Second section]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\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, new-section-slide) = utils.methods(s)\n\n#new-section-slide[Appendix]\n\n#slide[\n appendix\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>r,a:()=>o});var t=s(7294);const i={},l=t.createContext(i);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(i):e.components||i:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/43883141.970f1684.js b/zh/assets/js/43883141.970f1684.js new file mode 100644 index 000000000..9cc64604d --- /dev/null +++ b/zh/assets/js/43883141.970f1684.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7502],{2434:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>u,frontMatter:()=>t,metadata:()=>d,toc:()=>a});var o=i(5893),s=i(1151);const t={sidebar_position:3},c="\u6570\u5b66\u516c\u5f0f\u52a8\u753b",d={id:"dynamic/equation",title:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",description:"Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 pause \u548c meanwhile\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/equation.md",sourceDirName:"dynamic",slug:"/dynamic/equation",permalink:"/touying/zh/docs/dynamic/equation",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/equation.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u590d\u6742\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/complex"},next:{title:"Cover \u51fd\u6570",permalink:"/touying/zh/docs/dynamic/cover"}},r={},a=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"\u590d\u6742\u52a8\u753b",id:"\u590d\u6742\u52a8\u753b",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2}];function l(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",children:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b"}),"\n",(0,o.jsxs)(n.p,{children:["Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u548c ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\u3002"]}),"\n",(0,o.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,o.jsx)(n.p,{children:"\u8ba9\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:"#slide[\n Touying 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\n Touying equation is very simple.\n]\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d176e61f-c0da-4c2a-a1bf-52621be5adb2",alt:"image"})}),"\n",(0,o.jsxs)(n.p,{children:["\u6211\u4eec\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u51fd\u6570\u6765\u5b9e\u73b0\u5728\u6570\u5b66\u516c\u5f0f\u6587\u672c\u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u548c ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\uff08\u4e8b\u5b9e\u4e0a\uff0c\u4f60\u4e5f\u80fd\u7528 ",(0,o.jsx)(n.code,{children:"#pause"})," \u6216\u8005 ",(0,o.jsx)(n.code,{children:"#pause;"}),"\uff09\u3002"]}),"\n",(0,o.jsx)(n.p,{children:"\u6b63\u5982\u4f60\u6599\u60f3\u7684\u4e00\u6837\uff0c\u6570\u5b66\u516c\u5f0f\u4f1a\u5206\u6b65\u663e\u793a\uff0c\u8fd9\u5f88\u9002\u5408\u7ed9\u8ba9\u6f14\u8bb2\u8005\u6f14\u793a\u81ea\u5df1\u7684\u6570\u5b66\u516c\u5f0f\u63a8\u7406\u601d\u8def\u3002"}),"\n",(0,o.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,o.jsxs)(n.p,{children:["\u867d\u7136 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u51fd\u6570\u5f88\u4fbf\u5229\uff0c\u4f46\u662f\u60a8\u9700\u8981\u65f6\u523b\u6ce8\u610f\uff0c",(0,o.jsx)(n.code,{children:"touying-equation"})," \u5e76\u4e0d\u4f1a\u505a\u590d\u6742\u7684\u8bed\u6cd5\u5206\u6790\uff0c\u53ea\u662f\u5355\u7eaf\u5730\u6b63\u5219\u8868\u8fbe\u5f0f\u5206\u5272\u5b57\u7b26\u4e32\uff0c\u56e0\u6b64\u60a8\u4e0d\u5e94\u5728 ",(0,o.jsx)(n.code,{children:"display(..)"})," \u8fd9\u7c7b\u51fd\u6570\u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u6216 ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\uff01"]})}),"\n",(0,o.jsx)(n.h2,{id:"\u590d\u6742\u52a8\u753b",children:"\u590d\u6742\u52a8\u753b"}),"\n",(0,o.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"only"}),"\u3001",(0,o.jsx)(n.code,{children:"uncover"})," \u548c ",(0,o.jsx)(n.code,{children:"alternatives"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #touying-equation(scope: (uncover: uncover), `\n f(x) &= pause x^2 + 2x + uncover("3-", 1) \\\n &= pause (x + 1)^2 \\\n `)\n])\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f2df14a2-6424-4c53-81f7-1595aa330660",alt:"image"})}),"\n",(0,o.jsxs)(n.p,{children:["\u6211\u4eec\u53ef\u4ee5\u5728 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u7684 ",(0,o.jsx)(n.code,{children:"scope"})," \u53c2\u6570\u4e2d\u5c06\u6211\u4eec\u9700\u8981\u7528\u5230\u7684\u51fd\u6570\u4f20\u9012\u8fdb\u53bb\uff0c\u4f8b\u5982\u8fd9\u91cc\u7684 ",(0,o.jsx)(n.code,{children:"uncover"}),"\u3002"]}),"\n",(0,o.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.code,{children:"touying-equation"})," \u7684\u51fd\u6570\u5b9a\u4e49\u4e3a"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:"#let touying-equation(block: true, numbering: none, supplement: auto, scope: (:), body) = { .. }\n"})}),"\n",(0,o.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u50cf\u4f7f\u7528\u666e\u901a\u6570\u5b66\u516c\u5f0f\u4e00\u6837\uff0c\u4e3a ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u4f20\u5165 ",(0,o.jsx)(n.code,{children:"block"}),"\u3001",(0,o.jsx)(n.code,{children:"numbering"})," \u548c ",(0,o.jsx)(n.code,{children:"supplement"})," \u53c2\u6570\u3002"]})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>c});var o=i(7294);const s={},t=o.createContext(s);function c(e){const n=o.useContext(t);return o.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:c(e.components),o.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/43883141.dc54358b.js b/zh/assets/js/43883141.dc54358b.js deleted file mode 100644 index 575d07fc0..000000000 --- a/zh/assets/js/43883141.dc54358b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7502],{2434:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>t,default:()=>u,frontMatter:()=>s,metadata:()=>d,toc:()=>l});var o=i(5893),c=i(1151);const s={sidebar_position:3},t="\u6570\u5b66\u516c\u5f0f\u52a8\u753b",d={id:"dynamic/equation",title:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",description:"Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 pause \u548c meanwhile\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/equation.md",sourceDirName:"dynamic",slug:"/dynamic/equation",permalink:"/touying/zh/docs/dynamic/equation",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/equation.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u590d\u6742\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/complex"},next:{title:"Cover \u51fd\u6570",permalink:"/touying/zh/docs/dynamic/cover"}},r={},l=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"\u590d\u6742\u52a8\u753b",id:"\u590d\u6742\u52a8\u753b",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2}];function a(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",children:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b"}),"\n",(0,o.jsxs)(n.p,{children:["Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u548c ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\u3002"]}),"\n",(0,o.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,o.jsx)(n.p,{children:"\u8ba9\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:"#slide[\n Touying 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\n Touying equation is very simple.\n]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["\u6211\u4eec\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u51fd\u6570\u6765\u5b9e\u73b0\u5728\u6570\u5b66\u516c\u5f0f\u6587\u672c\u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u548c ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\uff08\u4e8b\u5b9e\u4e0a\uff0c\u4f60\u4e5f\u80fd\u7528 ",(0,o.jsx)(n.code,{children:"#pause"})," \u6216\u8005 ",(0,o.jsx)(n.code,{children:"#pause;"}),"\uff09\u3002"]}),"\n",(0,o.jsx)(n.p,{children:"\u6b63\u5982\u4f60\u6599\u60f3\u7684\u4e00\u6837\uff0c\u6570\u5b66\u516c\u5f0f\u4f1a\u5206\u6b65\u663e\u793a\uff0c\u8fd9\u5f88\u9002\u5408\u7ed9\u8ba9\u6f14\u8bb2\u8005\u6f14\u793a\u81ea\u5df1\u7684\u6570\u5b66\u516c\u5f0f\u63a8\u7406\u601d\u8def\u3002"}),"\n",(0,o.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,o.jsxs)(n.p,{children:["\u867d\u7136 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u51fd\u6570\u5f88\u4fbf\u5229\uff0c\u4f46\u662f\u60a8\u9700\u8981\u65f6\u523b\u6ce8\u610f\uff0c",(0,o.jsx)(n.code,{children:"touying-equation"})," \u5e76\u4e0d\u4f1a\u505a\u590d\u6742\u7684\u8bed\u6cd5\u5206\u6790\uff0c\u53ea\u662f\u5355\u7eaf\u5730\u6b63\u5219\u8868\u8fbe\u5f0f\u5206\u5272\u5b57\u7b26\u4e32\uff0c\u56e0\u6b64\u60a8\u4e0d\u5e94\u5728 ",(0,o.jsx)(n.code,{children:"display(..)"})," \u8fd9\u7c7b\u51fd\u6570\u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"pause"})," \u6216 ",(0,o.jsx)(n.code,{children:"meanwhile"}),"\uff01"]})}),"\n",(0,o.jsx)(n.h2,{id:"\u590d\u6742\u52a8\u753b",children:"\u590d\u6742\u52a8\u753b"}),"\n",(0,o.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u5185\u90e8\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:"only"}),"\u3001",(0,o.jsx)(n.code,{children:"uncover"})," \u548c ",(0,o.jsx)(n.code,{children:"alternatives"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #touying-equation(scope: (uncover: uncover), `\n f(x) &= pause x^2 + 2x + uncover("3-", 1) \\\n &= pause (x + 1)^2 \\\n `)\n])\n'})}),"\n",(0,o.jsxs)(n.p,{children:["\u6211\u4eec\u53ef\u4ee5\u5728 ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u7684 ",(0,o.jsx)(n.code,{children:"scope"})," \u53c2\u6570\u4e2d\u5c06\u6211\u4eec\u9700\u8981\u7528\u5230\u7684\u51fd\u6570\u4f20\u9012\u8fdb\u53bb\uff0c\u4f8b\u5982\u8fd9\u91cc\u7684 ",(0,o.jsx)(n.code,{children:"uncover"}),"\u3002"]}),"\n",(0,o.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.code,{children:"touying-equation"})," \u7684\u51fd\u6570\u5b9a\u4e49\u4e3a"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:"#let touying-equation(block: true, numbering: none, supplement: auto, scope: (:), body) = { .. }\n"})}),"\n",(0,o.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u50cf\u4f7f\u7528\u666e\u901a\u6570\u5b66\u516c\u5f0f\u4e00\u6837\uff0c\u4e3a ",(0,o.jsx)(n.code,{children:"touying-equation"})," \u4f20\u5165 ",(0,o.jsx)(n.code,{children:"block"}),"\u3001",(0,o.jsx)(n.code,{children:"numbering"})," \u548c ",(0,o.jsx)(n.code,{children:"supplement"})," \u53c2\u6570\u3002"]})]})}function u(e={}){const{wrapper:n}={...(0,c.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>t});var o=i(7294);const c={},s=o.createContext(c);function t(e){const n=o.useContext(s);return o.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(c):e.components||c:t(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/6ab64546.aefc3306.js b/zh/assets/js/6ab64546.aefc3306.js new file mode 100644 index 000000000..d521389d2 --- /dev/null +++ b/zh/assets/js/6ab64546.aefc3306.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[703],{6527:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>r});var i=s(5893),t=s(1151);const o={sidebar_position:4},l="\u4ee3\u7801\u98ce\u683c",d={id:"style",title:"\u4ee3\u7801\u98ce\u683c",description:"show-slides \u98ce\u683c",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/style.md",sourceDirName:".",slug:"/style",permalink:"/touying/zh/docs/style",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/style.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\u6392\u7bc7\u5e03\u5c40",permalink:"/touying/zh/docs/layout"},next:{title:"Dynamic Slides",permalink:"/touying/zh/docs/category/dynamic-slides"}},c={},r=[{value:"show-slides \u98ce\u683c",id:"show-slides-\u98ce\u683c",level:2},{value:"slide-block \u98ce\u683c",id:"slide-block-\u98ce\u683c",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u4ee3\u7801\u98ce\u683c",children:"\u4ee3\u7801\u98ce\u683c"}),"\n",(0,i.jsx)(n.h2,{id:"show-slides-\u98ce\u683c",children:"show-slides \u98ce\u683c"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u6211\u4eec\u53ea\u662f\u9700\u8981\u7b80\u5355\u4f7f\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#show: slides"})," \u5b9e\u73b0\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4f46\u662f\u8fd9\u6837\u505a\u4e5f\u6709\u5bf9\u5e94\u7684\u5f0a\u7aef\uff1a\u7b2c\u4e00\u4e2a\u5f0a\u7aef\u662f\u8fd9\u79cd\u65b9\u5f0f\u53ef\u80fd\u4f1a\u6781\u5927\u5730\u5f71\u54cd\u6587\u6863\u6e32\u67d3\u6027\u80fd\uff0c\u7b2c\u4e8c\u4e2a\u5f0a\u7aef\u662f\u540e\u7eed\u4e0d\u80fd\u76f4\u63a5\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"#slide(..)"}),"\uff0c\u800c\u662f\u9700\u8981\u624b\u52a8\u6807\u8bb0 ",(0,i.jsx)(n.code,{children:"#slides-end"}),"\uff0c\u4ee5\u53ca\u6700\u5927\u7684\u5f0a\u7aef\u662f\u5b9e\u73b0\u4e0d\u4e86\u590d\u6742\u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n\n#slides-end\n\n#slide[\n A new slide.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/db2a1b60-bc56-4fa9-a317-ee9ecc6f3895",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14\u4f60\u53ef\u4ee5\u4f7f\u7528\u7a7a\u6807\u9898 ",(0,i.jsx)(n.code,{children:"=="})," \u521b\u5efa\u4e00\u4e2a\u65b0\u9875\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-block-\u98ce\u683c",children:"slide-block \u98ce\u683c"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u66f4\u4f18\u79c0\u7684\u6027\u80fd\u548c\u66f4\u5f3a\u5927\u7684\u80fd\u529b\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u6211\u4eec\u8fd8\u662f\u9700\u8981\u4f7f\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n A new slide.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u6837\u7684\u4ee3\u7801\u98ce\u683c\u3002"})]})}function u(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:()=>l});var i=s(7294);const t={},o=i.createContext(t);function l(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(t):e.components||t:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/6ab64546.b59333ef.js b/zh/assets/js/6ab64546.b59333ef.js deleted file mode 100644 index 4da4e6188..000000000 --- a/zh/assets/js/6ab64546.b59333ef.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[703],{6527:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>r});var t=s(5893),i=s(1151);const o={sidebar_position:4},l="\u4ee3\u7801\u98ce\u683c",d={id:"style",title:"\u4ee3\u7801\u98ce\u683c",description:"show-slides \u98ce\u683c",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/style.md",sourceDirName:".",slug:"/style",permalink:"/touying/zh/docs/style",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/style.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\u6392\u7bc7\u5e03\u5c40",permalink:"/touying/zh/docs/layout"},next:{title:"Dynamic Slides",permalink:"/touying/zh/docs/category/dynamic-slides"}},c={},r=[{value:"show-slides \u98ce\u683c",id:"show-slides-\u98ce\u683c",level:2},{value:"slide-block \u98ce\u683c",id:"slide-block-\u98ce\u683c",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"\u4ee3\u7801\u98ce\u683c",children:"\u4ee3\u7801\u98ce\u683c"}),"\n",(0,t.jsx)(n.h2,{id:"show-slides-\u98ce\u683c",children:"show-slides \u98ce\u683c"}),"\n",(0,t.jsxs)(n.p,{children:["\u5982\u679c\u6211\u4eec\u53ea\u662f\u9700\u8981\u7b80\u5355\u4f7f\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#show: slides"})," \u5b9e\u73b0\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u4f46\u662f\u8fd9\u6837\u505a\u4e5f\u6709\u5bf9\u5e94\u7684\u5f0a\u7aef\uff1a\u7b2c\u4e00\u4e2a\u5f0a\u7aef\u662f\u8fd9\u79cd\u65b9\u5f0f\u53ef\u80fd\u4f1a\u6781\u5927\u5730\u5f71\u54cd\u6587\u6863\u6e32\u67d3\u6027\u80fd\uff0c\u7b2c\u4e8c\u4e2a\u5f0a\u7aef\u662f\u540e\u7eed\u4e0d\u80fd\u76f4\u63a5\u52a0\u5165 ",(0,t.jsx)(n.code,{children:"#slide(..)"}),"\uff0c\u800c\u662f\u9700\u8981\u624b\u52a8\u6807\u8bb0 ",(0,t.jsx)(n.code,{children:"#slides-end"}),"\uff0c\u4ee5\u53ca\u6700\u5927\u7684\u5f0a\u7aef\u662f\u5b9e\u73b0\u4e0d\u4e86\u590d\u6742\u7684\u529f\u80fd\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n\n#slides-end\n\n#slide[\n A new slide.\n]\n'})}),"\n",(0,t.jsx)(n.h2,{id:"slide-block-\u98ce\u683c",children:"slide-block \u98ce\u683c"}),"\n",(0,t.jsx)(n.p,{children:"\u4e3a\u4e86\u66f4\u4f18\u79c0\u7684\u6027\u80fd\u548c\u66f4\u5f3a\u5927\u7684\u80fd\u529b\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u6211\u4eec\u8fd8\u662f\u9700\u8981\u4f7f\u7528"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide[\n A new slide.\n]\n"})}),"\n",(0,t.jsx)(n.p,{children:"\u8fd9\u6837\u7684\u4ee3\u7801\u98ce\u683c\u3002"})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>l});var t=s(7294);const i={},o=t.createContext(i);function l(e){const n=t.useContext(o);return t.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(i):e.components||i:l(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/737adc8d.83296a3e.js b/zh/assets/js/737adc8d.83296a3e.js deleted file mode 100644 index f8f4ede89..000000000 --- a/zh/assets/js/737adc8d.83296a3e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6633],{7652:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>i,default:()=>h,frontMatter:()=>d,metadata:()=>o,toc:()=>t});var c=s(5893),l=s(1151);const d={sidebar_position:2},i="\u590d\u6742\u52a8\u753b",o={id:"dynamic/complex",title:"\u590d\u6742\u52a8\u753b",description:"\u5f97\u76ca\u4e8e Polylux \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 only\u3001uncover \u548c alternatives\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/complex.md",sourceDirName:"dynamic",slug:"/dynamic/complex",permalink:"/touying/zh/docs/dynamic/complex",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/complex.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\u7b80\u5355\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/simple"},next:{title:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/equation"}},r={},t=[{value:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",id:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",level:2},{value:"only",id:"only",level:2},{value:"uncover",id:"uncover",level:2},{value:"alternatives",id:"alternatives",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.h1,{id:"\u590d\u6742\u52a8\u753b",children:"\u590d\u6742\u52a8\u753b"}),"\n",(0,c.jsxs)(n.p,{children:["\u5f97\u76ca\u4e8e ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/syntax.html",children:"Polylux"})," \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"}),"\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",children:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570"}),"\n",(0,c.jsxs)(n.p,{children:["\u4e3a\u4e86\u907f\u514d\u4e0a\u6587\u63d0\u5230\u7684 ",(0,c.jsx)(n.code,{children:"styled"})," \u4e0e ",(0,c.jsx)(n.code,{children:"layout"})," \u9650\u5236\uff0cTouying \u5229\u7528\u56de\u8c03\u51fd\u6570\u5de7\u5999\u5b9e\u73b0\u4e86\u603b\u662f\u80fd\u751f\u6548\u7684 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"}),"\uff0c\u5177\u4f53\u6765\u8bf4\uff0c\u60a8\u8981\u8fd9\u6837\u5f15\u5165\u8fd9\u4e09\u4e2a\u51fd\u6570\uff1a"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n In subslide #self.subslide,\n\n test #uncover("2-")[uncover] function,\n\n and test #only("2-")[only] function,\n\n #pause\n\n and paused text.\n])\n'})}),"\n",(0,c.jsxs)(n.p,{children:["\u6ce8\u610f\u5230\u4e86\u5417\uff1f\u6211\u4eec\u4e0d\u518d\u662f\u4f20\u5165\u4e00\u4e2a\u5185\u5bb9\u5757\uff0c\u800c\u662f\u4f20\u5165\u4e86\u4e00\u4e2a\u53c2\u6570\u4e3a ",(0,c.jsx)(n.code,{children:"self"})," \u7684\u56de\u8c03\u51fd\u6570\uff0c\u968f\u540e\u6211\u4eec\u901a\u8fc7"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:"#let (uncover, only, alternatives) = utils.methods(self)\n"})}),"\n",(0,c.jsxs)(n.p,{children:["\u4ece ",(0,c.jsx)(n.code,{children:"self"})," \u4e2d\u53d6\u51fa\u4e86 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u8fd9\u4e09\u4e2a\u51fd\u6570\uff0c\u5e76\u5728\u540e\u7eed\u8c03\u7528\u5b83\u4eec\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e9b\u6709\u8da3\u7684\u4e8b\u5b9e\uff0c\u4f8b\u5982 int \u7c7b\u578b\u7684 ",(0,c.jsx)(n.code,{children:"self.subslide"})," \u6307\u793a\u4e86\u5f53\u524d subslide \u7d22\u5f15\uff0c\u800c\u5b9e\u9645\u4e0a ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u51fd\u6570\u4e5f\u6b63\u662f\u4f9d\u8d56 ",(0,c.jsx)(n.code,{children:"self.subslide"})," \u5b9e\u73b0\u7684\u83b7\u53d6\u5f53\u524d subslide \u7d22\u5f15\u3002"]}),"\n",(0,c.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,c.jsxs)(n.p,{children:["\u6211\u4eec\u624b\u52a8\u6307\u5b9a\u4e86\u53c2\u6570 ",(0,c.jsx)(n.code,{children:"repeat: 3"}),"\uff0c\u8fd9\u4ee3\u8868\u7740\u663e\u793a 3 \u5f20 subslides\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6307\u5b9a\u662f\u56e0\u4e3a Touying \u65e0\u6cd5\u63a2\u77e5 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u9700\u8981\u663e\u793a\u591a\u5c11\u5f20 subslides\u3002"]})}),"\n",(0,c.jsx)(n.h2,{id:"only",children:"only"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"only"})," \u51fd\u6570\u8868\u793a\u53ea\u5728\u9009\u5b9a\u7684 subslides \u4e2d\u300c\u51fa\u73b0\u300d\uff0c\u5982\u679c\u4e0d\u51fa\u73b0\uff0c\u5219\u4f1a\u5b8c\u5168\u6d88\u5931\uff0c\u4e5f\u4e0d\u4f1a\u5360\u636e\u4efb\u4f55\u7a7a\u95f4\u3002\u4e5f\u5373 ",(0,c.jsx)(n.code,{children:"#only(index, body)"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"body"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"none"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u5176\u4e2d index \u53ef\u4ee5\u662f int \u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u662f ",(0,c.jsx)(n.code,{children:'"2-"'})," \u6216 ",(0,c.jsx)(n.code,{children:'"2-3"'})," \u8fd9\u6837\u7684 str \u7c7b\u578b\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"uncover",children:"uncover"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"uncover"})," \u51fd\u6570\u8868\u793a\u53ea\u5728\u9009\u5b9a\u7684 subslides \u4e2d\u300c\u663e\u793a\u300d\uff0c\u5426\u5219\u4f1a\u88ab ",(0,c.jsx)(n.code,{children:"cover"})," \u51fd\u6570\u906e\u6321\uff0c\u4f46\u4ecd\u4f1a\u5360\u636e\u539f\u6709\u3002\u4e5f\u5373 ",(0,c.jsx)(n.code,{children:"#uncover(index, body)"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"body"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"cover(body)"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u5176\u4e2d index \u53ef\u4ee5\u662f int \u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u662f ",(0,c.jsx)(n.code,{children:'"2-"'})," \u6216 ",(0,c.jsx)(n.code,{children:'"2-3"'})," \u8fd9\u6837\u7684 str \u7c7b\u578b\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u60a8\u5e94\u8be5\u4e5f\u6ce8\u610f\u5230\u4e86\uff0c\u4e8b\u5b9e\u4e0a ",(0,c.jsx)(n.code,{children:"#pause"})," \u4e5f\u4f7f\u7528\u4e86 ",(0,c.jsx)(n.code,{children:"cover"})," \u51fd\u6570\uff0c\u53ea\u662f\u63d0\u4f9b\u4e86\u66f4\u4fbf\u5229\u7684\u5199\u6cd5\uff0c\u5b9e\u9645\u4e0a\u5b83\u4eec\u7684\u6548\u679c\u57fa\u672c\u4e0a\u662f\u4e00\u81f4\u7684\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"alternatives",children:"alternatives"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"alternatives"})," \u51fd\u6570\u8868\u793a\u5728\u4e0d\u540c\u7684 subslides \u4e2d\u5c55\u793a\u4e00\u7cfb\u5217\u4e0d\u540c\u7684\u5185\u5bb9\uff0c\u4f8b\u5982"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:"#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #alternatives[Ann][Bob][Christopher]\n likes\n #alternatives[chocolate][strawberry][vanilla]\n ice cream.\n])\n"})}),"\n",(0,c.jsxs)(n.p,{children:["\u5982\u4f60\u6240\u89c1\uff0c",(0,c.jsx)(n.code,{children:"alternatives"})," \u80fd\u591f\u81ea\u52a8\u6491\u5f00\u5230\u6700\u5408\u9002\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\uff0c\u8fd9\u662f ",(0,c.jsx)(n.code,{children:"only"})," \u548c ",(0,c.jsx)(n.code,{children:"uncover"})," \u6240\u6ca1\u6709\u7684\u80fd\u529b\u3002\u4e8b\u5b9e\u4e0a ",(0,c.jsx)(n.code,{children:"alternatives"})," \u8fd8\u6709\u7740\u5176\u4ed6\u53c2\u6570\uff0c\u4f8b\u5982 ",(0,c.jsx)(n.code,{children:"start: 2"}),"\u3001",(0,c.jsx)(n.code,{children:"repeat-last: true"})," \u548c ",(0,c.jsx)(n.code,{children:"position: center + horizon"})," \u7b49\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/alternatives.html",children:"Polylux"}),"\u3002"]})]})}function h(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>i});var c=s(7294);const l={},d=c.createContext(l);function i(e){const n=c.useContext(d);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:i(e.components),c.createElement(d.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/737adc8d.db2503f5.js b/zh/assets/js/737adc8d.db2503f5.js new file mode 100644 index 000000000..f88ed3853 --- /dev/null +++ b/zh/assets/js/737adc8d.db2503f5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6633],{7652:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>t,contentTitle:()=>d,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>r});var c=s(5893),i=s(1151);const l={sidebar_position:2},d="\u590d\u6742\u52a8\u753b",o={id:"dynamic/complex",title:"\u590d\u6742\u52a8\u753b",description:"\u5f97\u76ca\u4e8e Polylux \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 only\u3001uncover \u548c alternatives\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/complex.md",sourceDirName:"dynamic",slug:"/dynamic/complex",permalink:"/touying/zh/docs/dynamic/complex",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/complex.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\u7b80\u5355\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/simple"},next:{title:"\u6570\u5b66\u516c\u5f0f\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/equation"}},t={},r=[{value:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",id:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",level:2},{value:"only",id:"only",level:2},{value:"uncover",id:"uncover",level:2},{value:"alternatives",id:"alternatives",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.h1,{id:"\u590d\u6742\u52a8\u753b",children:"\u590d\u6742\u52a8\u753b"}),"\n",(0,c.jsxs)(n.p,{children:["\u5f97\u76ca\u4e8e ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/syntax.html",children:"Polylux"})," \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"}),"\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570",children:"\u56de\u8c03\u98ce\u683c\u7684\u51fd\u6570"}),"\n",(0,c.jsxs)(n.p,{children:["\u4e3a\u4e86\u907f\u514d\u4e0a\u6587\u63d0\u5230\u7684 ",(0,c.jsx)(n.code,{children:"styled"})," \u4e0e ",(0,c.jsx)(n.code,{children:"layout"})," \u9650\u5236\uff0cTouying \u5229\u7528\u56de\u8c03\u51fd\u6570\u5de7\u5999\u5b9e\u73b0\u4e86\u603b\u662f\u80fd\u751f\u6548\u7684 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"}),"\uff0c\u5177\u4f53\u6765\u8bf4\uff0c\u60a8\u8981\u8fd9\u6837\u5f15\u5165\u8fd9\u4e09\u4e2a\u51fd\u6570\uff1a"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n In subslide #self.subslide,\n\n test #uncover("2-")[uncover] function,\n\n and test #only("2-")[only] function,\n\n #pause\n\n and paused text.\n])\n'})}),"\n",(0,c.jsx)(n.p,{children:(0,c.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/e9a6b8c5-daf0-4cf2-8d39-1a768ce1dfea",alt:"image"})}),"\n",(0,c.jsxs)(n.p,{children:["\u6ce8\u610f\u5230\u4e86\u5417\uff1f\u6211\u4eec\u4e0d\u518d\u662f\u4f20\u5165\u4e00\u4e2a\u5185\u5bb9\u5757\uff0c\u800c\u662f\u4f20\u5165\u4e86\u4e00\u4e2a\u53c2\u6570\u4e3a ",(0,c.jsx)(n.code,{children:"self"})," \u7684\u56de\u8c03\u51fd\u6570\uff0c\u968f\u540e\u6211\u4eec\u901a\u8fc7"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:"#let (uncover, only, alternatives) = utils.methods(self)\n"})}),"\n",(0,c.jsxs)(n.p,{children:["\u4ece ",(0,c.jsx)(n.code,{children:"self"})," \u4e2d\u53d6\u51fa\u4e86 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u8fd9\u4e09\u4e2a\u51fd\u6570\uff0c\u5e76\u5728\u540e\u7eed\u8c03\u7528\u5b83\u4eec\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e9b\u6709\u8da3\u7684\u4e8b\u5b9e\uff0c\u4f8b\u5982 int \u7c7b\u578b\u7684 ",(0,c.jsx)(n.code,{children:"self.subslide"})," \u6307\u793a\u4e86\u5f53\u524d subslide \u7d22\u5f15\uff0c\u800c\u5b9e\u9645\u4e0a ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u51fd\u6570\u4e5f\u6b63\u662f\u4f9d\u8d56 ",(0,c.jsx)(n.code,{children:"self.subslide"})," \u5b9e\u73b0\u7684\u83b7\u53d6\u5f53\u524d subslide \u7d22\u5f15\u3002"]}),"\n",(0,c.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,c.jsxs)(n.p,{children:["\u6211\u4eec\u624b\u52a8\u6307\u5b9a\u4e86\u53c2\u6570 ",(0,c.jsx)(n.code,{children:"repeat: 3"}),"\uff0c\u8fd9\u4ee3\u8868\u7740\u663e\u793a 3 \u5f20 subslides\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6307\u5b9a\u662f\u56e0\u4e3a Touying \u65e0\u6cd5\u63a2\u77e5 ",(0,c.jsx)(n.code,{children:"only"}),"\u3001",(0,c.jsx)(n.code,{children:"uncover"})," \u548c ",(0,c.jsx)(n.code,{children:"alternatives"})," \u9700\u8981\u663e\u793a\u591a\u5c11\u5f20 subslides\u3002"]})}),"\n",(0,c.jsx)(n.h2,{id:"only",children:"only"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"only"})," \u51fd\u6570\u8868\u793a\u53ea\u5728\u9009\u5b9a\u7684 subslides \u4e2d\u300c\u51fa\u73b0\u300d\uff0c\u5982\u679c\u4e0d\u51fa\u73b0\uff0c\u5219\u4f1a\u5b8c\u5168\u6d88\u5931\uff0c\u4e5f\u4e0d\u4f1a\u5360\u636e\u4efb\u4f55\u7a7a\u95f4\u3002\u4e5f\u5373 ",(0,c.jsx)(n.code,{children:"#only(index, body)"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"body"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"none"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u5176\u4e2d index \u53ef\u4ee5\u662f int \u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u662f ",(0,c.jsx)(n.code,{children:'"2-"'})," \u6216 ",(0,c.jsx)(n.code,{children:'"2-3"'})," \u8fd9\u6837\u7684 str \u7c7b\u578b\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"uncover",children:"uncover"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"uncover"})," \u51fd\u6570\u8868\u793a\u53ea\u5728\u9009\u5b9a\u7684 subslides \u4e2d\u300c\u663e\u793a\u300d\uff0c\u5426\u5219\u4f1a\u88ab ",(0,c.jsx)(n.code,{children:"cover"})," \u51fd\u6570\u906e\u6321\uff0c\u4f46\u4ecd\u4f1a\u5360\u636e\u539f\u6709\u3002\u4e5f\u5373 ",(0,c.jsx)(n.code,{children:"#uncover(index, body)"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"body"})," \u8981\u4e48\u4e3a ",(0,c.jsx)(n.code,{children:"cover(body)"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u5176\u4e2d index \u53ef\u4ee5\u662f int \u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u662f ",(0,c.jsx)(n.code,{children:'"2-"'})," \u6216 ",(0,c.jsx)(n.code,{children:'"2-3"'})," \u8fd9\u6837\u7684 str \u7c7b\u578b\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/complex.html",children:"Polylux"}),"\u3002"]}),"\n",(0,c.jsxs)(n.p,{children:["\u60a8\u5e94\u8be5\u4e5f\u6ce8\u610f\u5230\u4e86\uff0c\u4e8b\u5b9e\u4e0a ",(0,c.jsx)(n.code,{children:"#pause"})," \u4e5f\u4f7f\u7528\u4e86 ",(0,c.jsx)(n.code,{children:"cover"})," \u51fd\u6570\uff0c\u53ea\u662f\u63d0\u4f9b\u4e86\u66f4\u4fbf\u5229\u7684\u5199\u6cd5\uff0c\u5b9e\u9645\u4e0a\u5b83\u4eec\u7684\u6548\u679c\u57fa\u672c\u4e0a\u662f\u4e00\u81f4\u7684\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"alternatives",children:"alternatives"}),"\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"alternatives"})," \u51fd\u6570\u8868\u793a\u5728\u4e0d\u540c\u7684 subslides \u4e2d\u5c55\u793a\u4e00\u7cfb\u5217\u4e0d\u540c\u7684\u5185\u5bb9\uff0c\u4f8b\u5982"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-typst",children:"#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n #alternatives[Ann][Bob][Christopher]\n likes\n #alternatives[chocolate][strawberry][vanilla]\n ice cream.\n])\n"})}),"\n",(0,c.jsx)(n.p,{children:(0,c.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/392707ea-0bcd-426b-b232-5bc63b9a13a3",alt:"image"})}),"\n",(0,c.jsxs)(n.p,{children:["\u5982\u4f60\u6240\u89c1\uff0c",(0,c.jsx)(n.code,{children:"alternatives"})," \u80fd\u591f\u81ea\u52a8\u6491\u5f00\u5230\u6700\u5408\u9002\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\uff0c\u8fd9\u662f ",(0,c.jsx)(n.code,{children:"only"})," \u548c ",(0,c.jsx)(n.code,{children:"uncover"})," \u6240\u6ca1\u6709\u7684\u80fd\u529b\u3002\u4e8b\u5b9e\u4e0a ",(0,c.jsx)(n.code,{children:"alternatives"})," \u8fd8\u6709\u7740\u5176\u4ed6\u53c2\u6570\uff0c\u4f8b\u5982 ",(0,c.jsx)(n.code,{children:"start: 2"}),"\u3001",(0,c.jsx)(n.code,{children:"repeat-last: true"})," \u548c ",(0,c.jsx)(n.code,{children:"position: center + horizon"})," \u7b49\uff0c\u66f4\u591a\u7528\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,c.jsx)(n.a,{href:"https://polylux.dev/book/dynamic/alternatives.html",children:"Polylux"}),"\u3002"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>d});var c=s(7294);const i={},l=c.createContext(i);function d(e){const n=c.useContext(l);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),c.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/8c4e5360.5fdc98ba.js b/zh/assets/js/8c4e5360.5fdc98ba.js deleted file mode 100644 index 96ac8407a..000000000 --- a/zh/assets/js/8c4e5360.5fdc98ba.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[438],{7297:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>d,metadata:()=>o,toc:()=>h});var n=i(5893),s=i(1151);const d={sidebar_position:2},r="Fit to height / width",o={id:"utilities/fit-to",title:"Fit to height / width",description:"\u611f\u8c22 ntjess \u7684\u4ee3\u7801\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/utilities/fit-to.md",sourceDirName:"utilities",slug:"/utilities/fit-to",permalink:"/touying/zh/docs/utilities/fit-to",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/utilities/fit-to.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b",permalink:"/touying/zh/docs/utilities/oop"},next:{title:"External Tools",permalink:"/touying/zh/docs/category/external-tools"}},c={},h=[{value:"Fit to height",id:"fit-to-height",level:2},{value:"Fit to width",id:"fit-to-width",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"fit-to-height--width",children:"Fit to height / width"}),"\n",(0,n.jsxs)(t.p,{children:["\u611f\u8c22 ",(0,n.jsx)(t.a,{href:"https://github.com/ntjess",children:"ntjess"})," \u7684\u4ee3\u7801\u3002"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-height",children:"Fit to height"}),"\n",(0,n.jsxs)(t.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u5c06\u56fe\u7247\u5360\u6ee1\u5269\u4f59\u7684 slide \u9ad8\u5ea6\uff0c\u4f60\u53ef\u4ee5\u6765\u8bd5\u8bd5 ",(0,n.jsx)(t.code,{children:"fit-to-height"})," \u51fd\u6570\uff1a"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#fit-to-height(1fr)[BIG]\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u51fd\u6570\u5b9a\u4e49\uff1a"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-height(\n width: none, prescale-width: none, grow: true, shrink: true, height, body\n) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u53c2\u6570\uff1a"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": \u5982\u679c\u6307\u5b9a\uff0c\u8fd9\u5c06\u786e\u5b9a\u7f29\u653e\u540e\u5185\u5bb9\u7684\u5bbd\u5ea6\u3002\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u7f29\u653e\u7684\u5185\u5bb9\u586b\u5145\u5e7b\u706f\u7247\u5bbd\u5ea6\u7684\u4e00\u534a\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(t.code,{children:"width: 50%"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"prescale-width"}),": \u6b64\u53c2\u6570\u5141\u8bb8\u60a8\u4f7f Typst \u7684\u5e03\u5c40\u5047\u8bbe\u7ed9\u5b9a\u7684\u5185\u5bb9\u5728\u7f29\u653e\u4e4b\u524d\u8981\u5e03\u5c40\u5728\u4e00\u5b9a\u5bbd\u5ea6\u7684\u5bb9\u5668\u4e2d\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(t.code,{children:"prescale-width: 200%"})," \u5047\u8bbe\u5e7b\u706f\u7247\u7684\u5bbd\u5ea6\u4e3a\u539f\u6765\u7684\u4e24\u500d\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": \u662f\u5426\u53ef\u6269\u5f20\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": \u662f\u5426\u53ef\u6536\u7f29\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"height"}),": \u9700\u8981\u6307\u5b9a\u7684\u9ad8\u5ea6\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": \u5177\u4f53\u7684\u5185\u5bb9\u3002"]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-width",children:"Fit to width"}),"\n",(0,n.jsxs)(t.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u9650\u5236\u6807\u9898\u5bbd\u5ea6\u521a\u597d\u5360\u6ee1 slide \u7684\u5bbd\u5ea6\uff0c\u4f60\u53ef\u4ee5\u6765\u8bd5\u8bd5 ",(0,n.jsx)(t.code,{children:"fit-to-width"})," \u51fd\u6570\uff1a"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#fit-to-width(1fr)[#lorem(20)]\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u51fd\u6570\u5b9a\u4e49\uff1a"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-width(grow: true, shrink: true, width, body) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u53c2\u6570\uff1a"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": \u662f\u5426\u53ef\u6269\u5f20\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": \u662f\u5426\u53ef\u6536\u7f29\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": \u9700\u8981\u6307\u5b9a\u7684\u5bbd\u5ea6\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": \u5177\u4f53\u7684\u5185\u5bb9\u3002"]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,i)=>{i.d(t,{Z:()=>o,a:()=>r});var n=i(7294);const s={},d=n.createContext(s);function r(e){const t=n.useContext(d);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(d.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/8c4e5360.c486956f.js b/zh/assets/js/8c4e5360.c486956f.js new file mode 100644 index 000000000..e52ac500b --- /dev/null +++ b/zh/assets/js/8c4e5360.c486956f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[438],{7297:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>d,metadata:()=>o,toc:()=>l});var n=i(5893),s=i(1151);const d={sidebar_position:2},r="Fit to height / width",o={id:"utilities/fit-to",title:"Fit to height / width",description:"\u611f\u8c22 ntjess \u7684\u4ee3\u7801\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/utilities/fit-to.md",sourceDirName:"utilities",slug:"/utilities/fit-to",permalink:"/touying/zh/docs/utilities/fit-to",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/utilities/fit-to.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b",permalink:"/touying/zh/docs/utilities/oop"},next:{title:"External Tools",permalink:"/touying/zh/docs/category/external-tools"}},c={},l=[{value:"Fit to height",id:"fit-to-height",level:2},{value:"Fit to width",id:"fit-to-width",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"fit-to-height--width",children:"Fit to height / width"}),"\n",(0,n.jsxs)(t.p,{children:["\u611f\u8c22 ",(0,n.jsx)(t.a,{href:"https://github.com/ntjess",children:"ntjess"})," \u7684\u4ee3\u7801\u3002"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-height",children:"Fit to height"}),"\n",(0,n.jsxs)(t.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u5c06\u56fe\u7247\u5360\u6ee1\u5269\u4f59\u7684 slide \u9ad8\u5ea6\uff0c\u4f60\u53ef\u4ee5\u6765\u8bd5\u8bd5 ",(0,n.jsx)(t.code,{children:"fit-to-height"})," \u51fd\u6570\uff1a"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#utils.fit-to-height(1fr)[BIG]\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u51fd\u6570\u5b9a\u4e49\uff1a"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-height(\n width: none, prescale-width: none, grow: true, shrink: true, height, body\n) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u53c2\u6570\uff1a"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": \u5982\u679c\u6307\u5b9a\uff0c\u8fd9\u5c06\u786e\u5b9a\u7f29\u653e\u540e\u5185\u5bb9\u7684\u5bbd\u5ea6\u3002\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u7f29\u653e\u7684\u5185\u5bb9\u586b\u5145\u5e7b\u706f\u7247\u5bbd\u5ea6\u7684\u4e00\u534a\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(t.code,{children:"width: 50%"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"prescale-width"}),": \u6b64\u53c2\u6570\u5141\u8bb8\u60a8\u4f7f Typst \u7684\u5e03\u5c40\u5047\u8bbe\u7ed9\u5b9a\u7684\u5185\u5bb9\u5728\u7f29\u653e\u4e4b\u524d\u8981\u5e03\u5c40\u5728\u4e00\u5b9a\u5bbd\u5ea6\u7684\u5bb9\u5668\u4e2d\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(t.code,{children:"prescale-width: 200%"})," \u5047\u8bbe\u5e7b\u706f\u7247\u7684\u5bbd\u5ea6\u4e3a\u539f\u6765\u7684\u4e24\u500d\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": \u662f\u5426\u53ef\u6269\u5f20\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": \u662f\u5426\u53ef\u6536\u7f29\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"height"}),": \u9700\u8981\u6307\u5b9a\u7684\u9ad8\u5ea6\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": \u5177\u4f53\u7684\u5185\u5bb9\u3002"]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"fit-to-width",children:"Fit to width"}),"\n",(0,n.jsxs)(t.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u9650\u5236\u6807\u9898\u5bbd\u5ea6\u521a\u597d\u5360\u6ee1 slide \u7684\u5bbd\u5ea6\uff0c\u4f60\u53ef\u4ee5\u6765\u8bd5\u8bd5 ",(0,n.jsx)(t.code,{children:"fit-to-width"})," \u51fd\u6570\uff1a"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#utils.fit-to-width(1fr)[#lorem(20)]\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u51fd\u6570\u5b9a\u4e49\uff1a"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#let fit-to-width(grow: true, shrink: true, width, body) = { .. }\n"})}),"\n",(0,n.jsx)(t.p,{children:"\u53c2\u6570\uff1a"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"grow"}),": \u662f\u5426\u53ef\u6269\u5f20\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"shrink"}),": \u662f\u5426\u53ef\u6536\u7f29\uff0c\u9ed8\u8ba4\u4e3a ",(0,n.jsx)(t.code,{children:"true"}),"\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"width"}),": \u9700\u8981\u6307\u5b9a\u7684\u5bbd\u5ea6\u3002"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"body"}),": \u5177\u4f53\u7684\u5185\u5bb9\u3002"]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},1151:(e,t,i)=>{i.d(t,{Z:()=>o,a:()=>r});var n=i(7294);const s={},d=n.createContext(s);function r(e){const t=n.useContext(d);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(d.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/935f2afb.3ba91ffb.js b/zh/assets/js/935f2afb.8fd5cac2.js similarity index 88% rename from zh/assets/js/935f2afb.3ba91ffb.js rename to zh/assets/js/935f2afb.8fd5cac2.js index c5d000eb2..b6ec0e035 100644 --- a/zh/assets/js/935f2afb.3ba91ffb.js +++ b/zh/assets/js/935f2afb.8fd5cac2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Touying \u4ecb\u7ecd","href":"/touying/zh/docs/intro","docId":"intro","unlisted":false},{"type":"link","label":"\u5f00\u59cb","href":"/touying/zh/docs/start","docId":"start","unlisted":false},{"type":"link","label":"\u6392\u7bc7\u5e03\u5c40","href":"/touying/zh/docs/layout","docId":"layout","unlisted":false},{"type":"link","label":"\u4ee3\u7801\u98ce\u683c","href":"/touying/zh/docs/style","docId":"style","unlisted":false},{"type":"category","label":"Dynamic Slides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"\u7b80\u5355\u52a8\u753b","href":"/touying/zh/docs/dynamic/simple","docId":"dynamic/simple","unlisted":false},{"type":"link","label":"\u590d\u6742\u52a8\u753b","href":"/touying/zh/docs/dynamic/complex","docId":"dynamic/complex","unlisted":false},{"type":"link","label":"\u6570\u5b66\u516c\u5f0f\u52a8\u753b","href":"/touying/zh/docs/dynamic/equation","docId":"dynamic/equation","unlisted":false},{"type":"link","label":"Cover \u51fd\u6570","href":"/touying/zh/docs/dynamic/cover","docId":"dynamic/cover","unlisted":false},{"type":"link","label":"\u521b\u5efa\u8bb2\u4e49","href":"/touying/zh/docs/dynamic/handout","docId":"dynamic/handout","unlisted":false}],"href":"/touying/zh/docs/category/dynamic-slides"},{"type":"category","label":"Themes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple \u4e3b\u9898","href":"/touying/zh/docs/themes/simple","docId":"themes/simple","unlisted":false},{"type":"link","label":"Metropolis \u4e3b\u9898","href":"/touying/zh/docs/themes/metropolis","docId":"themes/metropolis","unlisted":false},{"type":"link","label":"Dewdrop \u4e3b\u9898","href":"/touying/zh/docs/themes/dewdrop","docId":"themes/dewdrop","unlisted":false}],"href":"/touying/zh/docs/category/themes"},{"type":"link","label":"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898","href":"/touying/zh/docs/build-your-own-theme","docId":"build-your-own-theme","unlisted":false},{"type":"category","label":"Progress","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Touying \u7684\u8ba1\u6570\u5668","href":"/touying/zh/docs/progress/counters","docId":"progress/counters","unlisted":false},{"type":"link","label":"Touying \u7684 Sections","href":"/touying/zh/docs/progress/sections","docId":"progress/sections","unlisted":false}],"href":"/touying/zh/docs/category/progress"},{"type":"category","label":"Utilities","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b","href":"/touying/zh/docs/utilities/oop","docId":"utilities/oop","unlisted":false},{"type":"link","label":"Fit to height / width","href":"/touying/zh/docs/utilities/fit-to","docId":"utilities/fit-to","unlisted":false}],"href":"/touying/zh/docs/category/utilities"},{"type":"category","label":"External Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"pdfpc","href":"/touying/zh/docs/external/pdfpc","docId":"external/pdfpc","unlisted":false},{"type":"link","label":"Typst Preview","href":"/touying/zh/docs/external/typst-preview","docId":"external/typst-preview","unlisted":false}],"href":"/touying/zh/docs/category/external-tools"},{"type":"link","label":"\u66f4\u65b0\u65e5\u5fd7","href":"/touying/zh/docs/changelog","docId":"changelog","unlisted":false}]},"docs":{"build-your-own-theme":{"id":"build-your-own-theme","title":"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898","description":"\u60a8\u53ef\u4ee5\u53c2\u8003 \u4e3b\u9898\u7684\u6e90\u4ee3\u7801\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"\u66f4\u65b0\u65e5\u5fd7","description":"v0.2.0","sidebar":"tutorialSidebar"},"dynamic/complex":{"id":"dynamic/complex","title":"\u590d\u6742\u52a8\u753b","description":"\u5f97\u76ca\u4e8e Polylux \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 only\u3001uncover \u548c alternatives\u3002","sidebar":"tutorialSidebar"},"dynamic/cover":{"id":"dynamic/cover","title":"Cover \u51fd\u6570","description":"\u6b63\u5982\u60a8\u5df2\u7ecf\u4e86\u89e3\u7684\u90a3\u6837\uff0cuncover \u548c #pause \u5747\u4f1a\u4f7f\u7528 cover \u51fd\u6570\u5bf9\u4e0d\u663e\u793a\u7684\u5185\u5bb9\u8fdb\u884c\u906e\u76d6\u3002\u90a3\u4e48\uff0c\u8fd9\u91cc\u7684 cover \u51fd\u6570\u7a76\u7adf\u662f\u4ec0\u4e48\u5462\uff1f","sidebar":"tutorialSidebar"},"dynamic/equation":{"id":"dynamic/equation","title":"\u6570\u5b66\u516c\u5f0f\u52a8\u753b","description":"Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 pause \u548c meanwhile\u3002","sidebar":"tutorialSidebar"},"dynamic/handout":{"id":"dynamic/handout","title":"\u521b\u5efa\u8bb2\u4e49","description":"\u5728\u770b\u5e7b\u706f\u7247\u3001\u542c\u8bfe\u7684\u540c\u65f6\uff0c\u542c\u4f17\u5f80\u5f80\u4f1a\u5e0c\u671b\u6709\u4e00\u4e2a\u8bb2\u4e49\uff0c\u4ee5\u4fbf\u80fd\u591f\u56de\u987e\u7406\u89e3\u56f0\u96be\u7684\u5730\u65b9\uff0c\u6240\u4ee5\uff0c\u4f5c\u8005\u6700\u597d\u80fd\u7ed9\u542c\u4f17\u63d0\u4f9b\u8fd9\u6837\u4e00\u4efd\u8bb2\u4e49\uff0c\u5982\u679c\u80fd\u5728\u542c\u8bfe\u524d\u63d0\u4f9b\u66f4\u597d\u3002","sidebar":"tutorialSidebar"},"dynamic/simple":{"id":"dynamic/simple","title":"\u7b80\u5355\u52a8\u753b","description":"Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a#pause \u548c #meanwhile\u3002","sidebar":"tutorialSidebar"},"external/pdfpc":{"id":"external/pdfpc","title":"pdfpc","description":"pdfpc \u662f\u4e00\u4e2a \\"\u5bf9 PDF \u6587\u6863\u5177\u6709\u591a\u663e\u793a\u5668\u652f\u6301\u7684\u6f14\u793a\u8005\u63a7\u5236\u53f0\\"\u3002\u8fd9\u610f\u5473\u7740\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u4ee5 PDF \u9875\u9762\u7684\u5f62\u5f0f\u663e\u793a\u5e7b\u706f\u7247\uff0c\u5e76\u4e14\u8fd8\u5177\u6709\u4e00\u4e9b\u5df2\u77e5\u7684\u51fa\u8272\u529f\u80fd\uff0c\u5c31\u50cf PowerPoint \u4e00\u6837\u3002","sidebar":"tutorialSidebar"},"external/typst-preview":{"id":"external/typst-preview","title":"Typst Preview","description":"VS Code \u7684 Typst Preview \u63d2\u4ef6\u63d0\u4f9b\u4e86\u4f18\u79c0\u7684 slide mode\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u5176\u9884\u89c8\u548c\u653e\u6620 slides\u3002","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Touying \u4ecb\u7ecd","description":"Touying \u662f\u4e3a Typst \u5f00\u53d1\u7684\u5e7b\u706f\u7247/\u6f14\u793a\u6587\u7a3f\u5305\uff0c\u5728 Polylux \u7684\u57fa\u7840\u4e0a\u5f00\u53d1\u800c\u6765\u3002Touying \u4e5f\u7c7b\u4f3c\u4e8e LaTeX \u7684 Beamer\uff0c\u4f46\u662f\u5f97\u76ca\u4e8e Typst\uff0c\u4f60\u53ef\u4ee5\u62e5\u6709\u66f4\u5feb\u7684\u6e32\u67d3\u901f\u5ea6\u4e0e\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u3002\u540e\u9762\uff0c\u6211\u4eec\u4f1a\u4f7f\u7528 slides \u6307\u4ee3\u5e7b\u706f\u7247\uff0cslide \u6307\u4ee3\u5355\u5f20\u5e7b\u706f\u7247\uff0csubslide \u6307\u4ee3\u5b50\u5e7b\u706f\u7247\u3002","sidebar":"tutorialSidebar"},"layout":{"id":"layout","title":"\u6392\u7bc7\u5e03\u5c40","description":"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002","sidebar":"tutorialSidebar"},"progress/counters":{"id":"progress/counters","title":"Touying \u7684\u8ba1\u6570\u5668","description":"Touying \u7684\u72b6\u6001\u5747\u653e\u7f6e\u4e8e states \u547d\u540d\u7a7a\u95f4\u4e0b\uff0c\u5305\u62ec\u6240\u6709\u7684\u8ba1\u6570\u5668\u3002","sidebar":"tutorialSidebar"},"progress/sections":{"id":"progress/sections","title":"Touying \u7684 Sections","description":"Touying \u7ef4\u62a4\u4e86\u4e00\u4efd\u81ea\u5df1\u7684 sections state\uff0c\u7528\u4e8e\u8bb0\u5f55 slides \u7684 sections \u548c subsections\u3002","sidebar":"tutorialSidebar"},"start":{"id":"start","title":"\u5f00\u59cb","description":"\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 Web App \u6216 VS Code \u7684 Typst LSP \u548c Typst Preview \u63d2\u4ef6\u3002","sidebar":"tutorialSidebar"},"style":{"id":"style","title":"\u4ee3\u7801\u98ce\u683c","description":"show-slides \u98ce\u683c","sidebar":"tutorialSidebar"},"themes/dewdrop":{"id":"themes/dewdrop","title":"Dewdrop \u4e3b\u9898","description":"\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Zhibo Wang \u521b\u4f5c\u7684 BeamerTheme\uff0c\u7531 OrangeX4 \u6539\u9020\u800c\u6765\u3002","sidebar":"tutorialSidebar"},"themes/metropolis":{"id":"themes/metropolis","title":"Metropolis \u4e3b\u9898","description":"\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Matthias Vogelgesang \u521b\u4f5c\u7684 Metropolis beamer \u4e3b\u9898\uff0c\u7531 Enivex \u6539\u9020\u800c\u6765\u3002","sidebar":"tutorialSidebar"},"themes/simple":{"id":"themes/simple","title":"Simple \u4e3b\u9898","description":"\u8fd9\u4e2a\u4e3b\u9898\u6765\u6e90\u4e8e Polylux\uff0c\u4f5c\u8005\u662f Andreas Kr\xf6pelin\u3002","sidebar":"tutorialSidebar"},"utilities/fit-to":{"id":"utilities/fit-to","title":"Fit to height / width","description":"\u611f\u8c22 ntjess \u7684\u4ee3\u7801\u3002","sidebar":"tutorialSidebar"},"utilities/oop":{"id":"utilities/oop","title":"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b","description":"Touying \u63d0\u4f9b\u4e86\u4e00\u4e9b\u4fbf\u5229\u7684\u5de5\u5177\u51fd\u6570\uff0c\u4fbf\u4e8e\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Touying \u4ecb\u7ecd","href":"/touying/zh/docs/intro","docId":"intro","unlisted":false},{"type":"link","label":"\u5f00\u59cb","href":"/touying/zh/docs/start","docId":"start","unlisted":false},{"type":"link","label":"\u6392\u7bc7\u5e03\u5c40","href":"/touying/zh/docs/layout","docId":"layout","unlisted":false},{"type":"link","label":"\u4ee3\u7801\u98ce\u683c","href":"/touying/zh/docs/style","docId":"style","unlisted":false},{"type":"category","label":"Dynamic Slides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"\u7b80\u5355\u52a8\u753b","href":"/touying/zh/docs/dynamic/simple","docId":"dynamic/simple","unlisted":false},{"type":"link","label":"\u590d\u6742\u52a8\u753b","href":"/touying/zh/docs/dynamic/complex","docId":"dynamic/complex","unlisted":false},{"type":"link","label":"\u6570\u5b66\u516c\u5f0f\u52a8\u753b","href":"/touying/zh/docs/dynamic/equation","docId":"dynamic/equation","unlisted":false},{"type":"link","label":"Cover \u51fd\u6570","href":"/touying/zh/docs/dynamic/cover","docId":"dynamic/cover","unlisted":false},{"type":"link","label":"\u521b\u5efa\u8bb2\u4e49","href":"/touying/zh/docs/dynamic/handout","docId":"dynamic/handout","unlisted":false}],"href":"/touying/zh/docs/category/dynamic-slides"},{"type":"category","label":"Themes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Simple \u4e3b\u9898","href":"/touying/zh/docs/themes/simple","docId":"themes/simple","unlisted":false},{"type":"link","label":"Metropolis \u4e3b\u9898","href":"/touying/zh/docs/themes/metropolis","docId":"themes/metropolis","unlisted":false},{"type":"link","label":"Dewdrop \u4e3b\u9898","href":"/touying/zh/docs/themes/dewdrop","docId":"themes/dewdrop","unlisted":false}],"href":"/touying/zh/docs/category/themes"},{"type":"link","label":"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898","href":"/touying/zh/docs/build-your-own-theme","docId":"build-your-own-theme","unlisted":false},{"type":"category","label":"Progress","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Touying \u7684\u8ba1\u6570\u5668","href":"/touying/zh/docs/progress/counters","docId":"progress/counters","unlisted":false},{"type":"link","label":"Touying \u7684 Sections","href":"/touying/zh/docs/progress/sections","docId":"progress/sections","unlisted":false}],"href":"/touying/zh/docs/category/progress"},{"type":"category","label":"Utilities","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b","href":"/touying/zh/docs/utilities/oop","docId":"utilities/oop","unlisted":false},{"type":"link","label":"Fit to height / width","href":"/touying/zh/docs/utilities/fit-to","docId":"utilities/fit-to","unlisted":false}],"href":"/touying/zh/docs/category/utilities"},{"type":"category","label":"External Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"pdfpc","href":"/touying/zh/docs/external/pdfpc","docId":"external/pdfpc","unlisted":false},{"type":"link","label":"Typst Preview","href":"/touying/zh/docs/external/typst-preview","docId":"external/typst-preview","unlisted":false}],"href":"/touying/zh/docs/category/external-tools"},{"type":"link","label":"\u66f4\u65b0\u65e5\u5fd7","href":"/touying/zh/docs/changelog","docId":"changelog","unlisted":false}]},"docs":{"build-your-own-theme":{"id":"build-your-own-theme","title":"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898","description":"\u60a8\u53ef\u4ee5\u53c2\u8003 \u4e3b\u9898\u7684\u6e90\u4ee3\u7801\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"\u66f4\u65b0\u65e5\u5fd7","description":"v0.2.0","sidebar":"tutorialSidebar"},"dynamic/complex":{"id":"dynamic/complex","title":"\u590d\u6742\u52a8\u753b","description":"\u5f97\u76ca\u4e8e Polylux \u63d0\u4f9b\u7684\u8bed\u6cd5\uff0c\u6211\u4eec\u540c\u6837\u80fd\u591f\u5728 Touying \u4e2d\u4f7f\u7528 only\u3001uncover \u548c alternatives\u3002","sidebar":"tutorialSidebar"},"dynamic/cover":{"id":"dynamic/cover","title":"Cover \u51fd\u6570","description":"\u6b63\u5982\u60a8\u5df2\u7ecf\u4e86\u89e3\u7684\u90a3\u6837\uff0cuncover \u548c #pause \u5747\u4f1a\u4f7f\u7528 cover \u51fd\u6570\u5bf9\u4e0d\u663e\u793a\u7684\u5185\u5bb9\u8fdb\u884c\u906e\u76d6\u3002\u90a3\u4e48\uff0c\u8fd9\u91cc\u7684 cover \u51fd\u6570\u7a76\u7adf\u662f\u4ec0\u4e48\u5462\uff1f","sidebar":"tutorialSidebar"},"dynamic/equation":{"id":"dynamic/equation","title":"\u6570\u5b66\u516c\u5f0f\u52a8\u753b","description":"Touying \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u72ec\u7279\u4e14\u5341\u5206\u6709\u7528\u7684\u529f\u80fd\uff0c\u5373\u6570\u5b66\u516c\u5f0f\u52a8\u753b\uff0c\u5b83\u8ba9\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u6570\u5b66\u516c\u5f0f\u91cc\u4f7f\u7528 pause \u548c meanwhile\u3002","sidebar":"tutorialSidebar"},"dynamic/handout":{"id":"dynamic/handout","title":"\u521b\u5efa\u8bb2\u4e49","description":"\u5728\u770b\u5e7b\u706f\u7247\u3001\u542c\u8bfe\u7684\u540c\u65f6\uff0c\u542c\u4f17\u5f80\u5f80\u4f1a\u5e0c\u671b\u6709\u4e00\u4e2a\u8bb2\u4e49\uff0c\u4ee5\u4fbf\u80fd\u591f\u56de\u987e\u7406\u89e3\u56f0\u96be\u7684\u5730\u65b9\uff0c\u6240\u4ee5\uff0c\u4f5c\u8005\u6700\u597d\u80fd\u7ed9\u542c\u4f17\u63d0\u4f9b\u8fd9\u6837\u4e00\u4efd\u8bb2\u4e49\uff0c\u5982\u679c\u80fd\u5728\u542c\u8bfe\u524d\u63d0\u4f9b\u66f4\u597d\u3002","sidebar":"tutorialSidebar"},"dynamic/simple":{"id":"dynamic/simple","title":"\u7b80\u5355\u52a8\u753b","description":"Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a#pause \u548c #meanwhile\u3002","sidebar":"tutorialSidebar"},"external/pdfpc":{"id":"external/pdfpc","title":"pdfpc","description":"pdfpc \u662f\u4e00\u4e2a \\"\u5bf9 PDF \u6587\u6863\u5177\u6709\u591a\u663e\u793a\u5668\u652f\u6301\u7684\u6f14\u793a\u8005\u63a7\u5236\u53f0\\"\u3002\u8fd9\u610f\u5473\u7740\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u4ee5 PDF \u9875\u9762\u7684\u5f62\u5f0f\u663e\u793a\u5e7b\u706f\u7247\uff0c\u5e76\u4e14\u8fd8\u5177\u6709\u4e00\u4e9b\u5df2\u77e5\u7684\u51fa\u8272\u529f\u80fd\uff0c\u5c31\u50cf PowerPoint \u4e00\u6837\u3002","sidebar":"tutorialSidebar"},"external/typst-preview":{"id":"external/typst-preview","title":"Typst Preview","description":"VS Code \u7684 Typst Preview \u63d2\u4ef6\u63d0\u4f9b\u4e86\u4f18\u79c0\u7684 slide mode\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u5176\u9884\u89c8\u548c\u653e\u6620 slides\u3002","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Touying \u4ecb\u7ecd","description":"Touying \u662f\u4e3a Typst \u5f00\u53d1\u7684\u5e7b\u706f\u7247/\u6f14\u793a\u6587\u7a3f\u5305\uff0c\u5728 Polylux \u7684\u57fa\u7840\u4e0a\u5f00\u53d1\u800c\u6765\u3002Touying \u4e5f\u7c7b\u4f3c\u4e8e LaTeX \u7684 Beamer\uff0c\u4f46\u662f\u5f97\u76ca\u4e8e Typst\uff0c\u4f60\u53ef\u4ee5\u62e5\u6709\u66f4\u5feb\u7684\u6e32\u67d3\u901f\u5ea6\u4e0e\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u3002\u540e\u9762\uff0c\u6211\u4eec\u4f1a\u4f7f\u7528 slides \u6307\u4ee3\u5e7b\u706f\u7247\uff0cslide \u6307\u4ee3\u5355\u5f20\u5e7b\u706f\u7247\uff0csubslide \u6307\u4ee3\u5b50\u5e7b\u706f\u7247\u3002","sidebar":"tutorialSidebar"},"layout":{"id":"layout","title":"\u6392\u7bc7\u5e03\u5c40","description":"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002","sidebar":"tutorialSidebar"},"progress/counters":{"id":"progress/counters","title":"Touying \u7684\u8ba1\u6570\u5668","description":"Touying \u7684\u72b6\u6001\u5747\u653e\u7f6e\u4e8e states \u547d\u540d\u7a7a\u95f4\u4e0b\uff0c\u5305\u62ec\u6240\u6709\u7684\u8ba1\u6570\u5668\u3002","sidebar":"tutorialSidebar"},"progress/sections":{"id":"progress/sections","title":"Touying \u7684 Sections","description":"Touying \u7ef4\u62a4\u4e86\u4e00\u4efd\u81ea\u5df1\u7684 sections state\uff0c\u7528\u4e8e\u8bb0\u5f55 slides \u7684 sections \u548c subsections\u3002","sidebar":"tutorialSidebar"},"start":{"id":"start","title":"\u5f00\u59cb","description":"\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 Web App \u6216 VS Code \u7684 Typst LSP \u548c Typst Preview \u63d2\u4ef6\u3002","sidebar":"tutorialSidebar"},"style":{"id":"style","title":"\u4ee3\u7801\u98ce\u683c","description":"show-slides \u98ce\u683c","sidebar":"tutorialSidebar"},"themes/dewdrop":{"id":"themes/dewdrop","title":"Dewdrop \u4e3b\u9898","description":"image","sidebar":"tutorialSidebar"},"themes/metropolis":{"id":"themes/metropolis","title":"Metropolis \u4e3b\u9898","description":"image","sidebar":"tutorialSidebar"},"themes/simple":{"id":"themes/simple","title":"Simple \u4e3b\u9898","description":"image","sidebar":"tutorialSidebar"},"utilities/fit-to":{"id":"utilities/fit-to","title":"Fit to height / width","description":"\u611f\u8c22 ntjess \u7684\u4ee3\u7801\u3002","sidebar":"tutorialSidebar"},"utilities/oop":{"id":"utilities/oop","title":"\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b","description":"Touying \u63d0\u4f9b\u4e86\u4e00\u4e9b\u4fbf\u5229\u7684\u5de5\u5177\u51fd\u6570\uff0c\u4fbf\u4e8e\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/zh/assets/js/b885bf58.675e4625.js b/zh/assets/js/b885bf58.675e4625.js new file mode 100644 index 000000000..17a83d774 --- /dev/null +++ b/zh/assets/js/b885bf58.675e4625.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9122],{2602:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>u,frontMatter:()=>d,metadata:()=>o,toc:()=>r});var i=s(5893),c=s(1151);const d={sidebar_position:1},t="\u7b80\u5355\u52a8\u753b",o={id:"dynamic/simple",title:"\u7b80\u5355\u52a8\u753b",description:"Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a#pause \u548c #meanwhile\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md",sourceDirName:"dynamic",slug:"/dynamic/simple",permalink:"/touying/zh/docs/dynamic/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Dynamic Slides",permalink:"/touying/zh/docs/category/dynamic-slides"},next:{title:"\u590d\u6742\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/complex"}},l={},r=[{value:"pause",id:"pause",level:2},{value:"meanwhile",id:"meanwhile",level:2},{value:"\u5982\u4f55\u5904\u7406 set-show rules?",id:"\u5982\u4f55\u5904\u7406-set-show-rules",level:2}];function a(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,c.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"pause",children:"pause"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"#pause"})," \u7684\u7528\u9014\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u7528\u4e8e\u5c06\u540e\u7eed\u7684\u5185\u5bb9\u653e\u5230\u4e0b\u4e00\u5f20 subslide \u4e2d\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a ",(0,i.jsx)(n.code,{children:"#pause"})," \u4ee5\u521b\u5efa\u591a\u5f20 subslides\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First #pause Second\n\n #pause\n\n Third\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a3bed1d3-e660-456d-8a54-a914436f43bf",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u4e2a\u4f8b\u5b50\u5c06\u4f1a\u521b\u5efa\u4e09\u5f20 subslides\uff0c\u9010\u6e10\u5730\u5c06\u5185\u5bb9\u5c55\u793a\u51fa\u6765\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u4f60\u6240\u89c1\uff0c",(0,i.jsx)(n.code,{children:"#pause"})," \u65e2\u53ef\u4ee5\u653e\u5728\u884c\u5185\uff0c\u4e5f\u53ef\u4ee5\u653e\u5728\u5355\u72ec\u7684\u4e00\u884c\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"meanwhile",children:"meanwhile"}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"#pause"})," \u7684\u540c\u65f6\u5c55\u793a\u4e00\u4e9b\u5176\u4ed6\u5185\u5bb9\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u7528 ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First\n \n #pause\n \n Second\n\n #meanwhile\n\n Third\n\n #pause\n\n Fourth\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/24ca19a3-b27c-4d31-ab75-09c37911e6ac",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:'\u8fd9\u4e2a\u4f8b\u5b50\u53ea\u4f1a\u521b\u5efa\u4e24\u5f20 subslides\uff0c\u5e76\u4e14 "First" \u548c "Third" \u540c\u65f6\u663e\u793a\uff0c"Second" \u548c "Fourth" \u540c\u65f6\u663e\u793a\u3002'}),"\n",(0,i.jsx)(n.h2,{id:"\u5982\u4f55\u5904\u7406-set-show-rules",children:"\u5982\u4f55\u5904\u7406 set-show rules?"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u5728 ",(0,i.jsx)(n.code,{children:"slide[..]"})," \u91cc\u9762\u4f7f\u7528\u4e86 set-show rules\uff0c\u4f60\u4f1a\u60ca\u8bb6\u7684\u53d1\u73b0\uff0c\u5728\u90a3\u4e4b\u540e\u7684 ",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"})," \u90fd\u5931\u6548\u4e86\u3002\u8fd9\u662f\u56e0\u4e3a Touying \u65e0\u6cd5\u63a2\u77e5 ",(0,i.jsx)(n.code,{children:"styled(..)"})," \u5185\u90e8\u7684\u5185\u5bb9\uff08set-show rules \u540e\u7684\u5185\u5bb9\u4f1a\u88ab ",(0,i.jsx)(n.code,{children:"styled"})," \u56ca\u62ec\u8d77\u6765\uff09\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cTouying \u4e3a ",(0,i.jsx)(n.code,{children:"#slide()"})," \u51fd\u6570\u63d0\u4f9b\u4e86\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"setting"})," \u53c2\u6570\uff0c\u4f60\u53ef\u4ee5\u5c06\u4f60\u7684 set-show rules \u653e\u5230 ",(0,i.jsx)(n.code,{children:"setting"})," \u53c2\u6570\u91cc\uff0c\u4f8b\u5982\u4fee\u6539\u5b57\u4f53\u989c\u8272\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(setting: body => {\n set text(fill: blue)\n body\n})[\n First\n \n #pause\n \n Second\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/8e31fc8a-5ab1-4181-a46a-fa96cf790dff",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u540c\u7406\uff0cTouying \u76ee\u524d\u4e5f\u4e0d\u652f\u6301 ",(0,i.jsx)(n.code,{children:"grid"})," \u8fd9\u7c7b layout \u51fd\u6570\u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\uff0c\u4e5f\u662f\u7531\u4e8e\u540c\u6837\u7684\u9650\u5236\uff0c\u4f46\u662f\u4f60\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"#slide()"})," \u7684 ",(0,i.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u90fd\u5e94\u8be5\u80fd\u6ee1\u8db3\u9700\u6c42\u3002"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u539f\u7406",type:"tip",children:(0,i.jsxs)(n.p,{children:["Touying \u4e0d\u4f9d\u8d56 ",(0,i.jsx)(n.code,{children:"counter"})," \u548c ",(0,i.jsx)(n.code,{children:"locate"})," \u6765\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"#pause"}),"\uff0c\u800c\u662f\u7528 Typst \u811a\u672c\u5199\u4e86\u4e00\u4e2a parser\u3002\u5b83\u4f1a\u5c06\u8f93\u5165\u5185\u5bb9\u5757\u4f5c\u4e3a sequence \u89e3\u6790\uff0c\u7136\u540e\u6539\u9020\u91cd\u7ec4\u8fd9\u4e2a sequence \u4e3a\u6211\u4eec\u9700\u8981\u7684\u4e00\u7cfb\u5217 subslides\u3002"]})})]})}function u(e={}){const{wrapper:n}={...(0,c.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:()=>o,a:()=>t});var i=s(7294);const c={},d=i.createContext(c);function t(e){const n=i.useContext(d);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:t(e.components),i.createElement(d.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/b885bf58.7923b84a.js b/zh/assets/js/b885bf58.7923b84a.js deleted file mode 100644 index 72d912748..000000000 --- a/zh/assets/js/b885bf58.7923b84a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9122],{2602:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>t,default:()=>u,frontMatter:()=>c,metadata:()=>l,toc:()=>r});var i=s(5893),d=s(1151);const c={sidebar_position:1},t="\u7b80\u5355\u52a8\u753b",l={id:"dynamic/simple",title:"\u7b80\u5355\u52a8\u753b",description:"Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a#pause \u548c #meanwhile\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/simple.md",sourceDirName:"dynamic",slug:"/dynamic/simple",permalink:"/touying/zh/docs/dynamic/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Dynamic Slides",permalink:"/touying/zh/docs/category/dynamic-slides"},next:{title:"\u590d\u6742\u52a8\u753b",permalink:"/touying/zh/docs/dynamic/complex"}},o={},r=[{value:"pause",id:"pause",level:2},{value:"meanwhile",id:"meanwhile",level:2},{value:"\u5982\u4f55\u5904\u7406 set-show rules?",id:"\u5982\u4f55\u5904\u7406-set-show-rules",level:2}];function a(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,d.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u4e3a\u7b80\u5355\u7684\u52a8\u753b\u6548\u679c\u63d0\u4f9b\u4e86\u4e24\u4e2a\u6807\u8bb0\uff1a",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"pause",children:"pause"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"#pause"})," \u7684\u7528\u9014\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u7528\u4e8e\u5c06\u540e\u7eed\u7684\u5185\u5bb9\u653e\u5230\u4e0b\u4e00\u5f20 subslide \u4e2d\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a ",(0,i.jsx)(n.code,{children:"#pause"})," \u4ee5\u521b\u5efa\u591a\u5f20 subslides\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First #pause Second\n\n #pause\n\n Third\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u4e2a\u4f8b\u5b50\u5c06\u4f1a\u521b\u5efa\u4e09\u5f20 subslides\uff0c\u9010\u6e10\u5730\u5c06\u5185\u5bb9\u5c55\u793a\u51fa\u6765\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u4f60\u6240\u89c1\uff0c",(0,i.jsx)(n.code,{children:"#pause"})," \u65e2\u53ef\u4ee5\u653e\u5728\u884c\u5185\uff0c\u4e5f\u53ef\u4ee5\u653e\u5728\u5355\u72ec\u7684\u4e00\u884c\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"meanwhile",children:"meanwhile"}),"\n",(0,i.jsxs)(n.p,{children:["\u6709\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5728 ",(0,i.jsx)(n.code,{children:"#pause"})," \u7684\u540c\u65f6\u5c55\u793a\u4e00\u4e9b\u5176\u4ed6\u5185\u5bb9\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u7528 ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First\n \n #pause\n \n Second\n\n #meanwhile\n\n Third\n\n #pause\n\n Fourth\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:'\u8fd9\u4e2a\u4f8b\u5b50\u53ea\u4f1a\u521b\u5efa\u4e24\u5f20 subslides\uff0c\u5e76\u4e14 "First" \u548c "Third" \u540c\u65f6\u663e\u793a\uff0c"Second" \u548c "Fourth" \u540c\u65f6\u663e\u793a\u3002'}),"\n",(0,i.jsx)(n.h2,{id:"\u5982\u4f55\u5904\u7406-set-show-rules",children:"\u5982\u4f55\u5904\u7406 set-show rules?"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u5728 ",(0,i.jsx)(n.code,{children:"slide[..]"})," \u91cc\u9762\u4f7f\u7528\u4e86 set-show rules\uff0c\u4f60\u4f1a\u60ca\u8bb6\u7684\u53d1\u73b0\uff0c\u5728\u90a3\u4e4b\u540e\u7684 ",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"})," \u90fd\u5931\u6548\u4e86\u3002\u8fd9\u662f\u56e0\u4e3a Touying \u65e0\u6cd5\u63a2\u77e5 ",(0,i.jsx)(n.code,{children:"styled(..)"})," \u5185\u90e8\u7684\u5185\u5bb9\uff08set-show rules \u540e\u7684\u5185\u5bb9\u4f1a\u88ab ",(0,i.jsx)(n.code,{children:"styled"})," \u56ca\u62ec\u8d77\u6765\uff09\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cTouying \u4e3a ",(0,i.jsx)(n.code,{children:"#slide()"})," \u51fd\u6570\u63d0\u4f9b\u4e86\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"setting"})," \u53c2\u6570\uff0c\u4f60\u53ef\u4ee5\u5c06\u4f60\u7684 set-show rules \u653e\u5230 ",(0,i.jsx)(n.code,{children:"setting"})," \u53c2\u6570\u91cc\uff0c\u4f8b\u5982\u4fee\u6539\u5b57\u4f53\u989c\u8272\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(setting: body => {\n set text(fill: blue)\n body\n})[\n First\n \n #pause\n \n Second\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u540c\u7406\uff0cTouying \u76ee\u524d\u4e5f\u4e0d\u652f\u6301 ",(0,i.jsx)(n.code,{children:"grid"})," \u8fd9\u7c7b layout \u51fd\u6570\u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"#pause"})," \u548c ",(0,i.jsx)(n.code,{children:"#meanwhile"}),"\uff0c\u4e5f\u662f\u7531\u4e8e\u540c\u6837\u7684\u9650\u5236\uff0c\u4f46\u662f\u4f60\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"#slide()"})," \u7684 ",(0,i.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u90fd\u5e94\u8be5\u80fd\u6ee1\u8db3\u9700\u6c42\u3002"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u539f\u7406",type:"tip",children:(0,i.jsxs)(n.p,{children:["Touying \u4e0d\u4f9d\u8d56 ",(0,i.jsx)(n.code,{children:"counter"})," \u548c ",(0,i.jsx)(n.code,{children:"locate"})," \u6765\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"#pause"}),"\uff0c\u800c\u662f\u7528 Typst \u811a\u672c\u5199\u4e86\u4e00\u4e2a parser\u3002\u5b83\u4f1a\u5c06\u8f93\u5165\u5185\u5bb9\u5757\u4f5c\u4e3a sequence \u89e3\u6790\uff0c\u7136\u540e\u6539\u9020\u91cd\u7ec4\u8fd9\u4e2a sequence \u4e3a\u6211\u4eec\u9700\u8981\u7684\u4e00\u7cfb\u5217 subslides\u3002"]})})]})}function u(e={}){const{wrapper:n}={...(0,d.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:()=>l,a:()=>t});var i=s(7294);const d={},c=i.createContext(d);function t(e){const n=i.useContext(c);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:t(e.components),i.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/ce05be13.7e685a8c.js b/zh/assets/js/ce05be13.7e685a8c.js deleted file mode 100644 index ccc7aa5f3..000000000 --- a/zh/assets/js/ce05be13.7e685a8c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7838],{9887:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:3},d="Dewdrop \u4e3b\u9898",r={id:"themes/dewdrop",title:"Dewdrop \u4e3b\u9898",description:"\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Zhibo Wang \u521b\u4f5c\u7684 BeamerTheme\uff0c\u7531 OrangeX4 \u6539\u9020\u800c\u6765\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/zh/docs/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 \u4e3b\u9898",permalink:"/touying/zh/docs/themes/metropolis"},next:{title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",permalink:"/touying/zh/docs/build-your-own-theme"}},o={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"\u7279\u6b8a\u51fd\u6570",id:"\u7279\u6b8a\u51fd\u6570",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",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:"dewdrop-\u4e3b\u9898",children:"Dewdrop \u4e3b\u9898"}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Zhibo Wang \u521b\u4f5c\u7684 ",(0,i.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"}),"\uff0c\u7531 ",(0,i.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"})," \u6539\u9020\u800c\u6765\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u62e5\u6709\u4f18\u96c5\u7f8e\u89c2\u7684 navigation\uff0c\u5305\u62ec ",(0,i.jsx)(n.code,{children:"sidebar"})," \u548c ",(0,i.jsx)(n.code,{children:"mini-slides"})," \u4e24\u79cd\u6a21\u5f0f\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,i.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"navigation"}),": \u5bfc\u822a\u680f\u6837\u5f0f\uff0c\u53ef\u4ee5\u662f ",(0,i.jsx)(n.code,{children:'"sidebar"'}),"\u3001",(0,i.jsx)(n.code,{children:'"mini-slides"'})," \u548c ",(0,i.jsx)(n.code,{children:"none"}),"\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'"sidebar"'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"sidebar"}),": \u4fa7\u8fb9\u5bfc\u822a\u680f\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(width: 10em)"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"mini-slides"}),": mini-slides \u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),"\u3002","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"height"}),": mini-slides \u9ad8\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2em"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"x"}),": mini-slides \u7684 x \u8f74 padding\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2em"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"section"}),": \u662f\u5426\u663e\u793a section \u4e4b\u540e\uff0csubsection \u4e4b\u524d\u7684 slides\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"false"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"subsection"}),": \u662f\u5426\u6839\u636e subsection \u5206\u5272 mini-slides\uff0c\u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"false"})," \u6324\u538b\u4e3a\u4e00\u884c\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,i.jsx)(n.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": primary \u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'rgb("#0c4842")'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"alpha"}),": \u900f\u660e\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"70%"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 Dewdrop \u4e3b\u9898\u4f1a\u63d0\u4f9b\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"#alert[..]"})," \u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#show strong: alert"})," \u6765\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"*alert text*"})," \u8bed\u6cd5\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:"Dewdrop \u9ed8\u8ba4\u4f7f\u7528\u4e86"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.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,i.jsxs)(n.p,{children:["\u989c\u8272\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"})," \u5bf9\u5176\u8fdb\u884c\u4fee\u6539\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,i.jsx)(n.p,{children:"Dewdrop \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"title-slide"})," \u4f1a\u8bfb\u53d6 ",(0,i.jsx)(n.code,{children:"self.info"})," \u91cc\u7684\u4fe1\u606f\u7528\u4e8e\u663e\u793a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e3a\u5176\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"extra"})," \u53c2\u6570\uff0c\u663e\u793a\u989d\u5916\u7684\u4fe1\u606f\u3002"]}),"\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 // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u9ed8\u8ba4\u62e5\u6709\u5bfc\u822a\u680f\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u80cc\u666f\u8272\u4e3a ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7279\u6b8a\u51fd\u6570",children:"\u7279\u6b8a\u51fd\u6570"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u663e\u793a\u5f53\u524d\u7684\u76ee\u5f55\uff0c",(0,i.jsx)(n.code,{children:"cover"})," \u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u662f\u5426\u8981\u9690\u85cf\u5904\u4e8e inactive \u72b6\u6001\u7684 sections\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5185\u90e8\u51fd\u6570\uff0c\u7528\u4e8e\u663e\u793a\u4fa7\u8fb9\u680f\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5185\u90e8\u51fd\u6570\uff0c\u7528\u4e8e\u663e\u793a mini-slides\u3002"}),"\n",(0,i.jsxs)(n.h2,{id:"slides-\u51fd\u6570",children:[(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"title-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"outline-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"outline-title"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"[Outline]"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-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,i.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n// #let s = (s.methods.appendix-in-outline)(self: s, false)\n#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide()\n\n#slide[\n == Outline\n \n #touying-outline(cover: false)\n]\n\n#slide(section: [Section A])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection A.1])[\n == Title\n\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n#slide(subsection: [Subsection A.2])[\n == Important\n\n A slide without a title but with *important* infos\n]\n\n#slide(section: [Section B])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection B.1])[\n == Another Subsection\n\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\n#slide(subsection: [Subsection B.2])[\n == Dynamic\n\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,) = utils.methods(s)\n\n#slide(section: [Appendix])[\n == Outline\n \n #touying-outline()\n]\n\n#slide[\n appendix\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:()=>r,a:()=>d});var i=s(7294);const t={},l=i.createContext(t);function d(e){const n=i.useContext(l);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(t):e.components||t:d(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/ce05be13.fb3adc95.js b/zh/assets/js/ce05be13.fb3adc95.js new file mode 100644 index 000000000..72aeae83f --- /dev/null +++ b/zh/assets/js/ce05be13.fb3adc95.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7838],{9887:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:3},d="Dewdrop \u4e3b\u9898",r={id:"themes/dewdrop",title:"Dewdrop \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/zh/docs/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 \u4e3b\u9898",permalink:"/touying/zh/docs/themes/metropolis"},next:{title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",permalink:"/touying/zh/docs/build-your-own-theme"}},o={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"\u7279\u6b8a\u51fd\u6570",id:"\u7279\u6b8a\u51fd\u6570",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",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:"dewdrop-\u4e3b\u9898",children:"Dewdrop \u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/23a8a9be-1f7c-43f7-88d4-40604dd6b01b",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7684\u7075\u611f\u6765\u81ea Zhibo Wang \u521b\u4f5c\u7684 ",(0,i.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"}),"\uff0c\u7531 ",(0,i.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"})," \u6539\u9020\u800c\u6765\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u62e5\u6709\u4f18\u96c5\u7f8e\u89c2\u7684 navigation\uff0c\u5305\u62ec ",(0,i.jsx)(n.code,{children:"sidebar"})," \u548c ",(0,i.jsx)(n.code,{children:"mini-slides"})," \u4e24\u79cd\u6a21\u5f0f\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,i.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"navigation"}),": \u5bfc\u822a\u680f\u6837\u5f0f\uff0c\u53ef\u4ee5\u662f ",(0,i.jsx)(n.code,{children:'"sidebar"'}),"\u3001",(0,i.jsx)(n.code,{children:'"mini-slides"'})," \u548c ",(0,i.jsx)(n.code,{children:"none"}),"\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'"sidebar"'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"sidebar"}),": \u4fa7\u8fb9\u5bfc\u822a\u680f\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(width: 10em)"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"mini-slides"}),": mini-slides \u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),"\u3002","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"height"}),": mini-slides \u9ad8\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2em"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"x"}),": mini-slides \u7684 x \u8f74 padding\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2em"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"section"}),": \u662f\u5426\u663e\u793a section \u4e4b\u540e\uff0csubsection \u4e4b\u524d\u7684 slides\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"false"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"subsection"}),": \u662f\u5426\u6839\u636e subsection \u5206\u5272 mini-slides\uff0c\u8bbe\u7f6e\u4e3a ",(0,i.jsx)(n.code,{children:"false"})," \u6324\u538b\u4e3a\u4e00\u884c\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,i.jsx)(n.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": primary \u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'rgb("#0c4842")'}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"alpha"}),": \u900f\u660e\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"70%"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 Dewdrop \u4e3b\u9898\u4f1a\u63d0\u4f9b\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"#alert[..]"})," \u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#show strong: alert"})," \u6765\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"*alert text*"})," \u8bed\u6cd5\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:"Dewdrop \u9ed8\u8ba4\u4f7f\u7528\u4e86"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.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,i.jsxs)(n.p,{children:["\u989c\u8272\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"})," \u5bf9\u5176\u8fdb\u884c\u4fee\u6539\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,i.jsx)(n.p,{children:"Dewdrop \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"title-slide"})," \u4f1a\u8bfb\u53d6 ",(0,i.jsx)(n.code,{children:"self.info"})," \u91cc\u7684\u4fe1\u606f\u7528\u4e8e\u663e\u793a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e3a\u5176\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"extra"})," \u53c2\u6570\uff0c\u663e\u793a\u989d\u5916\u7684\u4fe1\u606f\u3002"]}),"\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 // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u9ed8\u8ba4\u62e5\u6709\u5bfc\u822a\u680f\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u80cc\u666f\u8272\u4e3a ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7279\u6b8a\u51fd\u6570",children:"\u7279\u6b8a\u51fd\u6570"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u663e\u793a\u5f53\u524d\u7684\u76ee\u5f55\uff0c",(0,i.jsx)(n.code,{children:"cover"})," \u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u662f\u5426\u8981\u9690\u85cf\u5904\u4e8e inactive \u72b6\u6001\u7684 sections\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5185\u90e8\u51fd\u6570\uff0c\u7528\u4e8e\u663e\u793a\u4fa7\u8fb9\u680f\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u5185\u90e8\u51fd\u6570\uff0c\u7528\u4e8e\u663e\u793a mini-slides\u3002"}),"\n",(0,i.jsxs)(n.h2,{id:"slides-\u51fd\u6570",children:[(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"title-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"outline-slide"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"outline-title"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"[Outline]"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-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,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/09ddfb40-4f97-4062-8261-23f87690c33e",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.dewdrop.register(\n s,\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 s = (s.methods.enable-transparent-cover)(self: s)\n// #let s = (s.methods.appendix-in-outline)(self: s, false)\n#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#title-slide()\n\n#slide[\n == Outline\n \n #touying-outline(cover: false)\n]\n\n#slide(section: [Section A])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection A.1])[\n == Title\n\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n#slide(subsection: [Subsection A.2])[\n == Important\n\n A slide without a title but with *important* infos\n]\n\n#slide(section: [Section B])[\n == Outline\n \n #touying-outline()\n]\n\n#slide(subsection: [Subsection B.1])[\n == Another Subsection\n\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n// simple animations\n#slide(subsection: [Subsection B.2])[\n == Dynamic\n\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,) = utils.methods(s)\n\n#slide(section: [Appendix])[\n == Outline\n \n #touying-outline()\n]\n\n#slide[\n appendix\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:()=>r,a:()=>d});var i=s(7294);const t={},l=i.createContext(t);function d(e){const n=i.useContext(l);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(t):e.components||t:d(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/d21a173f.80dafc04.js b/zh/assets/js/d21a173f.80dafc04.js new file mode 100644 index 000000000..1bb3f1819 --- /dev/null +++ b/zh/assets/js/d21a173f.80dafc04.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5658],{5086:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="\u5f00\u59cb",r={id:"start",title:"\u5f00\u59cb",description:"\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 Web App \u6216 VS Code \u7684 Typst LSP \u548c Typst Preview \u63d2\u4ef6\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/zh/docs/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:"Touying \u4ecb\u7ecd",permalink:"/touying/zh/docs/intro"},next:{title:"\u6392\u7bc7\u5e03\u5c40",permalink:"/touying/zh/docs/layout"}},a={},d=[{value:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",level:2}];function p(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h1,{id:"\u5f00\u59cb",children:"\u5f00\u59cb"}),"\n",(0,s.jsxs)(e.p,{children:["\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 ",(0,s.jsx)(e.a,{href:"https://typst.app/",children:"Web App"})," \u6216 VS Code \u7684 ",(0,s.jsx)(e.a,{href:"https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp",children:"Typst LSP"})," \u548c ",(0,s.jsx)(e.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," \u63d2\u4ef6\u3002"]}),"\n",(0,s.jsx)(e.p,{children:"\u8981\u4f7f\u7528 Touying\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u91cc\u52a0\u5165"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\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)(e.p,{children:(0,s.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/6f15b500-b825-4db1-88ff-34212f43723e",alt:"image"})}),"\n",(0,s.jsx)(e.p,{children:"\u8fd9\u5f88\u7b80\u5355\uff0c\u60a8\u521b\u5efa\u4e86\u60a8\u7684\u7b2c\u4e00\u4e2a Touying slides\uff0c\u606d\u559c\uff01\ud83c\udf89"}),"\n",(0,s.jsx)(e.h2,{id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",children:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50"}),"\n",(0,s.jsxs)(e.p,{children:["\u4e8b\u5b9e\u4e0a\uff0cTouying \u63d0\u4f9b\u4e86\u591a\u79cd slides \u7f16\u5199\u98ce\u683c\uff0c\u4f8b\u5982\u4e0a\u9762\u7684\u4f8b\u5b50\u4f9d\u9760\u4e00\u7ea7\u548c\u4e8c\u7ea7\u6807\u9898\u6765\u5212\u5206\u65b0 slide\uff0c\u5b9e\u9645\u4e0a\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528 ",(0,s.jsx)(e.code,{children:"#slide[..]"})," \u7684\u5199\u6cd5\uff0c\u4ee5\u83b7\u5f97 Touying \u63d0\u4f9b\u7684\u66f4\u591a\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u3002"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide) = utils.methods(s)\n#show: init\n\n// simple animations\n#slide[\n a simple #pause *dynamic*\n\n #pause\n \n slide.\n\n #meanwhile\n\n meanwhile #pause with pause.\n][\n second #pause pause.\n]\n\n// complex animations\n#slide(setting: body => {\n set text(fill: blue)\n body\n}, repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n in subslide #self.subslide\n\n test #uncover("2-")[uncover] function\n\n test #only("2-")[only] function\n\n #pause\n\n and paused text.\n])\n\n// math equation animations\n#slide[\n == Touying Equation\n\n #touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n `)\n\n #meanwhile\n\n Touying equation is very simple.\n]\n\n// multiple pages for one slide\n#slide[\n == Multiple Pages for One Slide\n\n #lorem(200)\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide,) = utils.methods(s)\n\n#slide[\n == Appendix\n]\n'})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/192b13f9-e3fb-4327-864b-fd9084a8ca24",alt:"image"})}),"\n",(0,s.jsx)(e.p,{children:"\u9664\u6b64\u4e4b\u5916\uff0cTouying \u8fd8\u63d0\u4f9b\u4e86\u5f88\u591a\u5185\u7f6e\u7684\u4e3b\u9898\uff0c\u80fd\u591f\u7b80\u5355\u5730\u7f16\u5199\u7cbe\u7f8e\u7684 slides\uff0c\u57fa\u672c\u4e0a\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u9876\u90e8\u52a0\u5165\u4e00\u884c"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{children:'#let s = themes.metropolis.register(s, aspect-ratio: "16-9")\n'})}),"\n",(0,s.jsx)(e.p,{children:"\u5373\u53ef\u4f7f\u7528 metropolis \u4e3b\u9898\u3002\u5173\u4e8e\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\uff0c\u60a8\u53ef\u4ee5\u53c2\u9605\u540e\u9762\u7684\u7ae0\u8282\u3002"})]})}function u(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(p,{...n})}):p(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>r,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(n){const e=s.useContext(o);return s.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:l(n.components),s.createElement(o.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/d21a173f.b917e6e4.js b/zh/assets/js/d21a173f.b917e6e4.js deleted file mode 100644 index 026ab39db..000000000 --- a/zh/assets/js/d21a173f.b917e6e4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5658],{5086:(n,e,s)=>{s.r(e),s.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});var t=s(5893),i=s(1151);const o={sidebar_position:2},l="\u5f00\u59cb",r={id:"start",title:"\u5f00\u59cb",description:"\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 Web App \u6216 VS Code \u7684 Typst LSP \u548c Typst Preview \u63d2\u4ef6\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/zh/docs/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:"Touying \u4ecb\u7ecd",permalink:"/touying/zh/docs/intro"},next:{title:"\u6392\u7bc7\u5e03\u5c40",permalink:"/touying/zh/docs/layout"}},a={},d=[{value:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",level:2}];function p(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.h1,{id:"\u5f00\u59cb",children:"\u5f00\u59cb"}),"\n",(0,t.jsxs)(e.p,{children:["\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86 Typst \u73af\u5883\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(e.a,{href:"https://typst.app/",children:"Web App"})," \u6216 VS Code \u7684 ",(0,t.jsx)(e.a,{href:"https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp",children:"Typst LSP"})," \u548c ",(0,t.jsx)(e.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," \u63d2\u4ef6\u3002"]}),"\n",(0,t.jsx)(e.p,{children:"\u8981\u4f7f\u7528 Touying\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u91cc\u52a0\u5165"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,t.jsx)(e.p,{children:"\u8fd9\u5f88\u7b80\u5355\uff0c\u60a8\u521b\u5efa\u4e86\u60a8\u7684\u7b2c\u4e00\u4e2a Touying slides\uff0c\u606d\u559c\uff01\ud83c\udf89"}),"\n",(0,t.jsx)(e.h2,{id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",children:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50"}),"\n",(0,t.jsxs)(e.p,{children:["\u4e8b\u5b9e\u4e0a\uff0cTouying \u63d0\u4f9b\u4e86\u591a\u79cd slides \u7f16\u5199\u98ce\u683c\uff0c\u4f8b\u5982\u4e0a\u9762\u7684\u4f8b\u5b50\u4f9d\u9760\u4e00\u7ea7\u548c\u4e8c\u7ea7\u6807\u9898\u6765\u5212\u5206\u65b0 slide\uff0c\u5b9e\u9645\u4e0a\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(e.code,{children:"#slide[..]"})," \u7684\u5199\u6cd5\uff0c\u4ee5\u83b7\u5f97 Touying \u63d0\u4f9b\u7684\u66f4\u591a\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u3002"]}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide) = utils.methods(s)\n#show: init\n\n// simple animations\n#slide[\n a simple #pause *dynamic*\n\n #pause\n \n slide.\n\n #meanwhile\n\n meanwhile #pause with pause.\n][\n second #pause pause.\n]\n\n// complex animations\n#slide(setting: body => {\n set text(fill: blue)\n body\n}, repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n in subslide #self.subslide\n\n test #uncover("2-")[uncover] function\n\n test #only("2-")[only] function\n\n #pause\n\n and paused text.\n])\n\n// math equation animations\n#slide[\n == Touying Equation\n\n #touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n `)\n\n #meanwhile\n\n Touying equation is very simple.\n]\n\n// multiple pages for one slide\n#slide[\n == Multiple Pages for One Slide\n\n #lorem(200)\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide,) = utils.methods(s)\n\n#slide[\n == Appendix\n]\n'})}),"\n",(0,t.jsx)(e.p,{children:"\u9664\u6b64\u4e4b\u5916\uff0cTouying \u8fd8\u63d0\u4f9b\u4e86\u5f88\u591a\u5185\u7f6e\u7684\u4e3b\u9898\uff0c\u80fd\u591f\u7b80\u5355\u5730\u7f16\u5199\u7cbe\u7f8e\u7684 slides\uff0c\u57fa\u672c\u4e0a\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u9876\u90e8\u52a0\u5165\u4e00\u884c"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{children:'#let s = themes.metropolis.register(s, aspect-ratio: "16-9")\n'})}),"\n",(0,t.jsx)(e.p,{children:"\u5373\u53ef\u4f7f\u7528 metropolis \u4e3b\u9898\u3002\u5173\u4e8e\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\uff0c\u60a8\u53ef\u4ee5\u53c2\u9605\u540e\u9762\u7684\u7ae0\u8282\u3002"})]})}function u(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(p,{...n})}):p(n)}},1151:(n,e,s)=>{s.d(e,{Z:()=>r,a:()=>l});var t=s(7294);const i={},o=t.createContext(i);function l(n){const e=t.useContext(o);return t.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:l(n.components),t.createElement(o.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/eb154561.0316d559.js b/zh/assets/js/eb154561.0316d559.js new file mode 100644 index 000000000..2c285a9ea --- /dev/null +++ b/zh/assets/js/eb154561.0316d559.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7059],{1873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(5893),t=n(1151);const l={sidebar_position:1},r="Simple \u4e3b\u9898",d={id:"themes/simple",title:"Simple \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/zh/docs/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/zh/docs/category/themes"},next:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/themes/metropolis"}},o={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const s={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)(s.h1,{id:"simple-\u4e3b\u9898",children:"Simple \u4e3b\u9898"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u6765\u6e90\u4e8e ",(0,i.jsx)(s.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),"\uff0c\u4f5c\u8005\u662f Andreas Kr\xf6pelin\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u4e2a\u4e3b\u9898\u88ab\u8ba4\u4e3a\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u7528\u5b83\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355 slides\uff0c\u5e76\u4e14\u53ef\u4ee5\u968f\u610f\u52a0\u5165\u4f60\u559c\u6b22\u7684\u529f\u80fd\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,i.jsx)(s.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,i.jsx)(s.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"background"}),": \u80cc\u666f\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a\u767d\u8272\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"foreground"}),": \u6587\u672c\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a\u9ed1\u8272\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"primary"}),": \u4e3b\u9898\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"aqua.darken(50%)"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,i.jsx)(s.p,{children:"simple \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u5185\u5bb9\u4f4d\u4e8e\u5e7b\u706f\u7247\u4e2d\u592e\u7684\u5e7b\u706f\u7247\uff0c",(0,i.jsx)(s.code,{children:"section"})," \u53c2\u6570\u53ef\u4ee5\u7528\u4e8e\u65b0\u5efa\u4e00\u4e2a section\u3002"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u548c ",(0,i.jsx)(s.code,{children:"centered-slide"})," \u76f8\u540c\uff0c\u8fd9\u91cc\u53ea\u662f\u4e3a\u4e86\u4fdd\u6301\u548c Polylux \u8bed\u6cd5\u4e0a\u7684\u4e00\u81f4\u6027\u3002"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.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)(s.p,{children:"\u9ed8\u8ba4\u62e5\u6709\u9875\u7709\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d\u9875\u7709\u4e3a\u5f53\u524d section\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u53ef\u9009\u63a5\u53d7\u4e00\u4e2a\u524d\u666f\u8272 (\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"white"}),") \u548c\u4e00\u4e2a\u80cc\u666f\u8272 (\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"auto"}),"\uff0c\u5373 ",(0,i.jsx)(s.code,{children:"self.colors.primary"}),")\u3002"]}),"\n",(0,i.jsxs)(s.h2,{id:"slides-\u51fd\u6570",children:[(0,i.jsx)(s.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n\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/2c599bd1-6250-497f-a65b-f19ae02a16cb",alt:"image"})}),"\n",(0,i.jsx)(s.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\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#slide[\n == First slide\n\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n#centered-slide(section: [Let\'s start a new section!])\n\n#slide[\n == Dynamic slide\n Did you know that...\n\n #pause\n ...you can see the current section at the top of the slide?\n]\n'})})]})}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:()=>r});var i=n(7294);const t={},l=i.createContext(t);function r(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:r(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/eb154561.4e972827.js b/zh/assets/js/eb154561.4e972827.js deleted file mode 100644 index d18f01fb4..000000000 --- a/zh/assets/js/eb154561.4e972827.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7059],{1873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(5893),t=n(1151);const l={sidebar_position:1},r="Simple \u4e3b\u9898",d={id:"themes/simple",title:"Simple \u4e3b\u9898",description:"\u8fd9\u4e2a\u4e3b\u9898\u6765\u6e90\u4e8e Polylux\uff0c\u4f5c\u8005\u662f Andreas Kr\xf6pelin\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/zh/docs/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/zh/docs/category/themes"},next:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/themes/metropolis"}},o={},c=[{value:"\u521d\u59cb\u5316",id:"\u521d\u59cb\u5316",level:2},{value:"slide \u51fd\u6570\u65cf",id:"slide-\u51fd\u6570\u65cf",level:2},{value:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"simple-\u4e3b\u9898",children:"Simple \u4e3b\u9898"}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u6765\u6e90\u4e8e ",(0,i.jsx)(s.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),"\uff0c\u4f5c\u8005\u662f Andreas Kr\xf6pelin\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u4e2a\u4e3b\u9898\u88ab\u8ba4\u4e3a\u662f\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u7684\u4e3b\u9898\uff0c\u4f60\u53ef\u4ee5\u7528\u5b83\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355 slides\uff0c\u5e76\u4e14\u53ef\u4ee5\u968f\u610f\u52a0\u5165\u4f60\u559c\u6b22\u7684\u529f\u80fd\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u521d\u59cb\u5316",children:"\u521d\u59cb\u5316"}),"\n",(0,i.jsx)(s.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u521d\u59cb\u5316\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"register"})," \u63a5\u6536\u53c2\u6570:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"aspect-ratio"}),': \u5e7b\u706f\u7247\u7684\u957f\u5bbd\u6bd4\u4e3a "16-9" \u6216 "4-3"\uff0c\u9ed8\u8ba4\u4e3a "16-9"\u3002']}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"[]"}),"\uff0c\u4e5f\u53ef\u4ee5\u4f20\u5165\u5f62\u5982 ",(0,i.jsx)(s.code,{children:"self => self.info.author"})," \u7684\u51fd\u6570\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"footer-right"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"background"}),": \u80cc\u666f\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a\u767d\u8272\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"foreground"}),": \u6587\u672c\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a\u9ed1\u8272\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"primary"}),": \u4e3b\u9898\u989c\u8272\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"aqua.darken(50%)"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"slide-\u51fd\u6570\u65cf",children:"slide \u51fd\u6570\u65cf"}),"\n",(0,i.jsx)(s.p,{children:"simple \u4e3b\u9898\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u81ea\u5b9a\u4e49 slide \u51fd\u6570\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u5185\u5bb9\u4f4d\u4e8e\u5e7b\u706f\u7247\u4e2d\u592e\u7684\u5e7b\u706f\u7247\uff0c",(0,i.jsx)(s.code,{children:"section"})," \u53c2\u6570\u53ef\u4ee5\u7528\u4e8e\u65b0\u5efa\u4e00\u4e2a section\u3002"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u548c ",(0,i.jsx)(s.code,{children:"centered-slide"})," \u76f8\u540c\uff0c\u8fd9\u91cc\u53ea\u662f\u4e3a\u4e86\u4fdd\u6301\u548c Polylux \u8bed\u6cd5\u4e0a\u7684\u4e00\u81f4\u6027\u3002"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.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)(s.p,{children:"\u9ed8\u8ba4\u62e5\u6709\u9875\u7709\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d\u9875\u7709\u4e3a\u5f53\u524d section\uff0c\u9875\u811a\u4e3a\u60a8\u8bbe\u7f6e\u7684\u9875\u811a\u3002"}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u53ef\u9009\u63a5\u53d7\u4e00\u4e2a\u524d\u666f\u8272 (\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"white"}),") \u548c\u4e00\u4e2a\u80cc\u666f\u8272 (\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"auto"}),"\uff0c\u5373 ",(0,i.jsx)(s.code,{children:"self.colors.primary"}),")\u3002"]}),"\n",(0,i.jsxs)(s.h2,{id:"slides-\u51fd\u6570",children:[(0,i.jsx)(s.code,{children:"slides"})," \u51fd\u6570"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\n\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.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)\n#show: init\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#slide[\n == First slide\n\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n#centered-slide(section: [Let\'s start a new section!])\n\n#slide[\n == Dynamic slide\n Did you know that...\n\n #pause\n ...you can see the current section at the top of the slide?\n]\n'})})]})}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:()=>r});var i=n(7294);const t={},l=i.createContext(t);function r(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:r(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/f6262a69.06fafcfe.js b/zh/assets/js/f6262a69.06fafcfe.js deleted file mode 100644 index dd1f5134c..000000000 --- a/zh/assets/js/f6262a69.06fafcfe.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1934],{3282:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>a,frontMatter:()=>d,metadata:()=>o,toc:()=>r});var i=s(5893),t=s(1151);const d={sidebar_position:3},c="\u6392\u7bc7\u5e03\u5c40",o={id:"layout",title:"\u6392\u7bc7\u5e03\u5c40",description:"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/zh/docs/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u5f00\u59cb",permalink:"/touying/zh/docs/start"},next:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/style"}},l={},r=[{value:"\u5168\u5c40\u4fe1\u606f",id:"\u5168\u5c40\u4fe1\u606f",level:2},{value:"\u8282\u4e0e\u5c0f\u8282",id:"\u8282\u4e0e\u5c0f\u8282",level:2},{value:"\u76ee\u5f55",id:"\u76ee\u5f55",level:2},{value:"\u9875\u9762\u7ba1\u7406",id:"\u9875\u9762\u7ba1\u7406",level:2},{value:"\u9875\u9762\u5206\u680f",id:"\u9875\u9762\u5206\u680f",level:2}];function h(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u6392\u7bc7\u5e03\u5c40",children:"\u6392\u7bc7\u5e03\u5c40"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002"}),"\n",(0,i.jsx)(n.h2,{id:"\u5168\u5c40\u4fe1\u606f",children:"\u5168\u5c40\u4fe1\u606f"}),"\n",(0,i.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.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,i.jsx)(n.p,{children:"\u5206\u522b\u8bbe\u7f6e slides \u7684\u6807\u9898\u3001\u526f\u6807\u9898\u3001\u4f5c\u8005\u3001\u65e5\u671f\u548c\u673a\u6784\u4fe1\u606f\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"date"})," \u53ef\u4ee5\u63a5\u6536 ",(0,i.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u548c ",(0,i.jsx)(n.code,{children:"content"})," \u683c\u5f0f\uff0c\u5e76\u4e14 ",(0,i.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u7684\u65e5\u671f\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u7684\u65b9\u5f0f\u66f4\u6539\u3002"}),"\n",(0,i.jsxs)(n.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,i.jsx)(n.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f1a\u7a0d\u5fae\u5f15\u5165\u4e00\u70b9 Touying \u7684 OOP \u6982\u5ff5\u3002"}),(0,i.jsxs)(n.p,{children:["\u60a8\u5e94\u8be5\u77e5\u9053\uff0cTypst \u662f\u4e00\u4e2a\u652f\u6301\u589e\u91cf\u6e32\u67d3\u7684\u6392\u7248\u8bed\u8a00\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0cTypst \u4f1a\u7f13\u5b58\u4e4b\u524d\u7684\u51fd\u6570\u8c03\u7528\u7ed3\u679c\uff0c\u8fd9\u5c31\u8981\u6c42 Typst \u91cc\u53ea\u6709\u7eaf\u51fd\u6570\uff0c\u5373\u65e0\u6cd5\u6539\u53d8\u5916\u90e8\u53d8\u91cf\u7684\u51fd\u6570\u3002\u56e0\u6b64\u6211\u4eec\u5f88\u96be\u771f\u6b63\u610f\u4e49\u4e0a\u5730\u50cf LaTeX \u90a3\u6837\u4fee\u6539\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\u5373\u4f7f\u662f\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"state"})," \u6216 ",(0,i.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u9700\u8981\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"locate"})," \u4e0e\u56de\u8c03\u51fd\u6570\u6765\u83b7\u53d6\u91cc\u9762\u7684\u503c\uff0c\u4e14\u5b9e\u9645\u4e0a\u8fd9\u79cd\u65b9\u5f0f\u4f1a\u5bf9\u6027\u80fd\u6709\u5f88\u5927\u7684\u5f71\u54cd\u3002"]}),(0,i.jsxs)(n.p,{children:["Touying \u5e76\u6ca1\u6709\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"state"})," \u548c ",(0,i.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u6ca1\u6709\u8fdd\u53cd Typst \u7eaf\u51fd\u6570\u7684\u539f\u5219\uff0c\u800c\u662f\u4f7f\u7528\u4e86\u4e00\u79cd\u5de7\u5999\u7684\u65b9\u5f0f\uff0c\u5e76\u4ee5\u9762\u5411\u5bf9\u8c61\u98ce\u683c\u7684\u4ee3\u7801\uff0c\u7ef4\u62a4\u4e86\u4e00\u4e2a\u5168\u5c40\u5355\u4f8b ",(0,i.jsx)(n.code,{children:"s"}),"\u3002\u5728 Touying \u4e2d\uff0c\u4e00\u4e2a\u5bf9\u8c61\u6307\u62e5\u6709\u81ea\u5df1\u7684\u6210\u5458\u53d8\u91cf\u548c\u65b9\u6cd5\u7684 Typst \u5b57\u5178\uff0c\u5e76\u4e14\u6211\u4eec\u7ea6\u5b9a\u65b9\u6cd5\u5747\u6709\u4e00\u4e2a\u547d\u540d\u53c2\u6570 ",(0,i.jsx)(n.code,{children:"self"})," \u7528\u4e8e\u4f20\u5165\u5bf9\u8c61\u81ea\u8eab\uff0c\u5e76\u4e14\u65b9\u6cd5\u5747\u653e\u5728 ",(0,i.jsx)(n.code,{children:".methods"})," \u57df\u91cc\u3002\u6709\u4e86\u8fd9\u4e2a\u7406\u5ff5\uff0c\u6211\u4eec\u5c31\u4e0d\u96be\u5199\u51fa\u66f4\u65b0 ",(0,i.jsx)(n.code,{children:"info"})," \u7684\u65b9\u6cd5\u4e86\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{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,i.jsxs)(n.p,{children:["\u8fd9\u6837\uff0c\u4f60\u4e5f\u80fd\u591f\u7406\u89e3 ",(0,i.jsx)(n.code,{children:"utils.methods()"})," \u51fd\u6570\u7684\u7528\u9014\u4e86\uff1a\u5c06 ",(0,i.jsx)(n.code,{children:"self"})," \u7ed1\u5b9a\u5230 ",(0,i.jsx)(n.code,{children:"s"})," \u7684\u6240\u6709\u65b9\u6cd5\u4e0a\u5e76\u8fd4\u56de\uff0c\u5e76\u901a\u8fc7\u89e3\u5305\u8bed\u6cd5\u7b80\u5316\u540e\u7eed\u7684\u4f7f\u7528\u3002"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let (init, slide, slides) = utils.methods(s)\n"})})]}),"\n",(0,i.jsx)(n.h2,{id:"\u8282\u4e0e\u5c0f\u8282",children:"\u8282\u4e0e\u5c0f\u8282"}),"\n",(0,i.jsx)(n.p,{children:"\u4e0e Beamer \u76f8\u540c\uff0cTouying \u540c\u6837\u6709\u7740 section \u548c subsection \u7684\u6982\u5ff5\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"#show: slides"})," \u6a21\u5f0f\u4e0b\uff0csection \u548c subsection \u5206\u522b\u5bf9\u5e94\u7740\u4e00\u7ea7\u6807\u9898\u548c\u4e8c\u7ea7\u6807\u9898\uff0c\u4f8b\u5982"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Section\n\n== Subsection\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u4e0d\u8fc7\u4e8c\u7ea7\u6807\u9898\u5e76\u975e\u603b\u662f\u5bf9\u5e94 subsection\uff0c\u5177\u4f53\u7684\u6620\u5c04\u65b9\u5f0f\u56e0\u4e3b\u9898\u800c\u5f02\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u800c\u5728\u66f4\u901a\u7528\u7684 ",(0,i.jsx)(n.code,{children:"#slide[..]"})," \u6a21\u5f0f\u4e0b\uff0csection \u548c subsection \u5206\u522b\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u4e2d\uff0c\u4f8b\u5982"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(section: [Let's start a new section!])[..]\n\n#slide(subsection: [Let's start a new subsection!])[..]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f1a\u5206\u522b\u65b0\u5efa\u4e00\u4e2a section \u548c\u4e00\u4e2a subsection\u3002\u5f53\u7136\uff0c\u8fd9\u79cd\u53d8\u5316\u9ed8\u8ba4\u53ea\u4f1a\u5f71\u54cd\u5230 Touying \u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"sections"})," state\uff0c\u9ed8\u8ba4\u662f\u4e0d\u4f1a\u663e\u793a\u5728 slide \u4e0a\u7684\uff0c\u5177\u4f53\u7684\u663e\u793a\u65b9\u5f0f\u4f9d\u4e3b\u9898\u800c\u5f02\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6ce8\u610f\uff0c",(0,i.jsx)(n.code,{children:"slide"})," \u7684 ",(0,i.jsx)(n.code,{children:"section"})," \u548c ",(0,i.jsx)(n.code,{children:"subsection"})," \u53c2\u6570\uff0c\u65e2\u80fd\u63a5\u6536\u5185\u5bb9\u5757\uff0c\u4e5f\u80fd\u63a5\u6536\u5f62\u5982 ",(0,i.jsx)(n.code,{children:"([title], [short-title])"})," \u683c\u5f0f\u7684\u6570\u7ec4\uff0c\u6216 ",(0,i.jsx)(n.code,{children:"(title: [title], short-title: [short-title])"})," \u683c\u5f0f\u7684\u5b57\u5178\u3002\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"short-title"})," \u4f1a\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f\u4e0b\u7528\u5230\uff0c\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"dewdrop"})," \u4e3b\u9898\u7684 navigation \u4e2d\u5c06\u4f1a\u7528\u5230\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u76ee\u5f55",children:"\u76ee\u5f55"}),"\n",(0,i.jsx)(n.p,{children:"\u5728 Touying \u4e2d\u663e\u793a\u76ee\u5f55\u5f88\u7b80\u5355\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, touying-outline) = utils.methods(s)\n#show: init\n\n#slide[\n == Table of contents\n\n #touying-outline()\n]\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"touying-oultine()"})," \u7684\u5b9a\u4e49\u4e3a\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"enum-args"})," \u4fee\u6539\u5185\u90e8 enum \u7684\u53c2\u6570\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u679c\u4f60\u5bf9\u76ee\u5f55\u6709\u7740\u590d\u6742\u7684\u81ea\u5b9a\u4e49\u9700\u6c42\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n == Table of contents\n\n #states.touying-final-sections(sections => ..)\n]\n"})}),"\n",(0,i.jsx)(n.h2,{id:"\u9875\u9762\u7ba1\u7406",children:"\u9875\u9762\u7ba1\u7406"}),"\n",(0,i.jsxs)(n.p,{children:["\u7531\u4e8e Typst \u4e2d\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u4f1a\u5bfc\u81f4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9875\u9762\uff0c\u800c\u4e0d\u80fd\u4fee\u6539\u5f53\u524d\u9875\u9762\uff0c\u56e0\u6b64 Touying \u9009\u62e9\u5728\u5355\u4f8b ",(0,i.jsx)(n.code,{children:"s"})," \u4e2d\u7ef4\u62a4\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\uff0c\u53ea\u5728\u521b\u5efa\u65b0 slide \u65f6\u624d\u4f1a\u5e94\u7528\u8fd9\u4e9b\u53c2\u6570\u3002"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,i.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u4f60\u4e0d\u5e94\u8be5\u81ea\u5df1\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,i.jsx)(n.code,{children:"s"})," \u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u5b9e\u65f6\u67e5\u8be2\u5f53\u524d\u9875\u9762\u7684\u53c2\u6570\uff0c\u8fd9\u5bf9\u4e00\u4e9b\u9700\u8981\u83b7\u53d6\u9875\u8fb9\u8ddd\u6216\u5f53\u524d\u9875\u9762\u80cc\u666f\u989c\u8272\u7684\u51fd\u6570\u5f88\u6709\u7528\uff0c\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"transparent-cover"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u9875\u9762\u5206\u680f",children:"\u9875\u9762\u5206\u680f"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u5c06\u9875\u9762\u5206\u4e3a\u4e24\u680f\u6216\u4e09\u680f\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Touying ",(0,i.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u9ed8\u8ba4\u63d0\u4f9b\u7684 ",(0,i.jsx)(n.code,{children:"compose"})," \u529f\u80fd\uff0c\u6700\u7b80\u5355\u7684\u793a\u4f8b\u5982\u4e0b\uff1a"]}),"\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.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u66f4\u6539\u5206\u680f\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539 ",(0,i.jsx)(n.code,{children:"slide"})," \u7684 ",(0,i.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5176\u4e2d\u9ed8\u8ba4\u7684\u53c2\u6570\u662f ",(0,i.jsx)(n.code,{children:"utils.with.side-by-side(columns: auto, gutter: 1em)"}),"\uff0c\u5982\u679c\u6211\u4eec\u8981\u8ba9\u5de6\u8fb9\u90a3\u4e00\u680f\u5360\u636e\u5269\u4f59\u5bbd\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[\n First column.\n][\n Second column.\n]\n"})})]})}function a(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>c});var i=s(7294);const t={},d=i.createContext(t);function c(e){const n=i.useContext(d);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:c(e.components),i.createElement(d.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/f6262a69.9f62a746.js b/zh/assets/js/f6262a69.9f62a746.js new file mode 100644 index 000000000..80f3fb2aa --- /dev/null +++ b/zh/assets/js/f6262a69.9f62a746.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1934],{3282:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>c,metadata:()=>o,toc:()=>r});var i=s(5893),t=s(1151);const c={sidebar_position:3},d="\u6392\u7bc7\u5e03\u5c40",o={id:"layout",title:"\u6392\u7bc7\u5e03\u5c40",description:"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/zh/docs/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u5f00\u59cb",permalink:"/touying/zh/docs/start"},next:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/style"}},l={},r=[{value:"\u5168\u5c40\u4fe1\u606f",id:"\u5168\u5c40\u4fe1\u606f",level:2},{value:"\u8282\u4e0e\u5c0f\u8282",id:"\u8282\u4e0e\u5c0f\u8282",level:2},{value:"\u76ee\u5f55",id:"\u76ee\u5f55",level:2},{value:"\u9875\u9762\u7ba1\u7406",id:"\u9875\u9762\u7ba1\u7406",level:2},{value:"\u9875\u9762\u5206\u680f",id:"\u9875\u9762\u5206\u680f",level:2}];function a(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u6392\u7bc7\u5e03\u5c40",children:"\u6392\u7bc7\u5e03\u5c40"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u66f4\u597d\u5730\u638c\u7ba1 slides \u91cc\u7684\u6bcf\u4e00\u5904\u7ec6\u8282\uff0c\u5e76\u5f97\u5230\u66f4\u597d\u7684\u6e32\u67d3\u7ed3\u679c\uff0c\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u4e0d\u5f97\u4e0d\u5f15\u5165\u4e86\u4e00\u4e9b Touying \u7279\u6709\u7684\u6982\u5ff5\u3002\u8fd9\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u4ee5\u53ca\u8ba9\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u65b9\u4fbf\u5730\u5207\u6362\u3002"}),"\n",(0,i.jsx)(n.h2,{id:"\u5168\u5c40\u4fe1\u606f",children:"\u5168\u5c40\u4fe1\u606f"}),"\n",(0,i.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.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,i.jsx)(n.p,{children:"\u5206\u522b\u8bbe\u7f6e slides \u7684\u6807\u9898\u3001\u526f\u6807\u9898\u3001\u4f5c\u8005\u3001\u65e5\u671f\u548c\u673a\u6784\u4fe1\u606f\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"date"})," \u53ef\u4ee5\u63a5\u6536 ",(0,i.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u548c ",(0,i.jsx)(n.code,{children:"content"})," \u683c\u5f0f\uff0c\u5e76\u4e14 ",(0,i.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u7684\u65e5\u671f\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u7684\u65b9\u5f0f\u66f4\u6539\u3002"}),"\n",(0,i.jsxs)(n.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,i.jsx)(n.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f1a\u7a0d\u5fae\u5f15\u5165\u4e00\u70b9 Touying \u7684 OOP \u6982\u5ff5\u3002"}),(0,i.jsxs)(n.p,{children:["\u60a8\u5e94\u8be5\u77e5\u9053\uff0cTypst \u662f\u4e00\u4e2a\u652f\u6301\u589e\u91cf\u6e32\u67d3\u7684\u6392\u7248\u8bed\u8a00\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0cTypst \u4f1a\u7f13\u5b58\u4e4b\u524d\u7684\u51fd\u6570\u8c03\u7528\u7ed3\u679c\uff0c\u8fd9\u5c31\u8981\u6c42 Typst \u91cc\u53ea\u6709\u7eaf\u51fd\u6570\uff0c\u5373\u65e0\u6cd5\u6539\u53d8\u5916\u90e8\u53d8\u91cf\u7684\u51fd\u6570\u3002\u56e0\u6b64\u6211\u4eec\u5f88\u96be\u771f\u6b63\u610f\u4e49\u4e0a\u5730\u50cf LaTeX \u90a3\u6837\u4fee\u6539\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\u5373\u4f7f\u662f\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"state"})," \u6216 ",(0,i.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u9700\u8981\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"locate"})," \u4e0e\u56de\u8c03\u51fd\u6570\u6765\u83b7\u53d6\u91cc\u9762\u7684\u503c\uff0c\u4e14\u5b9e\u9645\u4e0a\u8fd9\u79cd\u65b9\u5f0f\u4f1a\u5bf9\u6027\u80fd\u6709\u5f88\u5927\u7684\u5f71\u54cd\u3002"]}),(0,i.jsxs)(n.p,{children:["Touying \u5e76\u6ca1\u6709\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"state"})," \u548c ",(0,i.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u6ca1\u6709\u8fdd\u53cd Typst \u7eaf\u51fd\u6570\u7684\u539f\u5219\uff0c\u800c\u662f\u4f7f\u7528\u4e86\u4e00\u79cd\u5de7\u5999\u7684\u65b9\u5f0f\uff0c\u5e76\u4ee5\u9762\u5411\u5bf9\u8c61\u98ce\u683c\u7684\u4ee3\u7801\uff0c\u7ef4\u62a4\u4e86\u4e00\u4e2a\u5168\u5c40\u5355\u4f8b ",(0,i.jsx)(n.code,{children:"s"}),"\u3002\u5728 Touying \u4e2d\uff0c\u4e00\u4e2a\u5bf9\u8c61\u6307\u62e5\u6709\u81ea\u5df1\u7684\u6210\u5458\u53d8\u91cf\u548c\u65b9\u6cd5\u7684 Typst \u5b57\u5178\uff0c\u5e76\u4e14\u6211\u4eec\u7ea6\u5b9a\u65b9\u6cd5\u5747\u6709\u4e00\u4e2a\u547d\u540d\u53c2\u6570 ",(0,i.jsx)(n.code,{children:"self"})," \u7528\u4e8e\u4f20\u5165\u5bf9\u8c61\u81ea\u8eab\uff0c\u5e76\u4e14\u65b9\u6cd5\u5747\u653e\u5728 ",(0,i.jsx)(n.code,{children:".methods"})," \u57df\u91cc\u3002\u6709\u4e86\u8fd9\u4e2a\u7406\u5ff5\uff0c\u6211\u4eec\u5c31\u4e0d\u96be\u5199\u51fa\u66f4\u65b0 ",(0,i.jsx)(n.code,{children:"info"})," \u7684\u65b9\u6cd5\u4e86\uff1a"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{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,i.jsxs)(n.p,{children:["\u8fd9\u6837\uff0c\u4f60\u4e5f\u80fd\u591f\u7406\u89e3 ",(0,i.jsx)(n.code,{children:"utils.methods()"})," \u51fd\u6570\u7684\u7528\u9014\u4e86\uff1a\u5c06 ",(0,i.jsx)(n.code,{children:"self"})," \u7ed1\u5b9a\u5230 ",(0,i.jsx)(n.code,{children:"s"})," \u7684\u6240\u6709\u65b9\u6cd5\u4e0a\u5e76\u8fd4\u56de\uff0c\u5e76\u901a\u8fc7\u89e3\u5305\u8bed\u6cd5\u7b80\u5316\u540e\u7eed\u7684\u4f7f\u7528\u3002"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let (init, slide, slides) = utils.methods(s)\n"})})]}),"\n",(0,i.jsx)(n.h2,{id:"\u8282\u4e0e\u5c0f\u8282",children:"\u8282\u4e0e\u5c0f\u8282"}),"\n",(0,i.jsx)(n.p,{children:"\u4e0e Beamer \u76f8\u540c\uff0cTouying \u540c\u6837\u6709\u7740 section \u548c subsection \u7684\u6982\u5ff5\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"#show: slides"})," \u6a21\u5f0f\u4e0b\uff0csection \u548c subsection \u5206\u522b\u5bf9\u5e94\u7740\u4e00\u7ea7\u6807\u9898\u548c\u4e8c\u7ea7\u6807\u9898\uff0c\u4f8b\u5982"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, slides) = utils.methods(s)\n#show: init\n\n#show: slides\n\n= Section\n\n== Subsection\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/600876bb-941d-4841-af5c-27137bb04c54",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u4e0d\u8fc7\u4e8c\u7ea7\u6807\u9898\u5e76\u975e\u603b\u662f\u5bf9\u5e94 subsection\uff0c\u5177\u4f53\u7684\u6620\u5c04\u65b9\u5f0f\u56e0\u4e3b\u9898\u800c\u5f02\u3002"}),"\n",(0,i.jsxs)(n.p,{children:["\u800c\u5728\u66f4\u901a\u7528\u7684 ",(0,i.jsx)(n.code,{children:"#slide[..]"})," \u6a21\u5f0f\u4e0b\uff0csection \u548c subsection \u5206\u522b\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165 ",(0,i.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u4e2d\uff0c\u4f8b\u5982"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(section: [Let's start a new section!])[..]\n\n#slide(subsection: [Let's start a new subsection!])[..]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f1a\u5206\u522b\u65b0\u5efa\u4e00\u4e2a section \u548c\u4e00\u4e2a subsection\u3002\u5f53\u7136\uff0c\u8fd9\u79cd\u53d8\u5316\u9ed8\u8ba4\u53ea\u4f1a\u5f71\u54cd\u5230 Touying \u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"sections"})," state\uff0c\u9ed8\u8ba4\u662f\u4e0d\u4f1a\u663e\u793a\u5728 slide \u4e0a\u7684\uff0c\u5177\u4f53\u7684\u663e\u793a\u65b9\u5f0f\u4f9d\u4e3b\u9898\u800c\u5f02\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u6ce8\u610f\uff0c",(0,i.jsx)(n.code,{children:"slide"})," \u7684 ",(0,i.jsx)(n.code,{children:"section"})," \u548c ",(0,i.jsx)(n.code,{children:"subsection"})," \u53c2\u6570\uff0c\u65e2\u80fd\u63a5\u6536\u5185\u5bb9\u5757\uff0c\u4e5f\u80fd\u63a5\u6536\u5f62\u5982 ",(0,i.jsx)(n.code,{children:"([title], [short-title])"})," \u683c\u5f0f\u7684\u6570\u7ec4\uff0c\u6216 ",(0,i.jsx)(n.code,{children:"(title: [title], short-title: [short-title])"})," \u683c\u5f0f\u7684\u5b57\u5178\u3002\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"short-title"})," \u4f1a\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f\u4e0b\u7528\u5230\uff0c\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"dewdrop"})," \u4e3b\u9898\u7684 navigation \u4e2d\u5c06\u4f1a\u7528\u5230\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u76ee\u5f55",children:"\u76ee\u5f55"}),"\n",(0,i.jsx)(n.p,{children:"\u5728 Touying \u4e2d\u663e\u793a\u76ee\u5f55\u5f88\u7b80\u5355\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.2.0": *\n\n#let (init, slide, touying-outline) = utils.methods(s)\n#show: init\n\n#slide[\n == Table of contents\n\n #touying-outline()\n]\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"touying-oultine()"})," \u7684\u5b9a\u4e49\u4e3a\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"enum-args"})," \u4fee\u6539\u5185\u90e8 enum \u7684\u53c2\u6570\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u5982\u679c\u4f60\u5bf9\u76ee\u5f55\u6709\u7740\u590d\u6742\u7684\u81ea\u5b9a\u4e49\u9700\u6c42\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n == Table of contents\n\n #states.touying-final-sections(sections => ..)\n]\n"})}),"\n",(0,i.jsx)(n.h2,{id:"\u9875\u9762\u7ba1\u7406",children:"\u9875\u9762\u7ba1\u7406"}),"\n",(0,i.jsxs)(n.p,{children:["\u7531\u4e8e Typst \u4e2d\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u4f1a\u5bfc\u81f4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9875\u9762\uff0c\u800c\u4e0d\u80fd\u4fee\u6539\u5f53\u524d\u9875\u9762\uff0c\u56e0\u6b64 Touying \u9009\u62e9\u5728\u5355\u4f8b ",(0,i.jsx)(n.code,{children:"s"})," \u4e2d\u7ef4\u62a4\u4e00\u4e2a ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\uff0c\u53ea\u5728\u521b\u5efa\u65b0 slide \u65f6\u624d\u4f1a\u5e94\u7528\u8fd9\u4e9b\u53c2\u6570\u3002"]}),"\n",(0,i.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,i.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u4f60\u4e0d\u5e94\u8be5\u81ea\u5df1\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,i.jsx)(n.code,{children:"s"})," \u5185\u90e8\u7684 ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u3002"]})}),"\n",(0,i.jsxs)(n.p,{children:["\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"s.page-args"})," \u5b9e\u65f6\u67e5\u8be2\u5f53\u524d\u9875\u9762\u7684\u53c2\u6570\uff0c\u8fd9\u5bf9\u4e00\u4e9b\u9700\u8981\u83b7\u53d6\u9875\u8fb9\u8ddd\u6216\u5f53\u524d\u9875\u9762\u80cc\u666f\u989c\u8272\u7684\u51fd\u6570\u5f88\u6709\u7528\uff0c\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"transparent-cover"}),"\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u9875\u9762\u5206\u680f",children:"\u9875\u9762\u5206\u680f"}),"\n",(0,i.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u9700\u8981\u5c06\u9875\u9762\u5206\u4e3a\u4e24\u680f\u6216\u4e09\u680f\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Touying ",(0,i.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u9ed8\u8ba4\u63d0\u4f9b\u7684 ",(0,i.jsx)(n.code,{children:"compose"})," \u529f\u80fd\uff0c\u6700\u7b80\u5355\u7684\u793a\u4f8b\u5982\u4e0b\uff1a"]}),"\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:["\u5982\u679c\u4f60\u9700\u8981\u66f4\u6539\u5206\u680f\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539 ",(0,i.jsx)(n.code,{children:"slide"})," \u7684 ",(0,i.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5176\u4e2d\u9ed8\u8ba4\u7684\u53c2\u6570\u662f ",(0,i.jsx)(n.code,{children:"utils.with.side-by-side(columns: auto, gutter: 1em)"}),"\uff0c\u5982\u679c\u6211\u4eec\u8981\u8ba9\u5de6\u8fb9\u90a3\u4e00\u680f\u5360\u636e\u5269\u4f59\u5bbd\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[\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,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:()=>o,a:()=>d});var i=s(7294);const t={},c=i.createContext(t);function d(e){const n=i.useContext(c);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:d(e.components),i.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/runtime~main.1d08e914.js b/zh/assets/js/runtime~main.e927673b.js similarity index 91% rename from zh/assets/js/runtime~main.1d08e914.js rename to zh/assets/js/runtime~main.e927673b.js index 9aecfa012..eb449e1d0 100644 --- a/zh/assets/js/runtime~main.1d08e914.js +++ b/zh/assets/js/runtime~main.e927673b.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,t,r,c,d={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var t=f[e]={id:e,loaded:!1,exports:{}};return d[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}o.m=d,o.c=f,e=[],o.O=(a,t,r,c)=>{if(!t){var d=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](t[b])))?t.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var d={};a=a||[null,t({}),t([]),t(t)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=t(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(c,d),c},o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,t)=>(o.f[t](e,a),a)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",71:"b08ed549",438:"8c4e5360",635:"5fe8a7d6",703:"6ab64546",1043:"04a36ee2",1431:"35c994aa",1785:"31fc2e15",1934:"f6262a69",2013:"c984ce9d",2046:"fc90ac41",2392:"fafe762b",2535:"814f3328",3085:"1f391b9e",3089:"a6aa9e1f",3604:"77c2c049",3608:"9e4087bc",3712:"2c8659d9",3850:"2a635ef0",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4557:"64a34be6",4599:"a94a4682",4879:"ae8e5624",5022:"3b36ca8e",5332:"8ded3f77",5609:"5035b6a4",5658:"d21a173f",6009:"aa94d6df",6103:"ccc49370",6633:"737adc8d",6639:"08114ca6",7059:"eb154561",7259:"a3a5cdb3",7373:"63dd4865",7414:"393be207",7502:"43883141",7838:"ce05be13",7918:"17896441",8385:"8eb20e8c",8506:"339ee8e1",8518:"a7bd4aaa",8610:"6875c492",8993:"24f6044e",9122:"b885bf58",9183:"2d4a7f47",9661:"5e95c892",9761:"d55b4038",9817:"14eb3368"}[e]||e)+"."+{53:"3ba91ffb",71:"97ea842c",438:"5fdc98ba",635:"5c258295",703:"b59333ef",1043:"8e00bb10",1404:"2f578d87",1431:"391f5cce",1772:"22d645a1",1785:"bbe1529a",1934:"06fafcfe",2013:"610aff79",2046:"8ac7249c",2392:"cabe63a8",2535:"67360812",3085:"fa8680eb",3089:"d410008f",3604:"82beb25b",3608:"8eec8b12",3712:"ac445854",3850:"1c09fa97",4013:"354f3ef2",4195:"52703ab9",4368:"9ecc2e7c",4557:"54f47bf5",4599:"44b2d2fd",4879:"bfad032a",5022:"c1ec8f85",5332:"39e635f8",5609:"ba29a9c9",5658:"b917e6e4",6009:"d35fe2ff",6103:"d9da7455",6633:"83296a3e",6639:"4947aeb3",7059:"4e972827",7259:"d71b2c7d",7373:"23c5760e",7414:"e44f1810",7502:"dc54358b",7838:"7e685a8c",7918:"15723699",8385:"334d6621",8506:"9ca837f0",8518:"f93b23a7",8610:"686aaf2c",8993:"56f4c505",9122:"7923b84a",9183:"15768c44",9661:"17c48d1d",9677:"ea822b9e",9761:"ec380fbb",9817:"21d38987"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",o.l=(e,a,t,d)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/touying/zh/",o.gca=function(e){return e={17896441:"7918",43883141:"7502","935f2afb":"53",b08ed549:"71","8c4e5360":"438","5fe8a7d6":"635","6ab64546":"703","04a36ee2":"1043","35c994aa":"1431","31fc2e15":"1785",f6262a69:"1934",c984ce9d:"2013",fc90ac41:"2046",fafe762b:"2392","814f3328":"2535","1f391b9e":"3085",a6aa9e1f:"3089","77c2c049":"3604","9e4087bc":"3608","2c8659d9":"3712","2a635ef0":"3850","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368","64a34be6":"4557",a94a4682:"4599",ae8e5624:"4879","3b36ca8e":"5022","8ded3f77":"5332","5035b6a4":"5609",d21a173f:"5658",aa94d6df:"6009",ccc49370:"6103","737adc8d":"6633","08114ca6":"6639",eb154561:"7059",a3a5cdb3:"7259","63dd4865":"7373","393be207":"7414",ce05be13:"7838","8eb20e8c":"8385","339ee8e1":"8506",a7bd4aaa:"8518","6875c492":"8610","24f6044e":"8993",b885bf58:"9122","2d4a7f47":"9183","5e95c892":"9661",d55b4038:"9761","14eb3368":"9817"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(a,t)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var d=o.p+o.u(a),f=new Error;o.l(d,(t=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),d=t&&t.target&&t.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+d+")",f.name="ChunkLoadError",f.type=c,f.request=d,r[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,d=t[0],f=t[1],b=t[2],n=0;if(d.some((a=>0!==e[a]))){for(r in f)o.o(f,r)&&(o.m[r]=f[r]);if(b)var i=b(o)}for(a&&a(t);n{"use strict";var e,a,t,r,c,d={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var t=f[e]={id:e,loaded:!1,exports:{}};return d[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}o.m=d,o.c=f,e=[],o.O=(a,t,r,c)=>{if(!t){var d=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](t[b])))?t.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[t,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var d={};a=a||[null,t({}),t([]),t(t)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=t(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(c,d),c},o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,t)=>(o.f[t](e,a),a)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",71:"b08ed549",438:"8c4e5360",635:"5fe8a7d6",703:"6ab64546",1043:"04a36ee2",1431:"35c994aa",1785:"31fc2e15",1934:"f6262a69",2013:"c984ce9d",2046:"fc90ac41",2392:"fafe762b",2535:"814f3328",3085:"1f391b9e",3089:"a6aa9e1f",3604:"77c2c049",3608:"9e4087bc",3712:"2c8659d9",3850:"2a635ef0",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4557:"64a34be6",4599:"a94a4682",4879:"ae8e5624",5022:"3b36ca8e",5332:"8ded3f77",5609:"5035b6a4",5658:"d21a173f",6009:"aa94d6df",6103:"ccc49370",6633:"737adc8d",6639:"08114ca6",7059:"eb154561",7259:"a3a5cdb3",7373:"63dd4865",7414:"393be207",7502:"43883141",7838:"ce05be13",7918:"17896441",8385:"8eb20e8c",8506:"339ee8e1",8518:"a7bd4aaa",8610:"6875c492",8993:"24f6044e",9122:"b885bf58",9183:"2d4a7f47",9661:"5e95c892",9761:"d55b4038",9817:"14eb3368"}[e]||e)+"."+{53:"8fd5cac2",71:"97ea842c",438:"c486956f",635:"5c258295",703:"aefc3306",1043:"8e00bb10",1404:"2f578d87",1431:"391f5cce",1772:"22d645a1",1785:"bbe1529a",1934:"9f62a746",2013:"610aff79",2046:"8ac7249c",2392:"cabe63a8",2535:"67360812",3085:"fa8680eb",3089:"d410008f",3604:"82beb25b",3608:"8eec8b12",3712:"ac445854",3850:"1c09fa97",4013:"354f3ef2",4195:"52703ab9",4368:"9ecc2e7c",4557:"54f47bf5",4599:"44b2d2fd",4879:"bfad032a",5022:"c1ec8f85",5332:"39e635f8",5609:"ba29a9c9",5658:"80dafc04",6009:"d35fe2ff",6103:"d9da7455",6633:"db2503f5",6639:"4947aeb3",7059:"0316d559",7259:"d71b2c7d",7373:"23c5760e",7414:"e44f1810",7502:"970f1684",7838:"fb3adc95",7918:"15723699",8385:"334d6621",8506:"56905318",8518:"f93b23a7",8610:"686aaf2c",8993:"56f4c505",9122:"675e4625",9183:"15768c44",9661:"17c48d1d",9677:"ea822b9e",9761:"ec380fbb",9817:"21d38987"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="docs:",o.l=(e,a,t,d)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/touying/zh/",o.gca=function(e){return e={17896441:"7918",43883141:"7502","935f2afb":"53",b08ed549:"71","8c4e5360":"438","5fe8a7d6":"635","6ab64546":"703","04a36ee2":"1043","35c994aa":"1431","31fc2e15":"1785",f6262a69:"1934",c984ce9d:"2013",fc90ac41:"2046",fafe762b:"2392","814f3328":"2535","1f391b9e":"3085",a6aa9e1f:"3089","77c2c049":"3604","9e4087bc":"3608","2c8659d9":"3712","2a635ef0":"3850","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368","64a34be6":"4557",a94a4682:"4599",ae8e5624:"4879","3b36ca8e":"5022","8ded3f77":"5332","5035b6a4":"5609",d21a173f:"5658",aa94d6df:"6009",ccc49370:"6103","737adc8d":"6633","08114ca6":"6639",eb154561:"7059",a3a5cdb3:"7259","63dd4865":"7373","393be207":"7414",ce05be13:"7838","8eb20e8c":"8385","339ee8e1":"8506",a7bd4aaa:"8518","6875c492":"8610","24f6044e":"8993",b885bf58:"9122","2d4a7f47":"9183","5e95c892":"9661",d55b4038:"9761","14eb3368":"9817"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(a,t)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((t,c)=>r=e[a]=[t,c]));t.push(r[2]=c);var d=o.p+o.u(a),f=new Error;o.l(d,(t=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=t&&("load"===t.type?"missing":t.type),d=t&&t.target&&t.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+d+")",f.name="ChunkLoadError",f.type=c,f.request=d,r[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,t)=>{var r,c,d=t[0],f=t[1],b=t[2],n=0;if(d.some((a=>0!==e[a]))){for(r in f)o.o(f,r)&&(o.m[r]=f[r]);if(b)var i=b(o)}for(a&&a(t);n 历史博文 | Touying - + diff --git a/zh/blog/index.html b/zh/blog/index.html index aa219c80d..1928655d6 100644 --- a/zh/blog/index.html +++ b/zh/blog/index.html @@ -5,7 +5,7 @@ Blog | Touying - + diff --git a/zh/blog/tags/development/index.html b/zh/blog/tags/development/index.html index 88fac5de6..9e4a44c5d 100644 --- a/zh/blog/tags/development/index.html +++ b/zh/blog/tags/development/index.html @@ -5,7 +5,7 @@ 1 篇博文 含有标签「development」 | Touying - + diff --git a/zh/blog/tags/index.html b/zh/blog/tags/index.html index a5479ea0e..17fce5155 100644 --- a/zh/blog/tags/index.html +++ b/zh/blog/tags/index.html @@ -5,7 +5,7 @@ 标签 | Touying - + diff --git a/zh/blog/touying-0-2-0/index.html b/zh/blog/touying-0-2-0/index.html index 0ba1dfe5c..fcd020d1c 100644 --- a/zh/blog/touying-0-2-0/index.html +++ b/zh/blog/touying-0-2-0/index.html @@ -5,7 +5,7 @@ Touying 0.2.0 | Touying - + diff --git a/zh/docs/build-your-own-theme/index.html b/zh/docs/build-your-own-theme/index.html index f83fcd216..587645cb2 100644 --- a/zh/docs/build-your-own-theme/index.html +++ b/zh/docs/build-your-own-theme/index.html @@ -5,7 +5,7 @@ 创建自己的主题 | Touying - + diff --git a/zh/docs/category/dynamic-slides/index.html b/zh/docs/category/dynamic-slides/index.html index 7a298778b..c5b735535 100644 --- a/zh/docs/category/dynamic-slides/index.html +++ b/zh/docs/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/zh/docs/category/external-tools/index.html b/zh/docs/category/external-tools/index.html index 0fb68dbee..4bfa6333d 100644 --- a/zh/docs/category/external-tools/index.html +++ b/zh/docs/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/zh/docs/category/progress/index.html b/zh/docs/category/progress/index.html index 76234d29d..a6cabb507 100644 --- a/zh/docs/category/progress/index.html +++ b/zh/docs/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/zh/docs/category/themes/index.html b/zh/docs/category/themes/index.html index 30e5d2cb8..b07df5a0b 100644 --- a/zh/docs/category/themes/index.html +++ b/zh/docs/category/themes/index.html @@ -5,10 +5,10 @@ Themes | Touying - + - + \ No newline at end of file diff --git a/zh/docs/category/utilities/index.html b/zh/docs/category/utilities/index.html index dacd8e1ea..fa7abdadf 100644 --- a/zh/docs/category/utilities/index.html +++ b/zh/docs/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/zh/docs/changelog/index.html b/zh/docs/changelog/index.html index a0846e5e4..c732b598e 100644 --- a/zh/docs/changelog/index.html +++ b/zh/docs/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/dynamic/complex/index.html b/zh/docs/dynamic/complex/index.html index 5458ceffc..d08f0ef81 100644 --- a/zh/docs/dynamic/complex/index.html +++ b/zh/docs/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + @@ -14,7 +14,8 @@

回调风格的函数

为了避免上文提到的 styledlayout 限制,Touying 利用回调函数巧妙实现了总是能生效的 onlyuncoveralternatives,具体来说,您要这样引入这三个函数:

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

In subslide #self.subslide,

test #uncover("2-")[uncover] function,

and test #only("2-")[only] function,

#pause

and paused text.
])
-

注意到了吗?我们不再是传入一个内容块,而是传入了一个参数为 self 的回调函数,随后我们通过

+

image

+

注意到了吗?我们不再是传入一个内容块,而是传入了一个参数为 self 的回调函数,随后我们通过

#let (uncover, only, alternatives) = utils.methods(self)

self 中取出了 onlyuncoveralternatives 这三个函数,并在后续调用它们。

这里还有一些有趣的事实,例如 int 类型的 self.subslide 指示了当前 subslide 索引,而实际上 onlyuncoveralternatives 函数也正是依赖 self.subslide 实现的获取当前 subslide 索引。

@@ -29,6 +30,7 @@

uncoveralternatives

alternatives 函数表示在不同的 subslides 中展示一系列不同的内容,例如

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

#alternatives[Ann][Bob][Christopher]
likes
#alternatives[chocolate][strawberry][vanilla]
ice cream.
])
+

image

如你所见,alternatives 能够自动撑开到最合适的宽度和高度,这是 onlyuncover 所没有的能力。事实上 alternatives 还有着其他参数,例如 start: 2repeat-last: trueposition: center + horizon 等,更多用法可以参考 Polylux

\ No newline at end of file diff --git a/zh/docs/dynamic/cover/index.html b/zh/docs/dynamic/cover/index.html index 37f8a2f02..8d8fc7318 100644 --- a/zh/docs/dynamic/cover/index.html +++ b/zh/docs/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover 函数 | Touying - + diff --git a/zh/docs/dynamic/equation/index.html b/zh/docs/dynamic/equation/index.html index 9fe3f6194..ecf5f5fed 100644 --- a/zh/docs/dynamic/equation/index.html +++ b/zh/docs/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + @@ -14,12 +14,14 @@

简单动画

让我们先来看一个例子:

#slide[
Touying equation with pause:

#touying-equation(`
f(x) &= pause x^2 + 2x + 1 \
&= pause (x + 1)^2 \
`)

#meanwhile

Touying equation is very simple.
]
+

image

我们使用 touying-equation 函数来实现在数学公式文本内部使用 pausemeanwhile(事实上,你也能用 #pause 或者 #pause;)。

正如你料想的一样,数学公式会分步显示,这很适合给让演讲者演示自己的数学公式推理思路。

警告

虽然 touying-equation 函数很便利,但是您需要时刻注意,touying-equation 并不会做复杂的语法分析,只是单纯地正则表达式分割字符串,因此您不应在 display(..) 这类函数内部使用 pausemeanwhile

复杂动画

事实上,我们也可以在 touying-equation 内部使用 onlyuncoveralternatives,只是需要一点技巧:

#slide(repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

#touying-equation(scope: (uncover: uncover), `
f(x) &= pause x^2 + 2x + uncover("3-", 1) \
&= pause (x + 1)^2 \
`)
])
+

image

我们可以在 touying-equationscope 参数中将我们需要用到的函数传递进去,例如这里的 uncover

参数

touying-equation 的函数定义为

diff --git a/zh/docs/dynamic/handout/index.html b/zh/docs/dynamic/handout/index.html index f9c8d0bab..97772d9f1 100644 --- a/zh/docs/dynamic/handout/index.html +++ b/zh/docs/dynamic/handout/index.html @@ -5,7 +5,7 @@ 创建讲义 | Touying - + diff --git a/zh/docs/dynamic/simple/index.html b/zh/docs/dynamic/simple/index.html index e044fcc26..4e7f03875 100644 --- a/zh/docs/dynamic/simple/index.html +++ b/zh/docs/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + @@ -14,16 +14,19 @@

pause

#pause 的用途很简单,就是用于将后续的内容放到下一张 subslide 中,并且可以使用多个 #pause 以创建多张 subslides,一个简单的例子:

#slide[
First #pause Second

#pause

Third
]
+

image

这个例子将会创建三张 subslides,逐渐地将内容展示出来。

如你所见,#pause 既可以放在行内,也可以放在单独的一行。

meanwhile

有些情况下,我们需要在 #pause 的同时展示一些其他内容,这时候我们就可以用 #meanwhile

#slide[
First

#pause

Second

#meanwhile

Third

#pause

Fourth
]
+

image

这个例子只会创建两张 subslides,并且 "First" 和 "Third" 同时显示,"Second" 和 "Fourth" 同时显示。

如何处理 set-show rules?

如果你在 slide[..] 里面使用了 set-show rules,你会惊讶的发现,在那之后的 #pause#meanwhile 都失效了。这是因为 Touying 无法探知 styled(..) 内部的内容(set-show rules 后的内容会被 styled 囊括起来)。

为了解决这个问题,Touying 为 #slide() 函数提供了一个 setting 参数,你可以将你的 set-show rules 放到 setting 参数里,例如修改字体颜色:

#slide(setting: body => {
set text(fill: blue)
body
})[
First

#pause

Second
]
+

image

同理,Touying 目前也不支持 grid 这类 layout 函数内部的 #pause#meanwhile,也是由于同样的限制,但是你可以使用 #slide()composer 参数,大部分情况下都应该能满足需求。

原理

Touying 不依赖 counterlocate 来实现 #pause,而是用 Typst 脚本写了一个 parser。它会将输入内容块作为 sequence 解析,然后改造重组这个 sequence 为我们需要的一系列 subslides。

diff --git a/zh/docs/external/pdfpc/index.html b/zh/docs/external/pdfpc/index.html index f1d9286b5..7fb04ad4e 100644 --- a/zh/docs/external/pdfpc/index.html +++ b/zh/docs/external/pdfpc/index.html @@ -5,7 +5,7 @@ pdfpc | Touying - + diff --git a/zh/docs/external/typst-preview/index.html b/zh/docs/external/typst-preview/index.html index e7d6f6deb..abf8d68c9 100644 --- a/zh/docs/external/typst-preview/index.html +++ b/zh/docs/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/zh/docs/intro/index.html b/zh/docs/intro/index.html index 79bcfdcb7..1162db48b 100644 --- a/zh/docs/intro/index.html +++ b/zh/docs/intro/index.html @@ -5,7 +5,7 @@ Touying 介绍 | Touying - + diff --git a/zh/docs/layout/index.html b/zh/docs/layout/index.html index e80b74648..7e21bff6e 100644 --- a/zh/docs/layout/index.html +++ b/zh/docs/layout/index.html @@ -5,7 +5,7 @@ 排篇布局 | Touying - + @@ -23,6 +23,7 @@

节与小节与 Beamer 相同,Touying 同样有着 section 和 subsection 的概念。

#show: slides 模式下,section 和 subsection 分别对应着一级标题和二级标题,例如

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Section

== Subsection

Hello, Touying!
+

image

不过二级标题并非总是对应 subsection,具体的映射方式因主题而异。

而在更通用的 #slide[..] 模式下,section 和 subsection 分别作为参数传入 slide 函数中,例如

#slide(section: [Let's start a new section!])[..]

#slide(subsection: [Let's start a new subsection!])[..]
@@ -41,9 +42,11 @@

页面管理
警告

因此,你不应该自己使用 set page(..) 命令,而是应该修改 s 内部的 s.page-args 成员变量。

通过这种方式,我们可以通过 s.page-args 实时查询当前页面的参数,这对一些需要获取页边距或当前页面背景颜色的函数很有用,例如 transparent-cover

页面分栏

-

如果你需要将页面分为两栏或三栏,你可以使用 Touying slide 函数默认提供的 compose 功能,最简单的示例如下:

+

如果你需要将页面分为两栏或三栏,你可以使用 Touying slide 函数默认提供的 compose 功能,最简单的示例如下:

#slide[
First column.
][
Second column.
]
+

image

如果你需要更改分栏的方式,可以修改 slidecomposer 参数,其中默认的参数是 utils.with.side-by-side(columns: auto, gutter: 1em),如果我们要让左边那一栏占据剩余宽度,可以使用

-
#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[
First column.
][
Second column.
]
+
#slide(composer: utils.side-by-side.with(columns: (1fr, auto), gutter: 1em))[
First column.
][
Second column.
]
+

image

\ No newline at end of file diff --git a/zh/docs/progress/counters/index.html b/zh/docs/progress/counters/index.html index c454d9348..f673d0b4c 100644 --- a/zh/docs/progress/counters/index.html +++ b/zh/docs/progress/counters/index.html @@ -5,7 +5,7 @@ Touying 的计数器 | Touying - + diff --git a/zh/docs/progress/sections/index.html b/zh/docs/progress/sections/index.html index cdef463a4..b9530d3d7 100644 --- a/zh/docs/progress/sections/index.html +++ b/zh/docs/progress/sections/index.html @@ -5,7 +5,7 @@ Touying 的 Sections | Touying - + diff --git a/zh/docs/start/index.html b/zh/docs/start/index.html index 763fa80de..9ecf190b4 100644 --- a/zh/docs/start/index.html +++ b/zh/docs/start/index.html @@ -5,7 +5,7 @@ 开始 | Touying - + @@ -13,11 +13,13 @@

在开始之前,请确保您已经安装了 Typst 环境,如果没有,可以使用 Web App 或 VS Code 的 Typst LSPTypst Preview 插件。

要使用 Touying,您只需要在文档里加入

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

这很简单,您创建了您的第一个 Touying slides,恭喜!🎉

更复杂的例子

事实上,Touying 提供了多种 slides 编写风格,例如上面的例子依靠一级和二级标题来划分新 slide,实际上您也可以使用 #slide[..] 的写法,以获得 Touying 提供的更多更强大的功能。

#import "@preview/touying:0.2.0": *

#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide) = utils.methods(s)
#show: init

// simple animations
#slide[
a simple #pause *dynamic*

#pause

slide.

#meanwhile

meanwhile #pause with pause.
][
second #pause pause.
]

// complex animations
#slide(setting: body => {
set text(fill: blue)
body
}, repeat: 3, self => [
#let (uncover, only, alternatives) = utils.methods(self)

in subslide #self.subslide

test #uncover("2-")[uncover] function

test #only("2-")[only] function

#pause

and paused text.
])

// math equation animations
#slide[
== Touying Equation

#touying-equation(`
f(x) &= pause x^2 + 2x + 1 \
&= pause (x + 1)^2 \
`)

#meanwhile

Touying equation is very simple.
]

// multiple pages for one slide
#slide[
== Multiple Pages for One Slide

#lorem(200)
]

// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide,) = utils.methods(s)

#slide[
== Appendix
]
-

除此之外,Touying 还提供了很多内置的主题,能够简单地编写精美的 slides,基本上,您只需要在文档顶部加入一行

+

image

+

除此之外,Touying 还提供了很多内置的主题,能够简单地编写精美的 slides,基本上,您只需要在文档顶部加入一行

#let s = themes.metropolis.register(s, aspect-ratio: "16-9")

即可使用 metropolis 主题。关于更详细的教程,您可以参阅后面的章节。

diff --git a/zh/docs/style/index.html b/zh/docs/style/index.html index 7d3ded4b7..0119db7c1 100644 --- a/zh/docs/style/index.html +++ b/zh/docs/style/index.html @@ -5,7 +5,7 @@ 代码风格 | Touying - + @@ -14,6 +14,8 @@

show-slid

如果我们只是需要简单使用,我们可以通过 #show: slides 实现更简洁的语法。

但是这样做也有对应的弊端:第一个弊端是这种方式可能会极大地影响文档渲染性能,第二个弊端是后续不能直接加入 #slide(..),而是需要手动标记 #slides-end,以及最大的弊端是实现不了复杂的功能。

#import "@preview/touying:0.2.0": *

#let (init, slide, slides) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

#slides-end

#slide[
A new slide.
]
+

image

+

并且你可以使用空标题 == 创建一个新页。

slide-block 风格

为了更优秀的性能和更强大的能力,大部分情况我们还是需要使用

#slide[
A new slide.
]
diff --git a/zh/docs/themes/dewdrop/index.html b/zh/docs/themes/dewdrop/index.html index 7482fd15a..f8c4f1e54 100644 --- a/zh/docs/themes/dewdrop/index.html +++ b/zh/docs/themes/dewdrop/index.html @@ -3,18 +3,19 @@ -Dewdrop 主题 | Touying +Dewdrop 主题 | Touying - +

Dewdrop 主题

+

image

这个主题的灵感来自 Zhibo Wang 创作的 BeamerTheme,由 OrangeX4 改造而来。

这个主题拥有优雅美观的 navigation,包括 sidebarmini-slides 两种模式。

初始化

你可以通过下面的代码来初始化:

-
#import "@preview/touying:0.2.0": *

#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
// navigation: "sidebar",
// navigation: none,
)
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert
+
#import "@preview/touying:0.2.0": *

#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
// navigation: "sidebar",
// navigation: none,
)
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

其中 register 接收参数:

  • aspect-ratio: 幻灯片的长宽比为 "16-9" 或 "4-3",默认为 "16-9"。
  • @@ -41,10 +42,10 @@

    颜色主题slide 函数族

    Dewdrop 主题提供了一系列自定义 slide 函数:

    #title-slide(extra: none, ..args)
    -

    title-slide 会读取 self.info 里的信息用于显示,你也可以为其传入 extra 参数,显示额外的信息。

    +

    title-slide 会读取 self.info 里的信息用于显示,你也可以为其传入 extra 参数,显示额外的信息。


    #slide(
    repeat: auto,
    setting: body => body,
    composer: utils.side-by-side,
    section: none,
    subsection: none,
    // Dewdrop theme
    footer: auto,
    )[
    ...
    ]
    -

    默认拥有导航栏和页脚的普通 slide 函数,页脚为您设置的页脚。

    +

    默认拥有导航栏和页脚的普通 slide 函数,页脚为您设置的页脚。


    #focus-slide[
    ...
    ]

    用于引起观众的注意力。背景色为 self.colors.primary

    @@ -66,7 +67,8 @@

    slides

    可以通过 #show: slides.with(..) 的方式设置。

    #import "@preview/touying:0.2.0": *

    #let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop])
    #let s = (s.methods.info)(
    self: s,
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    )
    #let s = (s.methods.enable-transparent-cover)(self: s)
    #let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
    #show: init

    #show strong: alert

    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!
    -

    示例

    +

    image

    +

    示例

    #import "@preview/touying:0.2.0": *

    #let s = themes.dewdrop.register(
    s,
    aspect-ratio: "16-9",
    footer: [Dewdrop],
    navigation: "mini-slides",
    // navigation: "sidebar",
    // navigation: none,
    )
    #let s = (s.methods.info)(
    self: s,
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    )
    #let s = (s.methods.enable-transparent-cover)(self: s)
    // #let s = (s.methods.appendix-in-outline)(self: s, false)
    #let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
    #show: init

    #show strong: alert

    #title-slide()

    #slide[
    == Outline

    #touying-outline(cover: false)
    ]

    #slide(section: [Section A])[
    == Outline

    #touying-outline()
    ]

    #slide(subsection: [Subsection A.1])[
    == Title

    A slide with equation:

    $ x_(n+1) = (x_n + a/x_n) / 2 $
    ]

    #slide(subsection: [Subsection A.2])[
    == Important

    A slide without a title but with *important* infos
    ]

    #slide(section: [Section B])[
    == Outline

    #touying-outline()
    ]

    #slide(subsection: [Subsection B.1])[
    == Another Subsection

    #lorem(80)
    ]

    #focus-slide[
    Wake up!
    ]

    // simple animations
    #slide(subsection: [Subsection B.2])[
    == Dynamic

    a simple #pause dynamic slide with #alert[alert]

    #pause

    text.
    ]

    // appendix by freezing last-slide-number
    #let s = (s.methods.appendix)(self: s)
    #let (slide,) = utils.methods(s)

    #slide(section: [Appendix])[
    == Outline

    #touying-outline()
    ]

    #slide[
    appendix
    ]

\ No newline at end of file diff --git a/zh/docs/themes/metropolis/index.html b/zh/docs/themes/metropolis/index.html index c6056a0f0..6f7cfe3ea 100644 --- a/zh/docs/themes/metropolis/index.html +++ b/zh/docs/themes/metropolis/index.html @@ -3,13 +3,14 @@ -Metropolis 主题 | Touying +Metropolis 主题 | Touying - +

Metropolis 主题

+

image

这个主题的灵感来自 Matthias Vogelgesang 创作的 Metropolis beamer 主题,由 Enivex 改造而来。

这个主题美观大方,很适合日常使用,并且你最好在电脑上安装 Fira Sans 和 Fira Math 字体,以取得最佳效果。

初始化

@@ -50,6 +51,7 @@

slides

可以通过 #show: slides.with(..) 的方式设置。

#import "@preview/touying:0.2.0": *

#let s = themes.metropolis.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

示例

#import "@preview/touying:0.2.0": *

#let s = themes.metropolis.register(s, 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 s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#title-slide(extra: [Extra])

#slide(title: [Table of contents])[
#touying-outline()
]

#slide(title: [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])[
A slide with some maths:
$ x_(n+1) = (x_n + a/x_n) / 2 $

#lorem(200)
]

#new-section-slide[First section]

#slide[
A slide without a title but with *important* infos
]

#new-section-slide[Second section]

#focus-slide[
Wake up!
]

// simple animations
#slide[
a simple #pause dynamic slide with #alert[alert]

#pause

text.
]

// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide, new-section-slide) = utils.methods(s)

#new-section-slide[Appendix]

#slide[
appendix
]

diff --git a/zh/docs/themes/simple/index.html b/zh/docs/themes/simple/index.html index 5c89439c2..2195b53be 100644 --- a/zh/docs/themes/simple/index.html +++ b/zh/docs/themes/simple/index.html @@ -3,13 +3,14 @@ -Simple 主题 | Touying +Simple 主题 | Touying - +

Simple 主题

+

image

这个主题来源于 Polylux,作者是 Andreas Kröpelin。

这个主题被认为是一个相对简单的主题,你可以用它来创建一个简单 slides,并且可以随意加入你喜欢的功能。

初始化

@@ -37,8 +38,9 @@

slide 函数
#focus-slide(foreground: ..., background: ...)[
...
]

用于引起观众的注意力。可选接受一个前景色 (默认为 white) 和一个背景色 (默认为 auto,即 self.colors.primary)。

-

slides 函数

+

slides 函数

#import "@preview/touying:0.2.0": *

#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)
#show: init

#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+

image

示例

#import "@preview/touying:0.2.0": *

#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, centered-slide, focus-slide) = utils.methods(s)
#show: init

#title-slide[
= Keep it simple!
#v(2em)

Alpha #footnote[Uni Augsburg] #h(1em)
Bravo #footnote[Uni Bayreuth] #h(1em)
Charlie #footnote[Uni Chemnitz] #h(1em)

July 23
]

#slide[
== First slide

#lorem(20)
]

#focus-slide[
_Focus!_

This is very important.
]

#centered-slide(section: [Let's start a new section!])

#slide[
== Dynamic slide
Did you know that...

#pause
...you can see the current section at the top of the slide?
]
diff --git a/zh/docs/utilities/fit-to/index.html b/zh/docs/utilities/fit-to/index.html index 760006038..8e6ca1b1a 100644 --- a/zh/docs/utilities/fit-to/index.html +++ b/zh/docs/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to height / width | Touying - + @@ -13,7 +13,7 @@

感谢 ntjess 的代码。

Fit to height

如果你需要将图片占满剩余的 slide 高度,你可以来试试 fit-to-height 函数:

-
#fit-to-height(1fr)[BIG]
+
#utils.fit-to-height(1fr)[BIG]

函数定义:

#let fit-to-height(
width: none, prescale-width: none, grow: true, shrink: true, height, body
) = { .. }

参数:

@@ -27,7 +27,7 @@

Fit to height<

Fit to width

如果你需要限制标题宽度刚好占满 slide 的宽度,你可以来试试 fit-to-width 函数:

-
#fit-to-width(1fr)[#lorem(20)]
+
#utils.fit-to-width(1fr)[#lorem(20)]

函数定义:

#let fit-to-width(grow: true, shrink: true, width, body) = { .. }

参数:

diff --git a/zh/docs/utilities/oop/index.html b/zh/docs/utilities/oop/index.html index b37ac7c3d..cacc8430c 100644 --- a/zh/docs/utilities/oop/index.html +++ b/zh/docs/utilities/oop/index.html @@ -5,7 +5,7 @@ 面向对象编程 | Touying - + diff --git a/zh/index.html b/zh/index.html index 846318373..e5478bef0 100644 --- a/zh/index.html +++ b/zh/index.html @@ -5,7 +5,7 @@ Touying in Typst | Touying - + diff --git a/zh/markdown-page/index.html b/zh/markdown-page/index.html index 3c4cf644e..12c6cd7ae 100644 --- a/zh/markdown-page/index.html +++ b/zh/markdown-page/index.html @@ -5,7 +5,7 @@ Markdown page example | Touying - +