From 99ad78f9c229022d5a616e6c4cdf2ddbf622f0e3 Mon Sep 17 00:00:00 2001 From: OrangeX4 <34951714+OrangeX4@users.noreply.github.com> Date: Mon, 13 May 2024 04:00:04 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20touying-?= =?UTF-8?q?typ/touying@56a5638bcb29aa4ee600519ed461bc5c8527dc10=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 +- .../{0d1c87af.abe48754.js => 0d1c87af.1af163d0.js} | 2 +- .../{293f9c83.e2d4c498.js => 293f9c83.3b48b842.js} | 2 +- .../{39430005.39096450.js => 39430005.282e5018.js} | 2 +- .../{3f2877b5.be6b644a.js => 3f2877b5.4796c932.js} | 2 +- .../{472f8a66.c4719110.js => 472f8a66.6827c4cb.js} | 2 +- .../{5057383c.7a48ca40.js => 5057383c.ecf8e775.js} | 2 +- .../{55b57bd3.afd6b9b2.js => 55b57bd3.648f91c3.js} | 2 +- .../{5670b452.b5eb8c1f.js => 5670b452.5f7a58b6.js} | 2 +- .../{5a57e638.6764a52d.js => 5a57e638.e978d988.js} | 2 +- .../{6607fcb6.18359e4f.js => 6607fcb6.4d9db996.js} | 2 +- .../{7d3539b2.b4866903.js => 7d3539b2.06b94f08.js} | 2 +- .../{7f65dfb7.e0a5ac39.js => 7f65dfb7.26d35ace.js} | 2 +- .../{80a0c88e.a9a1492a.js => 80a0c88e.b733f954.js} | 2 +- .../{8ac96054.67767120.js => 8ac96054.96187a17.js} | 2 +- .../{98ce8162.0db38a50.js => 98ce8162.287e62b5.js} | 2 +- .../{ab32da60.1d07324a.js => ab32da60.7b00de2b.js} | 2 +- .../{c38df086.3a34d537.js => c38df086.21aead31.js} | 2 +- .../{d16cbc15.e70ad829.js => d16cbc15.5450aa44.js} | 2 +- .../{d287f9e6.06a655ad.js => d287f9e6.1b25ce7b.js} | 2 +- .../{f3a7b3b2.232f5b0b.js => f3a7b3b2.b1e52f6b.js} | 2 +- ...e~main.939ad99e.js => runtime~main.9eada2e8.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/0.2.x/build-your-own-theme/index.html | 2 +- docs/0.2.x/category/dynamic-slides/index.html | 2 +- docs/0.2.x/category/external-tools/index.html | 2 +- docs/0.2.x/category/progress/index.html | 2 +- docs/0.2.x/category/themes/index.html | 2 +- docs/0.2.x/category/utilities/index.html | 2 +- docs/0.2.x/changelog/index.html | 2 +- docs/0.2.x/dynamic/complex/index.html | 2 +- docs/0.2.x/dynamic/cover/index.html | 2 +- docs/0.2.x/dynamic/equation/index.html | 2 +- docs/0.2.x/dynamic/handout/index.html | 2 +- docs/0.2.x/dynamic/other/index.html | 2 +- docs/0.2.x/dynamic/simple/index.html | 2 +- docs/0.2.x/external/pdfpc/index.html | 2 +- docs/0.2.x/external/typst-preview/index.html | 2 +- docs/0.2.x/intro/index.html | 2 +- docs/0.2.x/layout/index.html | 2 +- docs/0.2.x/progress/counters/index.html | 2 +- docs/0.2.x/progress/sections/index.html | 2 +- docs/0.2.x/start/index.html | 2 +- docs/0.2.x/style/index.html | 2 +- docs/0.2.x/themes/dewdrop/index.html | 2 +- docs/0.2.x/themes/metropolis/index.html | 2 +- docs/0.2.x/themes/simple/index.html | 2 +- docs/0.2.x/themes/university/index.html | 2 +- docs/0.2.x/utilities/fit-to/index.html | 2 +- docs/0.2.x/utilities/oop/index.html | 2 +- docs/0.3.2+/build-your-own-theme/index.html | 2 +- docs/0.3.2+/category/dynamic-slides/index.html | 2 +- docs/0.3.2+/category/external-tools/index.html | 2 +- .../0.3.2+/category/package-integration/index.html | 2 +- docs/0.3.2+/category/progress/index.html | 2 +- docs/0.3.2+/category/themes/index.html | 2 +- docs/0.3.2+/category/utilities/index.html | 2 +- docs/0.3.2+/changelog/index.html | 2 +- docs/0.3.2+/code-styles/index.html | 2 +- docs/0.3.2+/dynamic/complex/index.html | 2 +- docs/0.3.2+/dynamic/cover/index.html | 2 +- docs/0.3.2+/dynamic/equation/index.html | 2 +- docs/0.3.2+/dynamic/handout/index.html | 2 +- docs/0.3.2+/dynamic/other/index.html | 2 +- docs/0.3.2+/dynamic/simple/index.html | 2 +- docs/0.3.2+/external/pdfpc/index.html | 2 +- docs/0.3.2+/external/typst-preview/index.html | 2 +- docs/0.3.2+/global-settings/index.html | 2 +- docs/0.3.2+/integration/cetz/index.html | 2 +- docs/0.3.2+/integration/codly/index.html | 2 +- docs/0.3.2+/integration/fletcher/index.html | 2 +- docs/0.3.2+/integration/mitex/index.html | 2 +- docs/0.3.2+/integration/pinit/index.html | 2 +- docs/0.3.2+/integration/polylux/index.html | 2 +- docs/0.3.2+/intro/index.html | 2 +- docs/0.3.2+/layout/index.html | 2 +- docs/0.3.2+/progress/counters/index.html | 2 +- docs/0.3.2+/progress/sections/index.html | 2 +- docs/0.3.2+/sections/index.html | 2 +- docs/0.3.2+/start/index.html | 2 +- docs/0.3.2+/themes/aqua/index.html | 2 +- docs/0.3.2+/themes/dewdrop/index.html | 2 +- docs/0.3.2+/themes/metropolis/index.html | 2 +- docs/0.3.2+/themes/simple/index.html | 2 +- docs/0.3.2+/themes/university/index.html | 2 +- docs/0.3.2+/utilities/fit-to/index.html | 2 +- docs/0.3.2+/utilities/oop/index.html | 2 +- docs/0.3.x/build-your-own-theme/index.html | 2 +- docs/0.3.x/category/dynamic-slides/index.html | 2 +- docs/0.3.x/category/external-tools/index.html | 2 +- docs/0.3.x/category/package-integration/index.html | 2 +- docs/0.3.x/category/progress/index.html | 2 +- docs/0.3.x/category/themes/index.html | 2 +- docs/0.3.x/category/utilities/index.html | 2 +- docs/0.3.x/changelog/index.html | 2 +- docs/0.3.x/code-styles/index.html | 2 +- docs/0.3.x/dynamic/complex/index.html | 2 +- docs/0.3.x/dynamic/cover/index.html | 2 +- docs/0.3.x/dynamic/equation/index.html | 2 +- docs/0.3.x/dynamic/handout/index.html | 2 +- docs/0.3.x/dynamic/other/index.html | 2 +- docs/0.3.x/dynamic/simple/index.html | 2 +- docs/0.3.x/external/pdfpc/index.html | 2 +- docs/0.3.x/external/typst-preview/index.html | 2 +- docs/0.3.x/global-settings/index.html | 2 +- docs/0.3.x/integration/cetz/index.html | 2 +- docs/0.3.x/integration/codly/index.html | 2 +- docs/0.3.x/integration/fletcher/index.html | 2 +- docs/0.3.x/integration/mitex/index.html | 2 +- docs/0.3.x/integration/pinit/index.html | 2 +- docs/0.3.x/integration/polylux/index.html | 2 +- docs/0.3.x/intro/index.html | 2 +- docs/0.3.x/layout/index.html | 2 +- docs/0.3.x/progress/counters/index.html | 2 +- docs/0.3.x/progress/sections/index.html | 2 +- docs/0.3.x/sections/index.html | 2 +- docs/0.3.x/start/index.html | 2 +- docs/0.3.x/themes/dewdrop/index.html | 2 +- docs/0.3.x/themes/metropolis/index.html | 2 +- docs/0.3.x/themes/simple/index.html | 2 +- docs/0.3.x/themes/university/index.html | 2 +- docs/0.3.x/utilities/fit-to/index.html | 2 +- docs/0.3.x/utilities/oop/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/package-integration/index.html | 2 +- docs/category/progress/index.html | 2 +- docs/category/themes/index.html | 2 +- docs/category/utilities/index.html | 2 +- docs/changelog/index.html | 2 +- docs/code-styles/index.html | 2 +- docs/dynamic/complex/index.html | 2 +- docs/dynamic/cover/index.html | 2 +- docs/dynamic/equation/index.html | 2 +- docs/dynamic/handout/index.html | 2 +- docs/dynamic/other/index.html | 2 +- docs/dynamic/simple/index.html | 2 +- docs/external/pdfpc/index.html | 2 +- docs/external/typst-preview/index.html | 2 +- docs/global-settings/index.html | 2 +- docs/integration/cetz/index.html | 2 +- docs/integration/codly/index.html | 2 +- docs/integration/ctheorems/index.html | 2 +- docs/integration/fletcher/index.html | 2 +- docs/integration/mitex/index.html | 2 +- docs/integration/pinit/index.html | 2 +- docs/intro/index.html | 2 +- docs/layout/index.html | 2 +- docs/multi-file/index.html | 2 +- docs/next/build-your-own-theme/index.html | 14 +++++++------- docs/next/category/dynamic-slides/index.html | 2 +- docs/next/category/external-tools/index.html | 2 +- docs/next/category/package-integration/index.html | 2 +- docs/next/category/progress/index.html | 2 +- docs/next/category/themes/index.html | 2 +- docs/next/category/utilities/index.html | 2 +- docs/next/changelog/index.html | 2 +- docs/next/code-styles/index.html | 12 ++++++------ docs/next/dynamic/complex/index.html | 2 +- docs/next/dynamic/cover/index.html | 2 +- docs/next/dynamic/equation/index.html | 2 +- docs/next/dynamic/handout/index.html | 2 +- docs/next/dynamic/other/index.html | 4 ++-- docs/next/dynamic/simple/index.html | 2 +- docs/next/external/pdfpc/index.html | 4 ++-- docs/next/external/pympress/index.html | 4 ++-- docs/next/external/typst-preview/index.html | 2 +- docs/next/global-settings/index.html | 4 ++-- docs/next/integration/cetz/index.html | 4 ++-- docs/next/integration/codly/index.html | 4 ++-- docs/next/integration/ctheorems/index.html | 4 ++-- docs/next/integration/fletcher/index.html | 4 ++-- docs/next/integration/mitex/index.html | 2 +- docs/next/integration/pinit/index.html | 4 ++-- docs/next/intro/index.html | 2 +- docs/next/layout/index.html | 4 ++-- docs/next/multi-file/index.html | 4 ++-- docs/next/progress/counters/index.html | 2 +- docs/next/progress/sections/index.html | 2 +- docs/next/sections/index.html | 8 ++++---- docs/next/start/index.html | 6 +++--- docs/next/themes/aqua/index.html | 8 ++++---- docs/next/themes/dewdrop/index.html | 8 ++++---- docs/next/themes/metropolis/index.html | 8 ++++---- docs/next/themes/simple/index.html | 8 ++++---- docs/next/themes/university/index.html | 8 ++++---- docs/next/utilities/fit-to/index.html | 2 +- docs/next/utilities/oop/index.html | 2 +- docs/progress/counters/index.html | 2 +- docs/progress/sections/index.html | 2 +- docs/sections/index.html | 2 +- docs/start/index.html | 2 +- docs/themes/aqua/index.html | 2 +- docs/themes/dewdrop/index.html | 2 +- docs/themes/metropolis/index.html | 2 +- docs/themes/simple/index.html | 2 +- docs/themes/university/index.html | 2 +- docs/utilities/fit-to/index.html | 2 +- docs/utilities/oop/index.html | 2 +- index.html | 2 +- markdown-page/index.html | 2 +- zh/404.html | 2 +- .../{20f452e9.e3e69eea.js => 20f452e9.325ef419.js} | 2 +- .../{24f6044e.c0a225e3.js => 24f6044e.a1e6abc1.js} | 2 +- .../{2e03f7f4.db446fe7.js => 2e03f7f4.fb84fa15.js} | 2 +- .../{339ee8e1.1ca78cd1.js => 339ee8e1.ed73a73c.js} | 2 +- .../{4c00a561.5599e7c7.js => 4c00a561.cd87c5af.js} | 2 +- .../{4e00a773.48847e29.js => 4e00a773.3e811cce.js} | 2 +- .../{5bb6c1c3.e9427874.js => 5bb6c1c3.a5d8e1de.js} | 2 +- .../{63dd4865.198592be.js => 63dd4865.5dfda47d.js} | 2 +- .../{69a95a34.7e93bac1.js => 69a95a34.21772d20.js} | 2 +- .../{6a503890.a8a90c97.js => 6a503890.006bba1f.js} | 2 +- .../{af355bab.d5c4fd47.js => af355bab.66334ddd.js} | 2 +- .../{c1d231e7.f8986a62.js => c1d231e7.bf9f8f1d.js} | 2 +- .../{cad84648.b55e6b76.js => cad84648.b13c687b.js} | 2 +- .../{ce05be13.d146487d.js => ce05be13.0aaa020d.js} | 2 +- .../{cf8983c6.1aa64ff4.js => cf8983c6.c3daa6dd.js} | 2 +- .../{d21a173f.cc1ad8e5.js => d21a173f.7cd6da87.js} | 2 +- .../{d5c687ae.f3c48789.js => d5c687ae.ed5869dd.js} | 2 +- .../{df8eaafd.cabf2352.js => df8eaafd.ae76ca45.js} | 2 +- .../{eb154561.3748b647.js => eb154561.c8a2a8cd.js} | 2 +- .../{f6262a69.3858054e.js => f6262a69.761f978e.js} | 2 +- ...e~main.48acb82a.js => runtime~main.b12474e6.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/0.2.x/build-your-own-theme/index.html | 2 +- zh/docs/0.2.x/category/dynamic-slides/index.html | 2 +- zh/docs/0.2.x/category/external-tools/index.html | 2 +- zh/docs/0.2.x/category/progress/index.html | 2 +- zh/docs/0.2.x/category/themes/index.html | 2 +- zh/docs/0.2.x/category/utilities/index.html | 2 +- zh/docs/0.2.x/changelog/index.html | 2 +- zh/docs/0.2.x/dynamic/complex/index.html | 2 +- zh/docs/0.2.x/dynamic/cover/index.html | 2 +- zh/docs/0.2.x/dynamic/equation/index.html | 2 +- zh/docs/0.2.x/dynamic/handout/index.html | 2 +- zh/docs/0.2.x/dynamic/other/index.html | 2 +- zh/docs/0.2.x/dynamic/simple/index.html | 2 +- zh/docs/0.2.x/external/pdfpc/index.html | 2 +- zh/docs/0.2.x/external/typst-preview/index.html | 2 +- zh/docs/0.2.x/intro/index.html | 2 +- zh/docs/0.2.x/layout/index.html | 2 +- zh/docs/0.2.x/progress/counters/index.html | 2 +- zh/docs/0.2.x/progress/sections/index.html | 2 +- zh/docs/0.2.x/start/index.html | 2 +- zh/docs/0.2.x/style/index.html | 2 +- zh/docs/0.2.x/themes/dewdrop/index.html | 2 +- zh/docs/0.2.x/themes/metropolis/index.html | 2 +- zh/docs/0.2.x/themes/simple/index.html | 2 +- zh/docs/0.2.x/themes/university/index.html | 2 +- zh/docs/0.2.x/utilities/fit-to/index.html | 2 +- zh/docs/0.2.x/utilities/oop/index.html | 2 +- zh/docs/0.3.2+/build-your-own-theme/index.html | 2 +- zh/docs/0.3.2+/category/dynamic-slides/index.html | 2 +- zh/docs/0.3.2+/category/external-tools/index.html | 2 +- .../0.3.2+/category/package-integration/index.html | 2 +- zh/docs/0.3.2+/category/progress/index.html | 2 +- zh/docs/0.3.2+/category/themes/index.html | 2 +- zh/docs/0.3.2+/category/utilities/index.html | 2 +- zh/docs/0.3.2+/changelog/index.html | 2 +- zh/docs/0.3.2+/code-styles/index.html | 2 +- zh/docs/0.3.2+/dynamic/complex/index.html | 2 +- zh/docs/0.3.2+/dynamic/cover/index.html | 2 +- zh/docs/0.3.2+/dynamic/equation/index.html | 2 +- zh/docs/0.3.2+/dynamic/handout/index.html | 2 +- zh/docs/0.3.2+/dynamic/other/index.html | 2 +- zh/docs/0.3.2+/dynamic/simple/index.html | 2 +- zh/docs/0.3.2+/external/pdfpc/index.html | 2 +- zh/docs/0.3.2+/external/typst-preview/index.html | 2 +- zh/docs/0.3.2+/global-settings/index.html | 2 +- zh/docs/0.3.2+/integration/cetz/index.html | 2 +- zh/docs/0.3.2+/integration/codly/index.html | 2 +- zh/docs/0.3.2+/integration/fletcher/index.html | 2 +- zh/docs/0.3.2+/integration/mitex/index.html | 2 +- zh/docs/0.3.2+/integration/pinit/index.html | 2 +- zh/docs/0.3.2+/integration/polylux/index.html | 2 +- zh/docs/0.3.2+/intro/index.html | 2 +- zh/docs/0.3.2+/layout/index.html | 2 +- zh/docs/0.3.2+/progress/counters/index.html | 2 +- zh/docs/0.3.2+/progress/sections/index.html | 2 +- zh/docs/0.3.2+/sections/index.html | 2 +- zh/docs/0.3.2+/start/index.html | 2 +- zh/docs/0.3.2+/themes/aqua/index.html | 2 +- zh/docs/0.3.2+/themes/dewdrop/index.html | 2 +- zh/docs/0.3.2+/themes/metropolis/index.html | 2 +- zh/docs/0.3.2+/themes/simple/index.html | 2 +- zh/docs/0.3.2+/themes/university/index.html | 2 +- zh/docs/0.3.2+/utilities/fit-to/index.html | 2 +- zh/docs/0.3.2+/utilities/oop/index.html | 2 +- zh/docs/0.3.x/build-your-own-theme/index.html | 2 +- zh/docs/0.3.x/category/dynamic-slides/index.html | 2 +- zh/docs/0.3.x/category/external-tools/index.html | 2 +- .../0.3.x/category/package-integration/index.html | 2 +- zh/docs/0.3.x/category/progress/index.html | 2 +- zh/docs/0.3.x/category/themes/index.html | 2 +- zh/docs/0.3.x/category/utilities/index.html | 2 +- zh/docs/0.3.x/changelog/index.html | 2 +- zh/docs/0.3.x/code-styles/index.html | 2 +- zh/docs/0.3.x/dynamic/complex/index.html | 2 +- zh/docs/0.3.x/dynamic/cover/index.html | 2 +- zh/docs/0.3.x/dynamic/equation/index.html | 2 +- zh/docs/0.3.x/dynamic/handout/index.html | 2 +- zh/docs/0.3.x/dynamic/other/index.html | 2 +- zh/docs/0.3.x/dynamic/simple/index.html | 2 +- zh/docs/0.3.x/external/pdfpc/index.html | 2 +- zh/docs/0.3.x/external/typst-preview/index.html | 2 +- zh/docs/0.3.x/global-settings/index.html | 2 +- zh/docs/0.3.x/integration/cetz/index.html | 2 +- zh/docs/0.3.x/integration/codly/index.html | 2 +- zh/docs/0.3.x/integration/fletcher/index.html | 2 +- zh/docs/0.3.x/integration/mitex/index.html | 2 +- zh/docs/0.3.x/integration/pinit/index.html | 2 +- zh/docs/0.3.x/integration/polylux/index.html | 2 +- zh/docs/0.3.x/intro/index.html | 2 +- zh/docs/0.3.x/layout/index.html | 2 +- zh/docs/0.3.x/progress/counters/index.html | 2 +- zh/docs/0.3.x/progress/sections/index.html | 2 +- zh/docs/0.3.x/sections/index.html | 2 +- zh/docs/0.3.x/start/index.html | 2 +- zh/docs/0.3.x/themes/dewdrop/index.html | 2 +- zh/docs/0.3.x/themes/metropolis/index.html | 2 +- zh/docs/0.3.x/themes/simple/index.html | 2 +- zh/docs/0.3.x/themes/university/index.html | 2 +- zh/docs/0.3.x/utilities/fit-to/index.html | 2 +- zh/docs/0.3.x/utilities/oop/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/package-integration/index.html | 2 +- zh/docs/category/progress/index.html | 2 +- zh/docs/category/themes/index.html | 2 +- zh/docs/category/utilities/index.html | 2 +- zh/docs/changelog/index.html | 2 +- zh/docs/code-styles/index.html | 2 +- zh/docs/dynamic/complex/index.html | 2 +- zh/docs/dynamic/cover/index.html | 2 +- zh/docs/dynamic/equation/index.html | 2 +- zh/docs/dynamic/handout/index.html | 2 +- zh/docs/dynamic/other/index.html | 2 +- zh/docs/dynamic/simple/index.html | 2 +- zh/docs/external/pdfpc/index.html | 2 +- zh/docs/external/typst-preview/index.html | 2 +- zh/docs/global-settings/index.html | 2 +- zh/docs/integration/cetz/index.html | 2 +- zh/docs/integration/codly/index.html | 2 +- zh/docs/integration/ctheorems/index.html | 2 +- zh/docs/integration/fletcher/index.html | 2 +- zh/docs/integration/mitex/index.html | 2 +- zh/docs/integration/pinit/index.html | 2 +- zh/docs/intro/index.html | 2 +- zh/docs/layout/index.html | 2 +- zh/docs/multi-file/index.html | 2 +- zh/docs/next/build-your-own-theme/index.html | 14 +++++++------- zh/docs/next/category/dynamic-slides/index.html | 2 +- zh/docs/next/category/external-tools/index.html | 2 +- .../next/category/package-integration/index.html | 2 +- zh/docs/next/category/progress/index.html | 2 +- zh/docs/next/category/themes/index.html | 2 +- zh/docs/next/category/utilities/index.html | 2 +- zh/docs/next/changelog/index.html | 2 +- zh/docs/next/code-styles/index.html | 12 ++++++------ zh/docs/next/dynamic/complex/index.html | 2 +- zh/docs/next/dynamic/cover/index.html | 2 +- zh/docs/next/dynamic/equation/index.html | 2 +- zh/docs/next/dynamic/handout/index.html | 2 +- zh/docs/next/dynamic/other/index.html | 4 ++-- zh/docs/next/dynamic/simple/index.html | 2 +- zh/docs/next/external/pdfpc/index.html | 4 ++-- zh/docs/next/external/pympress/index.html | 4 ++-- zh/docs/next/external/typst-preview/index.html | 2 +- zh/docs/next/global-settings/index.html | 4 ++-- zh/docs/next/integration/cetz/index.html | 4 ++-- zh/docs/next/integration/codly/index.html | 4 ++-- zh/docs/next/integration/ctheorems/index.html | 4 ++-- zh/docs/next/integration/fletcher/index.html | 4 ++-- zh/docs/next/integration/mitex/index.html | 2 +- zh/docs/next/integration/pinit/index.html | 4 ++-- zh/docs/next/intro/index.html | 2 +- zh/docs/next/layout/index.html | 4 ++-- zh/docs/next/multi-file/index.html | 4 ++-- zh/docs/next/progress/counters/index.html | 2 +- zh/docs/next/progress/sections/index.html | 2 +- zh/docs/next/sections/index.html | 8 ++++---- zh/docs/next/start/index.html | 6 +++--- zh/docs/next/themes/aqua/index.html | 6 +++--- zh/docs/next/themes/dewdrop/index.html | 8 ++++---- zh/docs/next/themes/metropolis/index.html | 8 ++++---- zh/docs/next/themes/simple/index.html | 8 ++++---- zh/docs/next/themes/university/index.html | 8 ++++---- zh/docs/next/utilities/fit-to/index.html | 2 +- zh/docs/next/utilities/oop/index.html | 2 +- zh/docs/progress/counters/index.html | 2 +- zh/docs/progress/sections/index.html | 2 +- zh/docs/sections/index.html | 2 +- zh/docs/start/index.html | 2 +- zh/docs/themes/aqua/index.html | 2 +- zh/docs/themes/dewdrop/index.html | 2 +- zh/docs/themes/metropolis/index.html | 2 +- zh/docs/themes/simple/index.html | 2 +- zh/docs/themes/university/index.html | 2 +- zh/docs/utilities/fit-to/index.html | 2 +- zh/docs/utilities/oop/index.html | 2 +- zh/index.html | 2 +- zh/markdown-page/index.html | 2 +- 412 files changed, 495 insertions(+), 495 deletions(-) rename assets/js/{0d1c87af.abe48754.js => 0d1c87af.1af163d0.js} (97%) rename assets/js/{293f9c83.e2d4c498.js => 293f9c83.3b48b842.js} (98%) rename assets/js/{39430005.39096450.js => 39430005.282e5018.js} (98%) rename assets/js/{3f2877b5.be6b644a.js => 3f2877b5.4796c932.js} (98%) rename assets/js/{472f8a66.c4719110.js => 472f8a66.6827c4cb.js} (99%) rename assets/js/{5057383c.7a48ca40.js => 5057383c.ecf8e775.js} (98%) rename assets/js/{55b57bd3.afd6b9b2.js => 55b57bd3.648f91c3.js} (98%) rename assets/js/{5670b452.b5eb8c1f.js => 5670b452.5f7a58b6.js} (97%) rename assets/js/{5a57e638.6764a52d.js => 5a57e638.e978d988.js} (97%) rename assets/js/{6607fcb6.18359e4f.js => 6607fcb6.4d9db996.js} (98%) rename assets/js/{7d3539b2.b4866903.js => 7d3539b2.06b94f08.js} (98%) rename assets/js/{7f65dfb7.e0a5ac39.js => 7f65dfb7.26d35ace.js} (96%) rename assets/js/{80a0c88e.a9a1492a.js => 80a0c88e.b733f954.js} (98%) rename assets/js/{8ac96054.67767120.js => 8ac96054.96187a17.js} (98%) rename assets/js/{98ce8162.0db38a50.js => 98ce8162.287e62b5.js} (98%) rename assets/js/{ab32da60.1d07324a.js => ab32da60.7b00de2b.js} (96%) rename assets/js/{c38df086.3a34d537.js => c38df086.21aead31.js} (98%) rename assets/js/{d16cbc15.e70ad829.js => d16cbc15.5450aa44.js} (98%) rename assets/js/{d287f9e6.06a655ad.js => d287f9e6.1b25ce7b.js} (97%) rename assets/js/{f3a7b3b2.232f5b0b.js => f3a7b3b2.b1e52f6b.js} (99%) rename assets/js/{runtime~main.939ad99e.js => runtime~main.9eada2e8.js} (74%) rename zh/assets/js/{20f452e9.e3e69eea.js => 20f452e9.325ef419.js} (98%) rename zh/assets/js/{24f6044e.c0a225e3.js => 24f6044e.a1e6abc1.js} (98%) rename zh/assets/js/{2e03f7f4.db446fe7.js => 2e03f7f4.fb84fa15.js} (97%) rename zh/assets/js/{339ee8e1.1ca78cd1.js => 339ee8e1.ed73a73c.js} (98%) rename zh/assets/js/{4c00a561.5599e7c7.js => 4c00a561.cd87c5af.js} (99%) rename zh/assets/js/{4e00a773.48847e29.js => 4e00a773.3e811cce.js} (98%) rename zh/assets/js/{5bb6c1c3.e9427874.js => 5bb6c1c3.a5d8e1de.js} (97%) rename zh/assets/js/{63dd4865.198592be.js => 63dd4865.5dfda47d.js} (98%) rename zh/assets/js/{69a95a34.7e93bac1.js => 69a95a34.21772d20.js} (98%) rename zh/assets/js/{6a503890.a8a90c97.js => 6a503890.006bba1f.js} (98%) rename zh/assets/js/{af355bab.d5c4fd47.js => af355bab.66334ddd.js} (98%) rename zh/assets/js/{c1d231e7.f8986a62.js => c1d231e7.bf9f8f1d.js} (99%) rename zh/assets/js/{cad84648.b55e6b76.js => cad84648.b13c687b.js} (98%) rename zh/assets/js/{ce05be13.d146487d.js => ce05be13.0aaa020d.js} (98%) rename zh/assets/js/{cf8983c6.1aa64ff4.js => cf8983c6.c3daa6dd.js} (98%) rename zh/assets/js/{d21a173f.cc1ad8e5.js => d21a173f.7cd6da87.js} (98%) rename zh/assets/js/{d5c687ae.f3c48789.js => d5c687ae.ed5869dd.js} (97%) rename zh/assets/js/{df8eaafd.cabf2352.js => df8eaafd.ae76ca45.js} (98%) rename zh/assets/js/{eb154561.3748b647.js => eb154561.c8a2a8cd.js} (97%) rename zh/assets/js/{f6262a69.3858054e.js => f6262a69.761f978e.js} (99%) rename zh/assets/js/{runtime~main.48acb82a.js => runtime~main.b12474e6.js} (91%) diff --git a/404.html b/404.html index a655528f4..389b99264 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@ Page Not Found | Touying - + diff --git a/assets/js/0d1c87af.abe48754.js b/assets/js/0d1c87af.1af163d0.js similarity index 97% rename from assets/js/0d1c87af.abe48754.js rename to assets/js/0d1c87af.1af163d0.js index 4c1cff567..611056451 100644 --- a/assets/js/0d1c87af.abe48754.js +++ b/assets/js/0d1c87af.1af163d0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2792],{2006:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>a});var s=i(5893),t=i(1151);const l={sidebar_position:5},o="Aqua Theme",d={id:"themes/aqua",title:"Aqua Theme",description:"image",source:"@site/docs/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University Theme",permalink:"/touying/docs/next/themes/university"},next:{title:"Creating Your Own Theme",permalink:"/touying/docs/next/build-your-own-theme"}},r={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Themes",id:"color-themes",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"aqua-theme",children:"Aqua Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is created by ",(0,s.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"}),", featuring beautiful backgrounds made with Typst's visualization capabilities."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it with the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Where ",(0,s.jsx)(n.code,{children:"register"})," takes parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of slides, either "16-9" or "4-3", default is "16-9".']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content shown on the right side of the footer, default is ",(0,s.jsx)(n.code,{children:"states.slide-counter.display()"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"lang"}),": Language configuration, currently supports ",(0,s.jsx)(n.code,{children:'"en"'})," and ",(0,s.jsx)(n.code,{children:'"zh"'}),", default is ",(0,s.jsx)(n.code,{children:'"en"'}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Aqua theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can utilize with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\n",(0,s.jsx)(n.p,{children:"Aqua by default uses:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\n'})}),"\n",(0,s.jsxs)(n.p,{children:["color themes, which you can modify by ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"Aqua theme offers a series of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," will read information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Display an outline slide."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A default ordinary slide function with title and footer, where ",(0,s.jsx)(n.code,{children:"title"})," defaults to the current section title."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw the audience's attention. The background color is ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Start a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Default is ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["They can be set via ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: The outline title can be modified via ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, you can disable the automatic inclusion of ",(0,s.jsx)(n.code,{children:"new-section-slide"})," functionality by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2792],{2006:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>a});var s=i(5893),t=i(1151);const l={sidebar_position:5},o="Aqua Theme",d={id:"themes/aqua",title:"Aqua Theme",description:"image",source:"@site/docs/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University Theme",permalink:"/touying/docs/next/themes/university"},next:{title:"Creating Your Own Theme",permalink:"/touying/docs/next/build-your-own-theme"}},r={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Themes",id:"color-themes",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"aqua-theme",children:"Aqua Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme is created by ",(0,s.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"}),", featuring beautiful backgrounds made with Typst's visualization capabilities."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it with the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Where ",(0,s.jsx)(n.code,{children:"register"})," takes parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of slides, either "16-9" or "4-3", default is "16-9".']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content shown on the right side of the footer, default is ",(0,s.jsx)(n.code,{children:"states.slide-counter.display()"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"lang"}),": Language configuration, currently supports ",(0,s.jsx)(n.code,{children:'"en"'})," and ",(0,s.jsx)(n.code,{children:'"zh"'}),", default is ",(0,s.jsx)(n.code,{children:'"en"'}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Aqua theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can utilize with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-themes",children:"Color Themes"}),"\n",(0,s.jsx)(n.p,{children:"Aqua by default uses:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\n'})}),"\n",(0,s.jsxs)(n.p,{children:["color themes, which you can modify by ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"Aqua theme offers a series of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," will read information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Display an outline slide."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A default ordinary slide function with title and footer, where ",(0,s.jsx)(n.code,{children:"title"})," defaults to the current section title."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw the audience's attention. The background color is ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Start a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Default is ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Default is ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["They can be set via ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: The outline title can be modified via ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, you can disable the automatic inclusion of ",(0,s.jsx)(n.code,{children:"new-section-slide"})," functionality by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/293f9c83.e2d4c498.js b/assets/js/293f9c83.3b48b842.js similarity index 98% rename from assets/js/293f9c83.e2d4c498.js rename to assets/js/293f9c83.3b48b842.js index 284019363..6431010a4 100644 --- a/assets/js/293f9c83.e2d4c498.js +++ b/assets/js/293f9c83.3b48b842.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8088],{9547:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=t(5893),s=t(1151);const r={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to CeTZ and Fletcher.",source:"@site/docs/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"}},d={},a=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to CeTZ and Fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within CeTZ, but it requires a bit of technique:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8088],{9547:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=t(5893),s=t(1151);const r={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to CeTZ and Fletcher.",source:"@site/docs/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"}},d={},a=[{value:"Simple Animation",id:"simple-animation",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to CeTZ and Fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animation",children:"Simple Animation"}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within CeTZ, but it requires a bit of technique:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/39430005.39096450.js b/assets/js/39430005.282e5018.js similarity index 98% rename from assets/js/39430005.39096450.js rename to assets/js/39430005.282e5018.js index 180dea687..6517de829 100644 --- a/assets/js/39430005.39096450.js +++ b/assets/js/39430005.282e5018.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9619],{4057:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=t(5893),s=t(1151);const o={sidebar_position:5},r="Other Animations",d={id:"dynamic/other",title:"Other Animations",description:"Touying also provides touying-reducer, which adds pause and meanwhile animations to cetz and fletcher.",source:"@site/docs/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover Function",permalink:"/touying/docs/next/dynamic/cover"},next:{title:"Handout Mode",permalink:"/touying/docs/next/dynamic/handout"}},c={},a=[{value:"Simple Animations",id:"simple-animations",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"other-animations",children:"Other Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying also provides ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to cetz and fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsx)(n.p,{children:"Here's an example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within cetz, just requiring a bit of skill:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9619],{4057:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=t(5893),s=t(1151);const o={sidebar_position:5},r="Other Animations",d={id:"dynamic/other",title:"Other Animations",description:"Touying also provides touying-reducer, which adds pause and meanwhile animations to cetz and fletcher.",source:"@site/docs/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover Function",permalink:"/touying/docs/next/dynamic/cover"},next:{title:"Handout Mode",permalink:"/touying/docs/next/dynamic/handout"}},c={},a=[{value:"Simple Animations",id:"simple-animations",level:2},{value:"only and uncover",id:"only-and-uncover",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"other-animations",children:"Other Animations"}),"\n",(0,i.jsxs)(n.p,{children:["Touying also provides ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to cetz and fletcher."]}),"\n",(0,i.jsx)(n.h2,{id:"simple-animations",children:"Simple Animations"}),"\n",(0,i.jsx)(n.p,{children:"Here's an example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-and-uncover",children:"only and uncover"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, we can also use ",(0,i.jsx)(n.code,{children:"only"})," and ",(0,i.jsx)(n.code,{children:"uncover"})," within cetz, just requiring a bit of skill:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3f2877b5.be6b644a.js b/assets/js/3f2877b5.4796c932.js similarity index 98% rename from assets/js/3f2877b5.be6b644a.js rename to assets/js/3f2877b5.4796c932.js index 27d4cf594..369ad506b 100644 --- a/assets/js/3f2877b5.be6b644a.js +++ b/assets/js/3f2877b5.4796c932.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8350],{5813:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to Fletcher.",source:"@site/docs/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to Fletcher."]}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8350],{5813:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying provides the touying-reducer, which adds pause and meanwhile animations to Fletcher.",source:"@site/docs/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying provides the ",(0,i.jsx)(n.code,{children:"touying-reducer"}),", which adds ",(0,i.jsx)(n.code,{children:"pause"})," and ",(0,i.jsx)(n.code,{children:"meanwhile"})," animations to Fletcher."]}),"\n",(0,i.jsx)(n.p,{children:"An example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/472f8a66.c4719110.js b/assets/js/472f8a66.6827c4cb.js similarity index 99% rename from assets/js/472f8a66.c4719110.js rename to assets/js/472f8a66.6827c4cb.js index e8d252874..50f839432 100644 --- a/assets/js/472f8a66.c4719110.js +++ b/assets/js/472f8a66.6827c4cb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var i=t(5893),o=t(1151);const a={sidebar_position:5},s="Page Layout",r={id:"layout",title:"Page Layout",description:"Basic Concepts",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Code Style",permalink:"/touying/docs/next/code-styles"},next:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"}},d={},l=[{value:"Basic Concepts",id:"basic-concepts",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Application: Adding a Logo",id:"application-adding-a-logo",level:2},{value:"Page Columns",id:"page-columns",level:2}];function c(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"page-layout",children:"Page Layout"}),"\n",(0,i.jsx)(n.h2,{id:"basic-concepts",children:"Basic Concepts"}),"\n",(0,i.jsx)(n.p,{children:"To create stylish slides using Typst, it's essential to understand Typst's page model correctly. If you're not concerned with customizing page styles, you can choose to skip this section. However, it's still recommended to go through it."}),"\n",(0,i.jsx)(n.p,{children:"Let's illustrate Typst's default page model through a specific example."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"We need to distinguish the following concepts:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Model:"})," Typst has a model similar to the CSS Box Model, divided into Margin, Padding, and Content. However, padding is not a property of ",(0,i.jsx)(n.code,{children:"set page(..)"})," but is obtained by manually adding ",(0,i.jsx)(n.code,{children:"#pad(..)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Margin:"})," Margins are the edges of the page, divided into top, bottom, left, and right. They are the core of Typst's page model, and all other properties are influenced by margins, especially Header and Footer. Header and Footer are actually located within the Margin."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header:"})," The Header is the content at the top of the page, divided into container and innerbox. We can observe that the edge of the header container and padding does not align but has some space in between, which is actually ",(0,i.jsx)(n.code,{children:"header-ascent: 30%"}),", where the percentage is relative to the margin-top. Additionally, we notice that the header innerbox is actually located at the bottom left corner of the header container, meaning innerbox defaults to ",(0,i.jsx)(n.code,{children:"#set align(left + bottom)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Footer:"})," The Footer is the content at the bottom of the page, similar to the Header but in the opposite direction."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Place:"})," The ",(0,i.jsx)(n.code,{children:"place"})," function enables absolute positioning relative to the parent container without affecting other elements inside the parent container. It allows specifying ",(0,i.jsx)(n.code,{children:"alignment"}),", ",(0,i.jsx)(n.code,{children:"dx"}),", and ",(0,i.jsx)(n.code,{children:"dy"}),", making it suitable for placing decorative elements like logos."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Therefore, to apply Typst to create slides, we only need to set:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"However, we still need to address how the header occupies the entire page width. Here, we use negative padding to achieve this. For instance:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,i.jsxs)(n.p,{children:["Since modifying page parameters using the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command in Typst creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable and a ",(0,i.jsx)(n.code,{children:"s.padding"})," member variable. These parameters are only applied when Touying creates a new slide, so users only need to focus on ",(0,i.jsx)(n.code,{children:"s.page-args"})," and ",(0,i.jsx)(n.code,{children:"s.padding"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"For example, the previous example can be modified as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Touying automatically detects the value of ",(0,i.jsx)(n.code,{children:"margin.x"})," and adds negative padding to the header if ",(0,i.jsx)(n.code,{children:"self.full-header == true"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Similarly, if you're unsatisfied with the header or footer style of a particular theme, you can change it using:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,i.jsxs)(n.p,{children:["However, it's essential to note that if you change page parameters in this way, you need to place it before ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),", or you'll have to call ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," again."]}),"\n",(0,i.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,i.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command directly but instead modify the ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable internally."]})}),"\n",(0,i.jsxs)(n.p,{children:["This approach also allows us to query the current page parameters in real-time using ",(0,i.jsx)(n.code,{children:"s.page-args"}),", which is useful for functions that need to obtain margins or the current page's background color, such as ",(0,i.jsx)(n.code,{children:"transparent-cover"}),". This is partially equivalent to context get rule and is actually more convenient to use."]}),"\n",(0,i.jsx)(n.h2,{id:"application-adding-a-logo",children:"Application: Adding a Logo"}),"\n",(0,i.jsxs)(n.p,{children:["Adding a logo to slides is a very common but also a very versatile requirement. The difficulty lies in the fact that the required size and position of the logo often vary from person to person. Therefore, most of Touying's themes do not include configuration options for logos. But with the concepts of page layout mentioned in this section, we know that we can use the ",(0,i.jsx)(n.code,{children:"place"})," function in the header or footer to place a logo image."]}),"\n",(0,i.jsx)(n.p,{children:"For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo at the top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["Here, ",(0,i.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," can be used to display ",(0,i.jsx)(n.code,{children:"body"})," as content or a callback function in the form ",(0,i.jsx)(n.code,{children:"self => content"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,i.jsxs)(n.p,{children:["If you need to divide the page into two or three columns, you can use the ",(0,i.jsx)(n.code,{children:"compose"})," feature provided by the default ",(0,i.jsx)(n.code,{children:"slide"})," function in Touying. The simplest example is as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a39f88a2-f1ba-4420-8f78-6a0fc644704e",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,i.jsx)(n.code,{children:"utils.side-by-side.with(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/aa84192a-4082-495d-9773-b06df32ab8dc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>s});var i=t(7294);const o={},a=i.createContext(o);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8565],{2857:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var i=t(5893),o=t(1151);const a={sidebar_position:5},s="Page Layout",r={id:"layout",title:"Page Layout",description:"Basic Concepts",source:"@site/docs/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Code Style",permalink:"/touying/docs/next/code-styles"},next:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"}},d={},l=[{value:"Basic Concepts",id:"basic-concepts",level:2},{value:"Page Management",id:"page-management",level:2},{value:"Application: Adding a Logo",id:"application-adding-a-logo",level:2},{value:"Page Columns",id:"page-columns",level:2}];function c(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"page-layout",children:"Page Layout"}),"\n",(0,i.jsx)(n.h2,{id:"basic-concepts",children:"Basic Concepts"}),"\n",(0,i.jsx)(n.p,{children:"To create stylish slides using Typst, it's essential to understand Typst's page model correctly. If you're not concerned with customizing page styles, you can choose to skip this section. However, it's still recommended to go through it."}),"\n",(0,i.jsx)(n.p,{children:"Let's illustrate Typst's default page model through a specific example."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"We need to distinguish the following concepts:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Model:"})," Typst has a model similar to the CSS Box Model, divided into Margin, Padding, and Content. However, padding is not a property of ",(0,i.jsx)(n.code,{children:"set page(..)"})," but is obtained by manually adding ",(0,i.jsx)(n.code,{children:"#pad(..)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Margin:"})," Margins are the edges of the page, divided into top, bottom, left, and right. They are the core of Typst's page model, and all other properties are influenced by margins, especially Header and Footer. Header and Footer are actually located within the Margin."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Header:"})," The Header is the content at the top of the page, divided into container and innerbox. We can observe that the edge of the header container and padding does not align but has some space in between, which is actually ",(0,i.jsx)(n.code,{children:"header-ascent: 30%"}),", where the percentage is relative to the margin-top. Additionally, we notice that the header innerbox is actually located at the bottom left corner of the header container, meaning innerbox defaults to ",(0,i.jsx)(n.code,{children:"#set align(left + bottom)"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Footer:"})," The Footer is the content at the bottom of the page, similar to the Header but in the opposite direction."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Place:"})," The ",(0,i.jsx)(n.code,{children:"place"})," function enables absolute positioning relative to the parent container without affecting other elements inside the parent container. It allows specifying ",(0,i.jsx)(n.code,{children:"alignment"}),", ",(0,i.jsx)(n.code,{children:"dx"}),", and ",(0,i.jsx)(n.code,{children:"dy"}),", making it suitable for placing decorative elements like logos."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Therefore, to apply Typst to create slides, we only need to set:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"However, we still need to address how the header occupies the entire page width. Here, we use negative padding to achieve this. For instance:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"page-management",children:"Page Management"}),"\n",(0,i.jsxs)(n.p,{children:["Since modifying page parameters using the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command in Typst creates a new page instead of modifying the current one, Touying chooses to maintain a ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable and a ",(0,i.jsx)(n.code,{children:"s.padding"})," member variable. These parameters are only applied when Touying creates a new slide, so users only need to focus on ",(0,i.jsx)(n.code,{children:"s.page-args"})," and ",(0,i.jsx)(n.code,{children:"s.padding"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"For example, the previous example can be modified as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Touying automatically detects the value of ",(0,i.jsx)(n.code,{children:"margin.x"})," and adds negative padding to the header if ",(0,i.jsx)(n.code,{children:"self.full-header == true"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Similarly, if you're unsatisfied with the header or footer style of a particular theme, you can change it using:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,i.jsxs)(n.p,{children:["However, it's essential to note that if you change page parameters in this way, you need to place it before ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),", or you'll have to call ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," again."]}),"\n",(0,i.jsx)(n.admonition,{title:"Warning",type:"warning",children:(0,i.jsxs)(n.p,{children:["Therefore, you should not use the ",(0,i.jsx)(n.code,{children:"set page(..)"})," command directly but instead modify the ",(0,i.jsx)(n.code,{children:"s.page-args"})," member variable internally."]})}),"\n",(0,i.jsxs)(n.p,{children:["This approach also allows us to query the current page parameters in real-time using ",(0,i.jsx)(n.code,{children:"s.page-args"}),", which is useful for functions that need to obtain margins or the current page's background color, such as ",(0,i.jsx)(n.code,{children:"transparent-cover"}),". This is partially equivalent to context get rule and is actually more convenient to use."]}),"\n",(0,i.jsx)(n.h2,{id:"application-adding-a-logo",children:"Application: Adding a Logo"}),"\n",(0,i.jsxs)(n.p,{children:["Adding a logo to slides is a very common but also a very versatile requirement. The difficulty lies in the fact that the required size and position of the logo often vary from person to person. Therefore, most of Touying's themes do not include configuration options for logos. But with the concepts of page layout mentioned in this section, we know that we can use the ",(0,i.jsx)(n.code,{children:"place"})," function in the header or footer to place a logo image."]}),"\n",(0,i.jsx)(n.p,{children:"For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo at the top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["Here, ",(0,i.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," can be used to display ",(0,i.jsx)(n.code,{children:"body"})," as content or a callback function in the form ",(0,i.jsx)(n.code,{children:"self => content"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"page-columns",children:"Page Columns"}),"\n",(0,i.jsxs)(n.p,{children:["If you need to divide the page into two or three columns, you can use the ",(0,i.jsx)(n.code,{children:"compose"})," feature provided by the default ",(0,i.jsx)(n.code,{children:"slide"})," function in Touying. The simplest example is as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/a39f88a2-f1ba-4420-8f78-6a0fc644704e",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["If you need to change the way columns are composed, you can modify the ",(0,i.jsx)(n.code,{children:"composer"})," parameter of ",(0,i.jsx)(n.code,{children:"slide"}),". The default parameter is ",(0,i.jsx)(n.code,{children:"utils.side-by-side.with(columns: auto, gutter: 1em)"}),". If we want the left column to occupy the remaining width, we can use"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\n First column.\n][\n Second column.\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/aa84192a-4082-495d-9773-b06df32ab8dc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>s});var i=t(7294);const o={},a=i.createContext(o);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5057383c.7a48ca40.js b/assets/js/5057383c.ecf8e775.js similarity index 98% rename from assets/js/5057383c.7a48ca40.js rename to assets/js/5057383c.ecf8e775.js index 95c7fe671..7cc31f560 100644 --- a/assets/js/5057383c.7a48ca40.js +++ b/assets/js/5057383c.ecf8e775.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5854],{3242:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>c});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002",source:"@site/docs/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Pdfpc",permalink:"/touying/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/docs/next/external/typst-preview"}},p={},c=[{value:"\u7b14\u8bb0\u652f\u6301",id:"\u7b14\u8bb0\u652f\u6301",level:2}];function l(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002"]}),"\n",(0,t.jsx)(s.h2,{id:"\u7b14\u8bb0\u652f\u6301",children:"\u7b14\u8bb0\u652f\u6301"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"\u7136\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 pympress \u653e\u6620\u4e86\u3002"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5854],{3242:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>c});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002",source:"@site/docs/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Pdfpc",permalink:"/touying/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/docs/next/external/typst-preview"}},p={},c=[{value:"\u7b14\u8bb0\u652f\u6301",id:"\u7b14\u8bb0\u652f\u6301",level:2}];function l(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," \u662f\u4e00\u79cd PDF \u6f14\u793a\u5de5\u5177\uff0c\u4e13\u4e3a\u6f14\u793a\u6587\u7a3f\u548c\u516c\u5f00\u6f14\u8bb2\u7b49\u53cc\u5c4f\u8bbe\u7f6e\u800c\u8bbe\u8ba1\u3002\u9ad8\u5ea6\u53ef\u914d\u7f6e\u3001\u529f\u80fd\u9f50\u5168\u4e14\u53ef\u79fb\u690d\u3002"]}),"\n",(0,t.jsx)(s.h2,{id:"\u7b14\u8bb0\u652f\u6301",children:"\u7b14\u8bb0\u652f\u6301"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"\u7136\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 pympress \u653e\u6620\u4e86\u3002"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/55b57bd3.afd6b9b2.js b/assets/js/55b57bd3.648f91c3.js similarity index 98% rename from assets/js/55b57bd3.afd6b9b2.js rename to assets/js/55b57bd3.648f91c3.js index b4bdb1e77..a21fc2aae 100644 --- a/assets/js/55b57bd3.afd6b9b2.js +++ b/assets/js/55b57bd3.648f91c3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6259],{4628:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying can work seamlessly with the ctheorems package, allowing you to directly use the ctheorems package.",source:"@site/docs/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/docs/next/category/themes"}},c={},l=[];function m(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsxs)(n.p,{children:["Touying can work seamlessly with the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package, allowing you to directly use the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package."]}),"\n",(0,o.jsxs)(n.p,{children:["Moreover, you can utilize ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," to set numbering for sections and subsections."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6259],{4628:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying can work seamlessly with the ctheorems package, allowing you to directly use the ctheorems package.",source:"@site/docs/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/docs/next/category/themes"}},c={},l=[];function m(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsxs)(n.p,{children:["Touying can work seamlessly with the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package, allowing you to directly use the ",(0,o.jsx)(n.code,{children:"ctheorems"})," package."]}),"\n",(0,o.jsxs)(n.p,{children:["Moreover, you can utilize ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," to set numbering for sections and subsections."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5670b452.b5eb8c1f.js b/assets/js/5670b452.5f7a58b6.js similarity index 97% rename from assets/js/5670b452.b5eb8c1f.js rename to assets/js/5670b452.5f7a58b6.js index b2185335f..c12bab659 100644 --- a/assets/js/5670b452.b5eb8c1f.js +++ b/assets/js/5670b452.5f7a58b6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[997],{2261:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var n=s(5893),i=s(1151);const o={sidebar_position:11},l="Creating Your Own Theme",r={id:"build-your-own-theme",title:"Creating Your Own Theme",description:"Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the source code of existing themes for guidance. The key steps to implement are:",source:"@site/docs/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/docs/next/category/progress"}},d={},a=[{value:"Modifying Existing Themes",id:"modifying-existing-themes",level:2},{value:"Import",id:"import",level:2},{value:"Register Function and Init Method",id:"register-function-and-init-method",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Practical: Custom Alert Method",id:"practical-custom-alert-method",level:2},{value:"Custom Header and Footer",id:"custom-header-and-footer",level:2},{value:"Custom Special Slide",id:"custom-special-slide",level:2},{value:"Conclusion",id:"conclusion",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"creating-your-own-theme",children:"Creating Your Own Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"source code of existing themes"})," for guidance. The key steps to implement are:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"register"})," function to initialize the global singleton ",(0,n.jsx)(t.code,{children:"s"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"init"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Define a color theme by modifying the ",(0,n.jsx)(t.code,{children:"self.colors"})," member variable."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"alert"})," method (optional)."]}),"\n",(0,n.jsx)(t.li,{children:"Customize the header."}),"\n",(0,n.jsx)(t.li,{children:"Customize the footer."}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slide"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize special slide methods, such as ",(0,n.jsx)(t.code,{children:"title-slide"})," and ",(0,n.jsx)(t.code,{children:"focus-slide"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slides"})," method (optional)."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps."}),"\n",(0,n.jsx)(t.h2,{id:"modifying-existing-themes",children:"Modifying Existing Themes"}),"\n",(0,n.jsx)(t.p,{children:"If you wish to modify a theme within the Touying package locally instead of creating one from scratch, you can achieve this by following these steps:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["Copy the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"theme code"})," from the ",(0,n.jsx)(t.code,{children:"themes"})," directory to your local machine. For example, copy ",(0,n.jsx)(t.code,{children:"themes/university.typ"})," to a local file named ",(0,n.jsx)(t.code,{children:"university.typ"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Remove all ",(0,n.jsx)(t.code,{children:'#import "../xxx.typ"'})," commands at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file."]}),"\n",(0,n.jsxs)(t.li,{children:["Add ",(0,n.jsx)(t.code,{children:'#import "@preview/touying:0.4.0": *'})," at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file to import all modules."]}),"\n",(0,n.jsxs)(t.li,{children:["Replace ",(0,n.jsx)(t.code,{children:"self: s"})," in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"})," ",(0,n.jsx)(t.strong,{children:"(Important)"}),"."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"You can then import and use the theme by:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,n.jsxs)(t.p,{children:["For a specific example, refer to: ",(0,n.jsx)(t.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,n.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,n.jsx)(t.p,{children:"Depending on whether the theme is for personal use or part of Touying, you can import in two ways:"}),"\n",(0,n.jsx)(t.p,{children:"If for personal use:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n'})}),"\n",(0,n.jsx)(t.p,{children:"If part of Touying themes:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["Additionally, add the import statement in Touying's ",(0,n.jsx)(t.code,{children:"themes/themes.typ"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,n.jsx)(t.h2,{id:"register-function-and-init-method",children:"Register Function and Init Method"}),"\n",(0,n.jsx)(t.p,{children:"Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted."}),"\n",(0,n.jsx)(t.p,{children:"Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, we created a ",(0,n.jsx)(t.code,{children:"register"})," function and passed an ",(0,n.jsx)(t.code,{children:"aspect-ratio"})," parameter to set the page aspect ratio. We get default ",(0,n.jsx)(t.code,{children:"self"})," by ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"}),". As you might already know, in Touying, we should not use ",(0,n.jsx)(t.code,{children:"set page(..)"})," to set page parameters but rather use the syntax ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to set them, as explained in the Page Layout section."]}),"\n",(0,n.jsxs)(t.p,{children:["In addition, we registered a ",(0,n.jsx)(t.code,{children:"self.methods.init"})," method, which can be used for some global style settings. For example, in this case, we added ",(0,n.jsx)(t.code,{children:"set text(size: 20pt)"})," to set the font size. You can also place additional global style settings here, such as ",(0,n.jsx)(t.code,{children:"set par(justify: true)"}),". Since the ",(0,n.jsx)(t.code,{children:"init"})," function is placed inside ",(0,n.jsx)(t.code,{children:"self.methods"}),", it is a method, not a regular function. Therefore, we need to add the parameter ",(0,n.jsx)(t.code,{children:"self: none"})," to use it properly."]}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, later in ",(0,n.jsx)(t.code,{children:"main.typ"}),", we apply the global style settings in ",(0,n.jsx)(t.code,{children:"init"})," using ",(0,n.jsx)(t.code,{children:"#show: init"}),", where ",(0,n.jsx)(t.code,{children:"init"})," is bound and unpacked through ",(0,n.jsx)(t.code,{children:"utils.methods(s)"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["If you pay extra attention, you'll notice that the ",(0,n.jsx)(t.code,{children:"register"})," function has an independent ",(0,n.jsx)(t.code,{children:"self"})," at the end. This actually represents returning the modified ",(0,n.jsx)(t.code,{children:"self"})," as the return value, which will be saved in ",(0,n.jsx)(t.code,{children:"#let s = .."}),". This line is therefore indispensable."]}),"\n",(0,n.jsx)(t.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Choosing an attractive color theme for your slides is crucial. Touying provides built-in color theme support to minimize API differences between different themes. Touying offers two dimensions of color selection: the first is ",(0,n.jsx)(t.code,{children:"neutral"}),", ",(0,n.jsx)(t.code,{children:"primary"}),", ",(0,n.jsx)(t.code,{children:"secondary"}),", and ",(0,n.jsx)(t.code,{children:"tertiary"})," for hue distinction, with ",(0,n.jsx)(t.code,{children:"primary"})," being the most commonly used; the second is ",(0,n.jsx)(t.code,{children:"default"}),", ",(0,n.jsx)(t.code,{children:"light"}),", ",(0,n.jsx)(t.code,{children:"lighter"}),", ",(0,n.jsx)(t.code,{children:"lightest"}),", ",(0,n.jsx)(t.code,{children:"dark"}),", ",(0,n.jsx)(t.code,{children:"darker"}),", and ",(0,n.jsx)(t.code,{children:"darkest"})," for brightness distinction."]}),"\n",(0,n.jsxs)(t.p,{children:["As we are creating the Bamboo theme, we chose a color for the ",(0,n.jsx)(t.code,{children:"primary"})," theme, similar to bamboo (",(0,n.jsx)(t.code,{children:'rgb("#5E8B65")'}),"), and included neutral lightest/darkest as background and font colors."]}),"\n",(0,n.jsxs)(t.p,{children:["As shown in the code below, we use ",(0,n.jsx)(t.code,{children:"(self.methods.colors)(self: self, ..)"})," to modify the color theme. Essentially, it is a wrapper for ",(0,n.jsx)(t.code,{children:"self.colors += (..)"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["After adding the color theme, we can access the color using syntax like ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"It's worth noting that users can change the theme color at any time using:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,n.jsx)(t.p,{children:"This flexibility demonstrates Touying's powerful customization capabilities."}),"\n",(0,n.jsx)(t.h2,{id:"practical-custom-alert-method",children:"Practical: Custom Alert Method"}),"\n",(0,n.jsxs)(t.p,{children:["In general, we need to provide a ",(0,n.jsx)(t.code,{children:"#alert[..]"})," function for users, similar to ",(0,n.jsx)(t.code,{children:"#strong[..]"}),". Typically, ",(0,n.jsx)(t.code,{children:"#alert[..]"})," emphasizes text using the primary theme color for aesthetics. We add a line in the ",(0,n.jsx)(t.code,{children:"register"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["This code sets the text color to ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),", utilizing the theme's primary color."]}),"\n",(0,n.jsx)(t.h2,{id:"custom-header-and-footer",children:"Custom Header and Footer"}),"\n",(0,n.jsx)(t.p,{children:"Here, assuming you've already read the Page Layout section, we know we should add headers and footers to the slides."}),"\n",(0,n.jsxs)(t.p,{children:["Firstly, we add ",(0,n.jsx)(t.code,{children:"self.bamboo-title = []"}),". This means we save the title of the current slide as a member variable ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),", stored in ",(0,n.jsx)(t.code,{children:"self"}),". This makes it easy to use in the header and later modifications. Similarly, we create ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),", saving the ",(0,n.jsx)(t.code,{children:"footer: []"})," parameter from the ",(0,n.jsx)(t.code,{children:"register"})," function for displaying in the bottom-left corner."]}),"\n",(0,n.jsxs)(t.p,{children:["It's worth noting that our header is actually a content function in the form of ",(0,n.jsx)(t.code,{children:"let header(self) = { .. }"})," with the ",(0,n.jsx)(t.code,{children:"self"})," parameter, allowing us to get the latest information from ",(0,n.jsx)(t.code,{children:"self"}),". For example, ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),". The footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"components.cell"})," used inside is actually ",(0,n.jsx)(t.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),", and ",(0,n.jsx)(t.code,{children:"show: components.cell"})," is shorthand for ",(0,n.jsx)(t.code,{children:"components.cell(body)"}),". The ",(0,n.jsx)(t.code,{children:"show: pad.with(.4em)"})," in the footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["Another point to note is the ",(0,n.jsx)(t.code,{children:"states"})," module, which contains many counters and state-related content. For example, ",(0,n.jsx)(t.code,{children:"states.current-section-title"})," is used to display the current ",(0,n.jsx)(t.code,{children:"section"}),", and ",(0,n.jsx)(t.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," is used to display the current page number and total number of pages."]}),"\n",(0,n.jsxs)(t.p,{children:["We observe the usage of ",(0,n.jsx)(t.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," to display ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),". This is used to handle situations like ",(0,n.jsx)(t.code,{children:"self.bamboo-footer = (self) => {..}"}),", ensuring a unified approach to displaying content functions and content."]}),"\n",(0,n.jsxs)(t.p,{children:["To ensure proper display of the header and footer and sufficient spacing from the main content, we also set margins, such as ",(0,n.jsx)(t.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["We also need to customize a ",(0,n.jsx)(t.code,{children:"slide"})," method that accepts ",(0,n.jsx)(t.code,{children:"slide(self: none, title: auto, ..args)"}),". The first ",(0,n.jsx)(t.code,{children:"self: none"})," is a required method parameter for getting the latest ",(0,n.jsx)(t.code,{children:"self"}),". The second ",(0,n.jsx)(t.code,{children:"title"})," is used to update ",(0,n.jsx)(t.code,{children:"self.bamboo-title"})," for displaying in the header. The third ",(0,n.jsx)(t.code,{children:"..args"})," collects the remaining parameters and passes them to ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, ..args)"}),", which is necessary for the Touying ",(0,n.jsx)(t.code,{children:"slide"})," functionality to work properly. Additionally, we need to register this method in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self.methods.slide = slide"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"custom-special-slide",children:"Custom Special Slide"}),"\n",(0,n.jsxs)(t.p,{children:["Building upon the basic slide, we further add some special slide functions such as ",(0,n.jsx)(t.code,{children:"title-slide"}),", ",(0,n.jsx)(t.code,{children:"focus-slide"}),", and a custom ",(0,n.jsx)(t.code,{children:"slides"})," method."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"title-slide"})," method, first, we call ",(0,n.jsx)(t.code,{children:"self = utils.empty-page(self)"}),". This function clears ",(0,n.jsx)(t.code,{children:"self.page-args.header"}),", ",(0,n.jsx)(t.code,{children:"self.page-args.footer"}),", and sets ",(0,n.jsx)(t.code,{children:"margin"})," to ",(0,n.jsx)(t.code,{children:"0em"}),", creating a blank page effect. Then, we use ",(0,n.jsx)(t.code,{children:"let info = self.info + args.named()"})," to get information stored in ",(0,n.jsx)(t.code,{children:"self.info"})," and update it with the passed ",(0,n.jsx)(t.code,{children:"args.named()"})," for later use as ",(0,n.jsx)(t.code,{children:"info.title"}),". The specific page content ",(0,n.jsx)(t.code,{children:"body"})," will vary for each theme, so we won't go into details here. Finally, we call `(self.methods.touying-slide)(self: self, repeat: none, body"]}),"\n",(0,n.jsxs)(t.p,{children:[")",(0,n.jsx)(t.code,{children:", where "}),"repeat: none",(0,n.jsx)(t.code,{children:"indicates that this page does not require animation effects, and passing the"}),"body` parameter displays its content."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"new-section-slide"})," method, the process is similar. The only thing to note is that in ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"}),", we pass an additional ",(0,n.jsx)(t.code,{children:"section: section"})," parameter to declare the creation of a new section. Another point to note is that besides ",(0,n.jsx)(t.code,{children:"self.methods.new-section-slide = new-section-slide"}),", we also register ",(0,n.jsx)(t.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),", so ",(0,n.jsx)(t.code,{children:"new-section-slide"})," will be automatically called when encountering a first-level title."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"focus-slide"})," method, most of the content is similar, but it's worth noting that we use ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to update the page's background color."]}),"\n",(0,n.jsxs)(t.p,{children:["Finally, we update the ",(0,n.jsx)(t.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," method. When ",(0,n.jsx)(t.code,{children:"title-slide"})," is ",(0,n.jsx)(t.code,{children:"true"}),", using ",(0,n.jsx)(t.code,{children:"#show: slides"})," will automatically create a ",(0,n.jsx)(t.code,{children:"title-slide"}),". Setting ",(0,n.jsx)(t.code,{children:"slide-level: 1"})," indicates that the first-level and second-level titles correspond to ",(0,n.jsx)(t.code,{children:"section"})," and ",(0,n.jsx)(t.code,{children:"title"}),", respectively."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming."})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>l});var n=s(7294);const i={},o=n.createContext(i);function l(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[997],{2261:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var n=s(5893),i=s(1151);const o={sidebar_position:11},l="Creating Your Own Theme",r={id:"build-your-own-theme",title:"Creating Your Own Theme",description:"Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the source code of existing themes for guidance. The key steps to implement are:",source:"@site/docs/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/docs/next/category/progress"}},d={},a=[{value:"Modifying Existing Themes",id:"modifying-existing-themes",level:2},{value:"Import",id:"import",level:2},{value:"Register Function and Init Method",id:"register-function-and-init-method",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Practical: Custom Alert Method",id:"practical-custom-alert-method",level:2},{value:"Custom Header and Footer",id:"custom-header-and-footer",level:2},{value:"Custom Special Slide",id:"custom-special-slide",level:2},{value:"Conclusion",id:"conclusion",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"creating-your-own-theme",children:"Creating Your Own Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Creating your own theme with Touying might seem a bit complex initially due to the introduction of various concepts. However, fear not; if you successfully create a custom theme with Touying, you'll likely experience the convenience and powerful customization features it offers. You can refer to the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"source code of existing themes"})," for guidance. The key steps to implement are:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"register"})," function to initialize the global singleton ",(0,n.jsx)(t.code,{children:"s"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"init"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Define a color theme by modifying the ",(0,n.jsx)(t.code,{children:"self.colors"})," member variable."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"alert"})," method (optional)."]}),"\n",(0,n.jsx)(t.li,{children:"Customize the header."}),"\n",(0,n.jsx)(t.li,{children:"Customize the footer."}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slide"})," method."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize special slide methods, such as ",(0,n.jsx)(t.code,{children:"title-slide"})," and ",(0,n.jsx)(t.code,{children:"focus-slide"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Customize the ",(0,n.jsx)(t.code,{children:"slides"})," method (optional)."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To demonstrate creating a simple and elegant Bamboo theme, let's follow the steps."}),"\n",(0,n.jsx)(t.h2,{id:"modifying-existing-themes",children:"Modifying Existing Themes"}),"\n",(0,n.jsx)(t.p,{children:"If you wish to modify a theme within the Touying package locally instead of creating one from scratch, you can achieve this by following these steps:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["Copy the ",(0,n.jsx)(t.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"theme code"})," from the ",(0,n.jsx)(t.code,{children:"themes"})," directory to your local machine. For example, copy ",(0,n.jsx)(t.code,{children:"themes/university.typ"})," to a local file named ",(0,n.jsx)(t.code,{children:"university.typ"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Remove all ",(0,n.jsx)(t.code,{children:'#import "../xxx.typ"'})," commands at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file."]}),"\n",(0,n.jsxs)(t.li,{children:["Add ",(0,n.jsx)(t.code,{children:'#import "@preview/touying:0.4.1": *'})," at the top of the ",(0,n.jsx)(t.code,{children:"university.typ"})," file to import all modules."]}),"\n",(0,n.jsxs)(t.li,{children:["Replace ",(0,n.jsx)(t.code,{children:"self: s"})," in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"})," ",(0,n.jsx)(t.strong,{children:"(Important)"}),"."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"You can then import and use the theme by:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,n.jsxs)(t.p,{children:["For a specific example, refer to: ",(0,n.jsx)(t.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,n.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,n.jsx)(t.p,{children:"Depending on whether the theme is for personal use or part of Touying, you can import in two ways:"}),"\n",(0,n.jsx)(t.p,{children:"If for personal use:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n'})}),"\n",(0,n.jsx)(t.p,{children:"If part of Touying themes:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["Additionally, add the import statement in Touying's ",(0,n.jsx)(t.code,{children:"themes/themes.typ"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,n.jsx)(t.h2,{id:"register-function-and-init-method",children:"Register Function and Init Method"}),"\n",(0,n.jsx)(t.p,{children:"Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted."}),"\n",(0,n.jsx)(t.p,{children:"Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, we created a ",(0,n.jsx)(t.code,{children:"register"})," function and passed an ",(0,n.jsx)(t.code,{children:"aspect-ratio"})," parameter to set the page aspect ratio. We get default ",(0,n.jsx)(t.code,{children:"self"})," by ",(0,n.jsx)(t.code,{children:"self: themes.default.register()"}),". As you might already know, in Touying, we should not use ",(0,n.jsx)(t.code,{children:"set page(..)"})," to set page parameters but rather use the syntax ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to set them, as explained in the Page Layout section."]}),"\n",(0,n.jsxs)(t.p,{children:["In addition, we registered a ",(0,n.jsx)(t.code,{children:"self.methods.init"})," method, which can be used for some global style settings. For example, in this case, we added ",(0,n.jsx)(t.code,{children:"set text(size: 20pt)"})," to set the font size. You can also place additional global style settings here, such as ",(0,n.jsx)(t.code,{children:"set par(justify: true)"}),". Since the ",(0,n.jsx)(t.code,{children:"init"})," function is placed inside ",(0,n.jsx)(t.code,{children:"self.methods"}),", it is a method, not a regular function. Therefore, we need to add the parameter ",(0,n.jsx)(t.code,{children:"self: none"})," to use it properly."]}),"\n",(0,n.jsxs)(t.p,{children:["As you can see, later in ",(0,n.jsx)(t.code,{children:"main.typ"}),", we apply the global style settings in ",(0,n.jsx)(t.code,{children:"init"})," using ",(0,n.jsx)(t.code,{children:"#show: init"}),", where ",(0,n.jsx)(t.code,{children:"init"})," is bound and unpacked through ",(0,n.jsx)(t.code,{children:"utils.methods(s)"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["If you pay extra attention, you'll notice that the ",(0,n.jsx)(t.code,{children:"register"})," function has an independent ",(0,n.jsx)(t.code,{children:"self"})," at the end. This actually represents returning the modified ",(0,n.jsx)(t.code,{children:"self"})," as the return value, which will be saved in ",(0,n.jsx)(t.code,{children:"#let s = .."}),". This line is therefore indispensable."]}),"\n",(0,n.jsx)(t.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,n.jsxs)(t.p,{children:["Choosing an attractive color theme for your slides is crucial. Touying provides built-in color theme support to minimize API differences between different themes. Touying offers two dimensions of color selection: the first is ",(0,n.jsx)(t.code,{children:"neutral"}),", ",(0,n.jsx)(t.code,{children:"primary"}),", ",(0,n.jsx)(t.code,{children:"secondary"}),", and ",(0,n.jsx)(t.code,{children:"tertiary"})," for hue distinction, with ",(0,n.jsx)(t.code,{children:"primary"})," being the most commonly used; the second is ",(0,n.jsx)(t.code,{children:"default"}),", ",(0,n.jsx)(t.code,{children:"light"}),", ",(0,n.jsx)(t.code,{children:"lighter"}),", ",(0,n.jsx)(t.code,{children:"lightest"}),", ",(0,n.jsx)(t.code,{children:"dark"}),", ",(0,n.jsx)(t.code,{children:"darker"}),", and ",(0,n.jsx)(t.code,{children:"darkest"})," for brightness distinction."]}),"\n",(0,n.jsxs)(t.p,{children:["As we are creating the Bamboo theme, we chose a color for the ",(0,n.jsx)(t.code,{children:"primary"})," theme, similar to bamboo (",(0,n.jsx)(t.code,{children:'rgb("#5E8B65")'}),"), and included neutral lightest/darkest as background and font colors."]}),"\n",(0,n.jsxs)(t.p,{children:["As shown in the code below, we use ",(0,n.jsx)(t.code,{children:"(self.methods.colors)(self: self, ..)"})," to modify the color theme. Essentially, it is a wrapper for ",(0,n.jsx)(t.code,{children:"self.colors += (..)"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["After adding the color theme, we can access the color using syntax like ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"It's worth noting that users can change the theme color at any time using:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,n.jsx)(t.p,{children:"This flexibility demonstrates Touying's powerful customization capabilities."}),"\n",(0,n.jsx)(t.h2,{id:"practical-custom-alert-method",children:"Practical: Custom Alert Method"}),"\n",(0,n.jsxs)(t.p,{children:["In general, we need to provide a ",(0,n.jsx)(t.code,{children:"#alert[..]"})," function for users, similar to ",(0,n.jsx)(t.code,{children:"#strong[..]"}),". Typically, ",(0,n.jsx)(t.code,{children:"#alert[..]"})," emphasizes text using the primary theme color for aesthetics. We add a line in the ",(0,n.jsx)(t.code,{children:"register"})," function:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["This code sets the text color to ",(0,n.jsx)(t.code,{children:"self.colors.primary"}),", utilizing the theme's primary color."]}),"\n",(0,n.jsx)(t.h2,{id:"custom-header-and-footer",children:"Custom Header and Footer"}),"\n",(0,n.jsx)(t.p,{children:"Here, assuming you've already read the Page Layout section, we know we should add headers and footers to the slides."}),"\n",(0,n.jsxs)(t.p,{children:["Firstly, we add ",(0,n.jsx)(t.code,{children:"self.bamboo-title = []"}),". This means we save the title of the current slide as a member variable ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),", stored in ",(0,n.jsx)(t.code,{children:"self"}),". This makes it easy to use in the header and later modifications. Similarly, we create ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),", saving the ",(0,n.jsx)(t.code,{children:"footer: []"})," parameter from the ",(0,n.jsx)(t.code,{children:"register"})," function for displaying in the bottom-left corner."]}),"\n",(0,n.jsxs)(t.p,{children:["It's worth noting that our header is actually a content function in the form of ",(0,n.jsx)(t.code,{children:"let header(self) = { .. }"})," with the ",(0,n.jsx)(t.code,{children:"self"})," parameter, allowing us to get the latest information from ",(0,n.jsx)(t.code,{children:"self"}),". For example, ",(0,n.jsx)(t.code,{children:"self.bamboo-title"}),". The footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"components.cell"})," used inside is actually ",(0,n.jsx)(t.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),", and ",(0,n.jsx)(t.code,{children:"show: components.cell"})," is shorthand for ",(0,n.jsx)(t.code,{children:"components.cell(body)"}),". The ",(0,n.jsx)(t.code,{children:"show: pad.with(.4em)"})," in the footer is similar."]}),"\n",(0,n.jsxs)(t.p,{children:["Another point to note is the ",(0,n.jsx)(t.code,{children:"states"})," module, which contains many counters and state-related content. For example, ",(0,n.jsx)(t.code,{children:"states.current-section-title"})," is used to display the current ",(0,n.jsx)(t.code,{children:"section"}),", and ",(0,n.jsx)(t.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," is used to display the current page number and total number of pages."]}),"\n",(0,n.jsxs)(t.p,{children:["We observe the usage of ",(0,n.jsx)(t.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," to display ",(0,n.jsx)(t.code,{children:"self.bamboo-footer"}),". This is used to handle situations like ",(0,n.jsx)(t.code,{children:"self.bamboo-footer = (self) => {..}"}),", ensuring a unified approach to displaying content functions and content."]}),"\n",(0,n.jsxs)(t.p,{children:["To ensure proper display of the header and footer and sufficient spacing from the main content, we also set margins, such as ",(0,n.jsx)(t.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["We also need to customize a ",(0,n.jsx)(t.code,{children:"slide"})," method that accepts ",(0,n.jsx)(t.code,{children:"slide(self: none, title: auto, ..args)"}),". The first ",(0,n.jsx)(t.code,{children:"self: none"})," is a required method parameter for getting the latest ",(0,n.jsx)(t.code,{children:"self"}),". The second ",(0,n.jsx)(t.code,{children:"title"})," is used to update ",(0,n.jsx)(t.code,{children:"self.bamboo-title"})," for displaying in the header. The third ",(0,n.jsx)(t.code,{children:"..args"})," collects the remaining parameters and passes them to ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, ..args)"}),", which is necessary for the Touying ",(0,n.jsx)(t.code,{children:"slide"})," functionality to work properly. Additionally, we need to register this method in the ",(0,n.jsx)(t.code,{children:"register"})," function with ",(0,n.jsx)(t.code,{children:"self.methods.slide = slide"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"custom-special-slide",children:"Custom Special Slide"}),"\n",(0,n.jsxs)(t.p,{children:["Building upon the basic slide, we further add some special slide functions such as ",(0,n.jsx)(t.code,{children:"title-slide"}),", ",(0,n.jsx)(t.code,{children:"focus-slide"}),", and a custom ",(0,n.jsx)(t.code,{children:"slides"})," method."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"title-slide"})," method, first, we call ",(0,n.jsx)(t.code,{children:"self = utils.empty-page(self)"}),". This function clears ",(0,n.jsx)(t.code,{children:"self.page-args.header"}),", ",(0,n.jsx)(t.code,{children:"self.page-args.footer"}),", and sets ",(0,n.jsx)(t.code,{children:"margin"})," to ",(0,n.jsx)(t.code,{children:"0em"}),", creating a blank page effect. Then, we use ",(0,n.jsx)(t.code,{children:"let info = self.info + args.named()"})," to get information stored in ",(0,n.jsx)(t.code,{children:"self.info"})," and update it with the passed ",(0,n.jsx)(t.code,{children:"args.named()"})," for later use as ",(0,n.jsx)(t.code,{children:"info.title"}),". The specific page content ",(0,n.jsx)(t.code,{children:"body"})," will vary for each theme, so we won't go into details here. Finally, we call `(self.methods.touying-slide)(self: self, repeat: none, body"]}),"\n",(0,n.jsxs)(t.p,{children:[")",(0,n.jsx)(t.code,{children:", where "}),"repeat: none",(0,n.jsx)(t.code,{children:"indicates that this page does not require animation effects, and passing the"}),"body` parameter displays its content."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"new-section-slide"})," method, the process is similar. The only thing to note is that in ",(0,n.jsx)(t.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"}),", we pass an additional ",(0,n.jsx)(t.code,{children:"section: section"})," parameter to declare the creation of a new section. Another point to note is that besides ",(0,n.jsx)(t.code,{children:"self.methods.new-section-slide = new-section-slide"}),", we also register ",(0,n.jsx)(t.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),", so ",(0,n.jsx)(t.code,{children:"new-section-slide"})," will be automatically called when encountering a first-level title."]}),"\n",(0,n.jsxs)(t.p,{children:["For the ",(0,n.jsx)(t.code,{children:"focus-slide"})," method, most of the content is similar, but it's worth noting that we use ",(0,n.jsx)(t.code,{children:"self.page-args += (..)"})," to update the page's background color."]}),"\n",(0,n.jsxs)(t.p,{children:["Finally, we update the ",(0,n.jsx)(t.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," method. When ",(0,n.jsx)(t.code,{children:"title-slide"})," is ",(0,n.jsx)(t.code,{children:"true"}),", using ",(0,n.jsx)(t.code,{children:"#show: slides"})," will automatically create a ",(0,n.jsx)(t.code,{children:"title-slide"}),". Setting ",(0,n.jsx)(t.code,{children:"slide-level: 1"})," indicates that the first-level and second-level titles correspond to ",(0,n.jsx)(t.code,{children:"section"})," and ",(0,n.jsx)(t.code,{children:"title"}),", respectively."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming."})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>l});var n=s(7294);const i={},o=n.createContext(i);function l(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5a57e638.6764a52d.js b/assets/js/5a57e638.e978d988.js similarity index 97% rename from assets/js/5a57e638.6764a52d.js rename to assets/js/5a57e638.e978d988.js index f6969dff8..82691db4d 100644 --- a/assets/js/5a57e638.6764a52d.js +++ b/assets/js/5a57e638.e978d988.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",d={id:"themes/simple",title:"Simple Theme",description:"image",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/docs/next/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-theme",children:"Simple Theme"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["This theme originates from ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),", created by Andreas Kr\xf6pelin."]}),"\n",(0,i.jsx)(n.p,{children:"Considered a relatively straightforward theme, you can use it to create simple slides and freely incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,i.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"background"}),": Background color, defaulting to white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, defaulting to black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, defaulting to ",(0,i.jsx)(n.code,{children:"aqua.darken(50%)"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,i.jsx)(n.p,{children:"The Simple theme provides a variety of custom slide functions:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["A slide with content centered, and the ",(0,i.jsx)(n.code,{children:"section"})," parameter can be used to create a new section."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Similar to ",(0,i.jsx)(n.code,{children:"centered-slide"}),", this is provided for consistency with Polylux syntax."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // simple theme args\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Used to draw attention, it optionally accepts a foreground color (defaulting to ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (defaulting to ",(0,i.jsx)(n.code,{children:"auto"}),", i.e., ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),")."]}),"\n",(0,i.jsxs)(n.h2,{id:"slides-function",children:[(0,i.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"slides"})," function has the following parameter:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can set it using ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["And the function of automatically adding ",(0,i.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/2c599bd1-6250-497f-a65b-f19ae02a16cb",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>o});var i=s(7294);const t={},l=i.createContext(t);function o(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{8811:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:1},o="Simple Theme",d={id:"themes/simple",title:"Simple Theme",description:"image",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/touying/docs/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/docs/next/category/themes"},next:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"simple-theme",children:"Simple Theme"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["This theme originates from ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),", created by Andreas Kr\xf6pelin."]}),"\n",(0,i.jsx)(n.p,{children:"Considered a relatively straightforward theme, you can use it to create simple slides and freely incorporate features you like."}),"\n",(0,i.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,i.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,i.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,i.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"background"}),": Background color, defaulting to white."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"foreground"}),": Text color, defaulting to black."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"primary"}),": Theme color, defaulting to ",(0,i.jsx)(n.code,{children:"aqua.darken(50%)"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,i.jsx)(n.p,{children:"The Simple theme provides a variety of custom slide functions:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["A slide with content centered, and the ",(0,i.jsx)(n.code,{children:"section"})," parameter can be used to create a new section."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#title-slide[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Similar to ",(0,i.jsx)(n.code,{children:"centered-slide"}),", this is provided for consistency with Polylux syntax."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // simple theme args\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsx)(n.p,{children:"A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Used to draw attention, it optionally accepts a foreground color (defaulting to ",(0,i.jsx)(n.code,{children:"white"}),") and a background color (defaulting to ",(0,i.jsx)(n.code,{children:"auto"}),", i.e., ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),")."]}),"\n",(0,i.jsxs)(n.h2,{id:"slides-function",children:[(0,i.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"slides"})," function has the following parameter:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can set it using ",(0,i.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["And the function of automatically adding ",(0,i.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/2c599bd1-6250-497f-a65b-f19ae02a16cb",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>o});var i=s(7294);const t={},l=i.createContext(t);function o(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6607fcb6.18359e4f.js b/assets/js/6607fcb6.4d9db996.js similarity index 98% rename from assets/js/6607fcb6.18359e4f.js rename to assets/js/6607fcb6.4d9db996.js index ec36f4632..1c8bdf440 100644 --- a/assets/js/6607fcb6.18359e4f.js +++ b/assets/js/6607fcb6.4d9db996.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8332],{3732:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var i=t(5893),s=t(1151);const o={sidebar_position:7},l="Multi-File Architecture",c={id:"multi-file",title:"Multi-File Architecture",description:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides.",source:"@site/docs/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/docs/next/category/dynamic-slides"}},a={},r=[{value:"Configuration and Content Separation",id:"configuration-and-content-separation",level:2},{value:"Multiple Sections",id:"multiple-sections",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"multi-file-architecture",children:"Multi-File Architecture"}),"\n",(0,i.jsx)(n.p,{children:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides."}),"\n",(0,i.jsx)(n.p,{children:"If you need to write a large set of slides, such as a course manual spanning tens or hundreds of pages, you can also try Touying's multi-file architecture."}),"\n",(0,i.jsx)(n.h2,{id:"configuration-and-content-separation",children:"Configuration and Content Separation"}),"\n",(0,i.jsxs)(n.p,{children:["A simple Touying multi-file architecture consists of three files: a global configuration file ",(0,i.jsx)(n.code,{children:"globals.typ"}),", a main entry file ",(0,i.jsx)(n.code,{children:"main.typ"}),", and a content file ",(0,i.jsx)(n.code,{children:"content.typ"})," for storing the actual content."]}),"\n",(0,i.jsxs)(n.p,{children:["These three files are separated to allow both ",(0,i.jsx)(n.code,{children:"main.typ"})," and ",(0,i.jsx)(n.code,{children:"content.typ"})," to import ",(0,i.jsx)(n.code,{children:"globals.typ"})," without causing circular references."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"globals.typ"})," can be used to store some global custom functions and initialize Touying themes:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"main.typ"}),", as the main entry point of the project, applies show rules by importing ",(0,i.jsx)(n.code,{children:"globals.typ"})," and includes ",(0,i.jsx)(n.code,{children:"content.typ"})," using ",(0,i.jsx)(n.code,{children:"#include"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"content.typ"})," is where you write the actual content:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.h2,{id:"multiple-sections",children:"Multiple Sections"}),"\n",(0,i.jsxs)(n.p,{children:["Implementing multiple sections is also straightforward. You only need to create a ",(0,i.jsx)(n.code,{children:"sections"})," directory and move the ",(0,i.jsx)(n.code,{children:"content.typ"})," file to the ",(0,i.jsx)(n.code,{children:"sections.typ"})," directory, for example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,i.jsx)(n.p,{children:"And"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:"Now, you have learned how to use Touying to achieve a multi-file architecture for large-scale slides."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var i=t(7294);const s={},o=i.createContext(s);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8332],{3732:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var i=t(5893),s=t(1151);const o={sidebar_position:7},l="Multi-File Architecture",c={id:"multi-file",title:"Multi-File Architecture",description:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides.",source:"@site/docs/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/touying/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/docs/next/category/dynamic-slides"}},a={},r=[{value:"Configuration and Content Separation",id:"configuration-and-content-separation",level:2},{value:"Multiple Sections",id:"multiple-sections",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"multi-file-architecture",children:"Multi-File Architecture"}),"\n",(0,i.jsx)(n.p,{children:"Touying features a syntax as concise as native Typst documents, along with numerous customizable configuration options, yet it still maintains real-time incremental compilation performance, making it suitable for writing large-scale slides."}),"\n",(0,i.jsx)(n.p,{children:"If you need to write a large set of slides, such as a course manual spanning tens or hundreds of pages, you can also try Touying's multi-file architecture."}),"\n",(0,i.jsx)(n.h2,{id:"configuration-and-content-separation",children:"Configuration and Content Separation"}),"\n",(0,i.jsxs)(n.p,{children:["A simple Touying multi-file architecture consists of three files: a global configuration file ",(0,i.jsx)(n.code,{children:"globals.typ"}),", a main entry file ",(0,i.jsx)(n.code,{children:"main.typ"}),", and a content file ",(0,i.jsx)(n.code,{children:"content.typ"})," for storing the actual content."]}),"\n",(0,i.jsxs)(n.p,{children:["These three files are separated to allow both ",(0,i.jsx)(n.code,{children:"main.typ"})," and ",(0,i.jsx)(n.code,{children:"content.typ"})," to import ",(0,i.jsx)(n.code,{children:"globals.typ"})," without causing circular references."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"globals.typ"})," can be used to store some global custom functions and initialize Touying themes:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"main.typ"}),", as the main entry point of the project, applies show rules by importing ",(0,i.jsx)(n.code,{children:"globals.typ"})," and includes ",(0,i.jsx)(n.code,{children:"content.typ"})," using ",(0,i.jsx)(n.code,{children:"#include"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"content.typ"})," is where you write the actual content:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.h2,{id:"multiple-sections",children:"Multiple Sections"}),"\n",(0,i.jsxs)(n.p,{children:["Implementing multiple sections is also straightforward. You only need to create a ",(0,i.jsx)(n.code,{children:"sections"})," directory and move the ",(0,i.jsx)(n.code,{children:"content.typ"})," file to the ",(0,i.jsx)(n.code,{children:"sections.typ"})," directory, for example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,i.jsx)(n.p,{children:"And"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:"Now, you have learned how to use Touying to achieve a multi-file architecture for large-scale slides."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var i=t(7294);const s={},o=i.createContext(s);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7d3539b2.b4866903.js b/assets/js/7d3539b2.06b94f08.js similarity index 98% rename from assets/js/7d3539b2.b4866903.js rename to assets/js/7d3539b2.06b94f08.js index 97db92914..41cbc191b 100644 --- a/assets/js/7d3539b2.b4866903.js +++ b/assets/js/7d3539b2.06b94f08.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4481],{6594:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=i(5893),s=i(1151);const l={sidebar_position:4},o="University Theme",r={id:"themes/university",title:"University Theme",description:"image",source:"@site/docs/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"},next:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"}},d={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Title Slide",id:"title-slide",level:3},{value:"Regular Slide",id:"regular-slide",level:3},{value:"Focus Slide",id:"focus-slide",level:3},{value:"Matrix Slide",id:"matrix-slide",level:3},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"university-theme",children:"University Theme"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["This aesthetically pleasing theme is courtesy of ",(0,t.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsx)(n.p,{children:"You can initialize the University theme using the following code:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"register"})," function accepts the following parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"progress-bar"}),": Controls whether the progress bar at the top of each slide is displayed, with the default being ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"display-current-section"}),": Whether to display the current section."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-columns"}),": The width of the footer in the bottom three columns, the default is ",(0,t.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-a"}),": The first column, default is ",(0,t.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-b"}),": Second column, default is ",(0,t.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-c"}),": third column, default is"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Additionally, the University theme provides an ",(0,t.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with the ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," syntax for emphasizing text with ",(0,t.jsx)(n.code,{children:"*alert text*"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,t.jsx)(n.p,{children:"The University theme defaults to the following color theme:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["You can modify this color theme using ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,t.jsx)(n.p,{children:"The University theme provides a series of custom slide functions:"}),"\n",(0,t.jsx)(n.h3,{id:"title-slide",children:"Title Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(logo: none, authors: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"title-slide"})," function reads information from ",(0,t.jsx)(n.code,{children:"self.info"})," for display. You can also pass the ",(0,t.jsx)(n.code,{children:"logo"})," parameter and an array-type ",(0,t.jsx)(n.code,{children:"authors"})," parameter."]}),"\n",(0,t.jsx)(n.h3,{id:"regular-slide",children:"Regular Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The default slide function with a title and footer. The ",(0,t.jsx)(n.code,{children:"title"})," defaults to the current section title, and the footer is set as per your configuration."]}),"\n",(0,t.jsx)(n.h3,{id:"focus-slide",children:"Focus Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Used to capture the audience's attention. The default background color is ",(0,t.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"matrix-slide",children:"Matrix Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Refer to the ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"documentation"}),"."]}),"\n",(0,t.jsxs)(n.h2,{id:"slides-function",children:[(0,t.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,t.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["You can set these parameters using ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["And the function of automatically adding ",(0,t.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",alt:"image"})}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>o});var t=i(7294);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4481],{6594:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});var t=i(5893),s=i(1151);const l={sidebar_position:4},o="University Theme",r={id:"themes/university",title:"University Theme",description:"image",source:"@site/docs/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"},next:{title:"Aqua Theme",permalink:"/touying/docs/next/themes/aqua"}},d={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Title Slide",id:"title-slide",level:3},{value:"Regular Slide",id:"regular-slide",level:3},{value:"Focus Slide",id:"focus-slide",level:3},{value:"Matrix Slide",id:"matrix-slide",level:3},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"university-theme",children:"University Theme"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,t.jsxs)(n.p,{children:["This aesthetically pleasing theme is courtesy of ",(0,t.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsx)(n.p,{children:"You can initialize the University theme using the following code:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"register"})," function accepts the following parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"progress-bar"}),": Controls whether the progress bar at the top of each slide is displayed, with the default being ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"display-current-section"}),": Whether to display the current section."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-columns"}),": The width of the footer in the bottom three columns, the default is ",(0,t.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-a"}),": The first column, default is ",(0,t.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-b"}),": Second column, default is ",(0,t.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-c"}),": third column, default is"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Additionally, the University theme provides an ",(0,t.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with the ",(0,t.jsx)(n.code,{children:"#show strong: alert"})," syntax for emphasizing text with ",(0,t.jsx)(n.code,{children:"*alert text*"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,t.jsx)(n.p,{children:"The University theme defaults to the following color theme:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["You can modify this color theme using ",(0,t.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,t.jsx)(n.p,{children:"The University theme provides a series of custom slide functions:"}),"\n",(0,t.jsx)(n.h3,{id:"title-slide",children:"Title Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide(logo: none, authors: none, ..args)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"title-slide"})," function reads information from ",(0,t.jsx)(n.code,{children:"self.info"})," for display. You can also pass the ",(0,t.jsx)(n.code,{children:"logo"})," parameter and an array-type ",(0,t.jsx)(n.code,{children:"authors"})," parameter."]}),"\n",(0,t.jsx)(n.h3,{id:"regular-slide",children:"Regular Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The default slide function with a title and footer. The ",(0,t.jsx)(n.code,{children:"title"})," defaults to the current section title, and the footer is set as per your configuration."]}),"\n",(0,t.jsx)(n.h3,{id:"focus-slide",children:"Focus Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Used to capture the audience's attention. The default background color is ",(0,t.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"matrix-slide",children:"Matrix Slide"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Refer to the ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"documentation"}),"."]}),"\n",(0,t.jsxs)(n.h2,{id:"slides-function",children:[(0,t.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"slides"})," function has parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,t.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["You can set these parameters using ",(0,t.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["And the function of automatically adding ",(0,t.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",alt:"image"})}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>o});var t=i(7294);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7f65dfb7.e0a5ac39.js b/assets/js/7f65dfb7.26d35ace.js similarity index 96% rename from assets/js/7f65dfb7.e0a5ac39.js rename to assets/js/7f65dfb7.26d35ace.js index bfb5b56cb..8dd5036c8 100644 --- a/assets/js/7f65dfb7.e0a5ac39.js +++ b/assets/js/7f65dfb7.26d35ace.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6917],{2049:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>r});var i=n(5893),t=n(1151);const l={sidebar_position:4},o="Code Style",d={id:"code-styles",title:"Code Style",description:"Simple Style",source:"@site/docs/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"},next:{title:"Page Layout",permalink:"/touying/docs/next/layout"}},c={},r=[{value:"Simple Style",id:"simple-style",level:2},{value:"Block Style",id:"block-style",level:2},{value:"Convention Over Configuration",id:"convention-over-configuration",level:2}];function a(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"code-style",children:"Code Style"}),"\n",(0,i.jsx)(s.h2,{id:"simple-style",children:"Simple Style"}),"\n",(0,i.jsxs)(s.p,{children:["If we only need simplicity, we can directly input content under the heading, just like writing a normal Typst document. The heading here serves to divide the pages, and we can use commands like ",(0,i.jsx)(s.code,{children:"#pause"})," to achieve animation effects."]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["You can use an empty heading ",(0,i.jsx)(s.code,{children:"=="})," to create a new page. This skill also helps clear the continuation of the previous title."]}),"\n",(0,i.jsxs)(s.p,{children:["PS: We can use the ",(0,i.jsx)(s.code,{children:"#slides-end"})," marker to signify the end of ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"block-style",children:"Block Style"}),"\n",(0,i.jsxs)(s.p,{children:["Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of ",(0,i.jsx)(s.code,{children:"#slide[...]"}),". The ",(0,i.jsx)(s.code,{children:"#slide"})," function needs to be unpacked using the syntax ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," to be used correctly after ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"For example, the previous example can be transformed into:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["and ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," to create an empty slide without header and footer."]}),"\n",(0,i.jsx)(s.p,{children:"There are many advantages to doing this:"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["Many times, we not only need the default ",(0,i.jsx)(s.code,{children:"#slide[...]"})," but also special ",(0,i.jsx)(s.code,{children:"slide"})," functions like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Different themes' ",(0,i.jsx)(s.code,{children:"#slide[...]"})," functions may have more parameters than the default, such as the university theme's ",(0,i.jsx)(s.code,{children:"#slide[...]"})," function having a ",(0,i.jsx)(s.code,{children:"subtitle"})," parameter."]}),"\n",(0,i.jsxs)(s.li,{children:["Only ",(0,i.jsx)(s.code,{children:"slide"})," functions can use the callback-style content block to achieve complex animation effects with ",(0,i.jsx)(s.code,{children:"#only"})," and ",(0,i.jsx)(s.code,{children:"#uncover"})," functions."]}),"\n",(0,i.jsxs)(s.li,{children:["It has a clearer structure. By identifying ",(0,i.jsx)(s.code,{children:"#slide[...]"})," blocks, we can easily distinguish the specific pagination effects of slides."]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"convention-over-configuration",children:"Convention Over Configuration"}),"\n",(0,i.jsxs)(s.p,{children:["You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," method, so Touying will automatically call this method."]}),"\n",(0,i.jsx)(s.p,{children:"If we don't want it to automatically create such a section slide, we can delete this method:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"As you can see, there are only two pages left, and the default section slide is gone."}),"\n",(0,i.jsx)(s.p,{children:"Similarly, we can register a new section slide:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["Similarly, we can modify ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," to do the same for ",(0,i.jsx)(s.code,{children:"subsection"}),"."]}),"\n",(0,i.jsxs)(s.p,{children:["In fact, besides ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),", another special ",(0,i.jsx)(s.code,{children:"slide"})," function is the ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," function, which will be called by default in simple style when ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is not explicitly used."]}),"\n",(0,i.jsxs)(s.p,{children:["Also, since ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is registered in ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'}),", the ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"})," parameters will be automatically passed, while others like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," will not automatically receive these three parameters."]}),"\n",(0,i.jsxs)(s.admonition,{title:"Principle",type:"tip",children:[(0,i.jsxs)(s.p,{children:["In fact, you can also not use ",(0,i.jsx)(s.code,{children:"#show: slides"})," and ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),", but only use ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),", for example:"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["Here, you need to manually pass in ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"}),", but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages."]})]})]})}function h(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>o});var i=n(7294);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6917],{2049:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>r});var i=n(5893),t=n(1151);const l={sidebar_position:4},o="Code Style",d={id:"code-styles",title:"Code Style",description:"Simple Style",source:"@site/docs/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"},next:{title:"Page Layout",permalink:"/touying/docs/next/layout"}},c={},r=[{value:"Simple Style",id:"simple-style",level:2},{value:"Block Style",id:"block-style",level:2},{value:"Convention Over Configuration",id:"convention-over-configuration",level:2}];function a(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"code-style",children:"Code Style"}),"\n",(0,i.jsx)(s.h2,{id:"simple-style",children:"Simple Style"}),"\n",(0,i.jsxs)(s.p,{children:["If we only need simplicity, we can directly input content under the heading, just like writing a normal Typst document. The heading here serves to divide the pages, and we can use commands like ",(0,i.jsx)(s.code,{children:"#pause"})," to achieve animation effects."]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["You can use an empty heading ",(0,i.jsx)(s.code,{children:"=="})," to create a new page. This skill also helps clear the continuation of the previous title."]}),"\n",(0,i.jsxs)(s.p,{children:["PS: We can use the ",(0,i.jsx)(s.code,{children:"#slides-end"})," marker to signify the end of ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"block-style",children:"Block Style"}),"\n",(0,i.jsxs)(s.p,{children:["Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of ",(0,i.jsx)(s.code,{children:"#slide[...]"}),". The ",(0,i.jsx)(s.code,{children:"#slide"})," function needs to be unpacked using the syntax ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," to be used correctly after ",(0,i.jsx)(s.code,{children:"#show: slides"}),"."]}),"\n",(0,i.jsx)(s.p,{children:"For example, the previous example can be transformed into:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["and ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," to create an empty slide without header and footer."]}),"\n",(0,i.jsx)(s.p,{children:"There are many advantages to doing this:"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["Many times, we not only need the default ",(0,i.jsx)(s.code,{children:"#slide[...]"})," but also special ",(0,i.jsx)(s.code,{children:"slide"})," functions like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Different themes' ",(0,i.jsx)(s.code,{children:"#slide[...]"})," functions may have more parameters than the default, such as the university theme's ",(0,i.jsx)(s.code,{children:"#slide[...]"})," function having a ",(0,i.jsx)(s.code,{children:"subtitle"})," parameter."]}),"\n",(0,i.jsxs)(s.li,{children:["Only ",(0,i.jsx)(s.code,{children:"slide"})," functions can use the callback-style content block to achieve complex animation effects with ",(0,i.jsx)(s.code,{children:"#only"})," and ",(0,i.jsx)(s.code,{children:"#uncover"})," functions."]}),"\n",(0,i.jsxs)(s.li,{children:["It has a clearer structure. By identifying ",(0,i.jsx)(s.code,{children:"#slide[...]"})," blocks, we can easily distinguish the specific pagination effects of slides."]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"convention-over-configuration",children:"Convention Over Configuration"}),"\n",(0,i.jsxs)(s.p,{children:["You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," method, so Touying will automatically call this method."]}),"\n",(0,i.jsx)(s.p,{children:"If we don't want it to automatically create such a section slide, we can delete this method:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"As you can see, there are only two pages left, and the default section slide is gone."}),"\n",(0,i.jsx)(s.p,{children:"Similarly, we can register a new section slide:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["Similarly, we can modify ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," to do the same for ",(0,i.jsx)(s.code,{children:"subsection"}),"."]}),"\n",(0,i.jsxs)(s.p,{children:["In fact, besides ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),", another special ",(0,i.jsx)(s.code,{children:"slide"})," function is the ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," function, which will be called by default in simple style when ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is not explicitly used."]}),"\n",(0,i.jsxs)(s.p,{children:["Also, since ",(0,i.jsx)(s.code,{children:"#slide[...]"})," is registered in ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'}),", the ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"})," parameters will be automatically passed, while others like ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," will not automatically receive these three parameters."]}),"\n",(0,i.jsxs)(s.admonition,{title:"Principle",type:"tip",children:[(0,i.jsxs)(s.p,{children:["In fact, you can also not use ",(0,i.jsx)(s.code,{children:"#show: slides"})," and ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),", but only use ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),", for example:"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["Here, you need to manually pass in ",(0,i.jsx)(s.code,{children:"section"}),", ",(0,i.jsx)(s.code,{children:"subsection"}),", and ",(0,i.jsx)(s.code,{children:"title"}),", but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages."]})]})]})}function h(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>d,a:()=>o});var i=n(7294);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/80a0c88e.a9a1492a.js b/assets/js/80a0c88e.b733f954.js similarity index 98% rename from assets/js/80a0c88e.a9a1492a.js rename to assets/js/80a0c88e.b733f954.js index b0fc8b666..28b915d97 100644 --- a/assets/js/80a0c88e.a9a1492a.js +++ b/assets/js/80a0c88e.b733f954.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3209],{8135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="Metropolis Theme",r={id:"themes/metropolis",title:"Metropolis Theme",description:"image",source:"@site/docs/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/docs/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Theme",permalink:"/touying/docs/next/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"}},d={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"metropolis-theme",children:"Metropolis Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/383ceb22-f696-4450-83a6-c0f17e4597e1",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme draws inspiration from Matthias Vogelgesang's ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme is elegant and suitable for everyday use. It is recommended to have Fira Sans and Fira Math fonts installed on your computer for the best results."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content displayed in the header, defaulting to ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.title"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-progress"}),": Whether to show the progress bar at the bottom of the slide, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Metropolis theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Metropolis uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary-dark"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4ab45ee6-09f7-498b-b349-e889d6e42e3e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3209],{8135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var s=t(5893),i=t(1151);const o={sidebar_position:2},l="Metropolis Theme",r={id:"themes/metropolis",title:"Metropolis Theme",description:"image",source:"@site/docs/themes/metropolis.md",sourceDirName:"themes",slug:"/themes/metropolis",permalink:"/touying/docs/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple Theme",permalink:"/touying/docs/next/themes/simple"},next:{title:"Dewdrop Theme",permalink:"/touying/docs/next/themes/dewdrop"}},d={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"metropolis-theme",children:"Metropolis Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/383ceb22-f696-4450-83a6-c0f17e4597e1",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme draws inspiration from Matthias Vogelgesang's ",(0,s.jsx)(n.a,{href:"https://github.com/matze/mtheme",children:"Metropolis beamer"})," theme and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/Enivex",children:"Enivex"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme is elegant and suitable for everyday use. It is recommended to have Fira Sans and Fira Math fonts installed on your computer for the best results."}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"header"}),": Content displayed in the header, defaulting to ",(0,s.jsx)(n.code,{children:"states.current-section-title"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.title"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-progress"}),": Whether to show the progress bar at the bottom of the slide, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Metropolis theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Metropolis uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-lightest: rgb("#fafafa"),\n primary-dark: rgb("#23373b"),\n secondary-light: rgb("#eb811b"),\n secondary-lighter: rgb("#d6c6b7"),\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Metropolis theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // metropolis theme\n title: auto,\n footer: auto,\n align: horizon,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary-dark"}),"."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a new section with the given title."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4ab45ee6-09f7-498b-b349-e889d6e42e3e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8ac96054.67767120.js b/assets/js/8ac96054.96187a17.js similarity index 98% rename from assets/js/8ac96054.67767120.js rename to assets/js/8ac96054.96187a17.js index 6dcc64ef8..29def8c5d 100644 --- a/assets/js/8ac96054.67767120.js +++ b/assets/js/8ac96054.96187a17.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9527],{3680:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>p,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(5893),o=t(1151);const s={sidebar_position:1},d="Pdfpc",r={id:"external/pdfpc",title:"Pdfpc",description:'pdfpc is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.',source:"@site/docs/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/docs/next/external/pympress"}},a={},c=[{value:"Adding Metadata",id:"adding-metadata",level:2},{value:"Pdfpc Configuration",id:"pdfpc-configuration",level:2},{value:"Exporting .pdfpc File",id:"exporting-pdfpc-file",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"pdfpc",children:"Pdfpc"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"pdfpc"}),' is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.']}),"\n",(0,i.jsxs)(n.p,{children:["pdfpc has a JSON-formatted ",(0,i.jsx)(n.code,{children:".pdfpc"})," file that can provide additional information for PDF slides. While you can manually write this file, you can also manage it through Touying."]}),"\n",(0,i.jsx)(n.h2,{id:"adding-metadata",children:"Adding Metadata"}),"\n",(0,i.jsxs)(n.p,{children:["Touying remains consistent with ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," to avoid conflicts between APIs."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, you can add notes using ",(0,i.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pdfpc-configuration",children:"Pdfpc Configuration"}),"\n",(0,i.jsx)(n.p,{children:"To add pdfpc configurations, you can use"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Add the corresponding configurations. Refer to ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," for specific configuration details."]}),"\n",(0,i.jsx)(n.h2,{id:"exporting-pdfpc-file",children:"Exporting .pdfpc File"}),"\n",(0,i.jsxs)(n.p,{children:["Assuming your document is ",(0,i.jsx)(n.code,{children:"./example.typ"}),", you can export the ",(0,i.jsx)(n.code,{children:".pdfpc"})," file directly using:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,i.jsx)(n.p,{children:"With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>d});var i=t(7294);const o={},s=i.createContext(o);function d(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:d(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9527],{3680:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>p,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var i=t(5893),o=t(1151);const s={sidebar_position:1},d="Pdfpc",r={id:"external/pdfpc",title:"Pdfpc",description:'pdfpc is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.',source:"@site/docs/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/docs/next/external/pympress"}},a={},c=[{value:"Adding Metadata",id:"adding-metadata",level:2},{value:"Pdfpc Configuration",id:"pdfpc-configuration",level:2},{value:"Exporting .pdfpc File",id:"exporting-pdfpc-file",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"pdfpc",children:"Pdfpc"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"pdfpc"}),' is a "Presenter Console with multi-monitor support for PDF files." This means you can use it to display slides in the form of PDF pages and it comes with some known excellent features, much like PowerPoint.']}),"\n",(0,i.jsxs)(n.p,{children:["pdfpc has a JSON-formatted ",(0,i.jsx)(n.code,{children:".pdfpc"})," file that can provide additional information for PDF slides. While you can manually write this file, you can also manage it through Touying."]}),"\n",(0,i.jsx)(n.h2,{id:"adding-metadata",children:"Adding Metadata"}),"\n",(0,i.jsxs)(n.p,{children:["Touying remains consistent with ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," to avoid conflicts between APIs."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, you can add notes using ",(0,i.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pdfpc-configuration",children:"Pdfpc Configuration"}),"\n",(0,i.jsx)(n.p,{children:"To add pdfpc configurations, you can use"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Add the corresponding configurations. Refer to ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," for specific configuration details."]}),"\n",(0,i.jsx)(n.h2,{id:"exporting-pdfpc-file",children:"Exporting .pdfpc File"}),"\n",(0,i.jsxs)(n.p,{children:["Assuming your document is ",(0,i.jsx)(n.code,{children:"./example.typ"}),", you can export the ",(0,i.jsx)(n.code,{children:".pdfpc"})," file directly using:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,i.jsx)(n.p,{children:"With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>r,a:()=>d});var i=t(7294);const o={},s=i.createContext(o);function d(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:d(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/98ce8162.0db38a50.js b/assets/js/98ce8162.287e62b5.js similarity index 98% rename from assets/js/98ce8162.0db38a50.js rename to assets/js/98ce8162.287e62b5.js index 32f555e4d..244676fc3 100644 --- a/assets/js/98ce8162.0db38a50.js +++ b/assets/js/98ce8162.287e62b5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const o={sidebar_position:2},r="Getting Started",a={id:"start",title:"Getting Started",description:"Before you begin, make sure you have the Typst environment installed. If not, you can use the Web App or install the Tinymist LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to Touying",permalink:"/touying/docs/next/intro"},next:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"}},l={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["Before you begin, make sure you have the Typst environment installed. If not, you can use the ",(0,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or install the ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," and ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," plugins for VS Code."]}),"\n",(0,i.jsx)(n.p,{children:"To use Touying, you just need to include the following in your document:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"It's that simple! You've created your first Touying slides. Congratulations! \ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip:"})," You can use Typst syntax like ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," or ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," to implement Touying's multi-file architecture."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Warning:"})," The comma in ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," is necessary for the unpacking syntax."]}),"\n",(0,i.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, Touying provides various styles for slide writing. You can also use the ",(0,i.jsx)(n.code,{children:"#slide[..]"})," syntax to access more powerful features provided by Touying."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1543],{8194:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const o={sidebar_position:2},r="Getting Started",a={id:"start",title:"Getting Started",description:"Before you begin, make sure you have the Typst environment installed. If not, you can use the Web App or install the Tinymist LSP and Typst Preview plugins for VS Code.",source:"@site/docs/start.md",sourceDirName:".",slug:"/start",permalink:"/touying/docs/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to Touying",permalink:"/touying/docs/next/intro"},next:{title:"Sections and Subsections",permalink:"/touying/docs/next/sections"}},l={},d=[{value:"More Complex Examples",id:"more-complex-examples",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["Before you begin, make sure you have the Typst environment installed. If not, you can use the ",(0,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," or install the ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," and ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," plugins for VS Code."]}),"\n",(0,i.jsx)(n.p,{children:"To use Touying, you just need to include the following in your document:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"It's that simple! You've created your first Touying slides. Congratulations! \ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip:"})," You can use Typst syntax like ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," or ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," to implement Touying's multi-file architecture."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Warning:"})," The comma in ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," is necessary for the unpacking syntax."]}),"\n",(0,i.jsx)(n.h2,{id:"more-complex-examples",children:"More Complex Examples"}),"\n",(0,i.jsxs)(n.p,{children:["In fact, Touying provides various styles for slide writing. You can also use the ",(0,i.jsx)(n.code,{children:"#slide[..]"})," syntax to access more powerful features provided by Touying."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying offers many built-in themes to easily create beautiful slides. For example, in this case:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections."})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ab32da60.1d07324a.js b/assets/js/ab32da60.7b00de2b.js similarity index 96% rename from assets/js/ab32da60.1d07324a.js rename to assets/js/ab32da60.7b00de2b.js index c8c3e3162..81cf779c1 100644 --- a/assets/js/ab32da60.1d07324a.js +++ b/assets/js/ab32da60.7b00de2b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7190],{7022:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},l="Sections and Subsections",c={id:"sections",title:"Sections and Subsections",description:"Structure",source:"@site/docs/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/next/start"},next:{title:"Code Style",permalink:"/touying/docs/next/code-styles"}},r={},d=[{value:"Structure",id:"structure",level:2},{value:"Numbering",id:"numbering",level:2},{value:"Table of Contents",id:"table-of-contents",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.h2,{id:"structure",children:"Structure"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concept of sections and subsections."}),"\n",(0,s.jsx)(n.p,{children:"Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["In fact, we can control this behavior through the ",(0,s.jsx)(n.code,{children:"slide-level"})," parameter of the ",(0,s.jsx)(n.code,{children:"slides"})," function. ",(0,s.jsx)(n.code,{children:"slide-level"})," represents the complexity of the nested structure, starting from 0. For example, ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," is equivalent to the section, subsection, and title structure; while ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," is equivalent to the section and title structure."]}),"\n",(0,s.jsx)(n.h2,{id:"numbering",children:"Numbering"}),"\n",(0,s.jsx)(n.p,{children:"To add numbering to sections and subsections, we simply use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["This sets the default numbering to ",(0,s.jsx)(n.code,{children:"1.1"}),", with the section corresponding to ",(0,s.jsx)(n.code,{children:"1."}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsx)(n.p,{children:"Displaying a table of contents in Touying is straightforward:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["Where the definition of ",(0,s.jsx)(n.code,{children:"touying-outline()"})," is:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify the parameters of the internal enum through ",(0,s.jsx)(n.code,{children:"enum-args"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If you have complex custom requirements for the table of contents, you can use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,s.jsx)(n.p,{children:"As done in the dewdrop theme."})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7190],{7022:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=t(5893),i=t(1151);const o={sidebar_position:3},l="Sections and Subsections",c={id:"sections",title:"Sections and Subsections",description:"Structure",source:"@site/docs/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Getting Started",permalink:"/touying/docs/next/start"},next:{title:"Code Style",permalink:"/touying/docs/next/code-styles"}},r={},d=[{value:"Structure",id:"structure",level:2},{value:"Numbering",id:"numbering",level:2},{value:"Table of Contents",id:"table-of-contents",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sections-and-subsections",children:"Sections and Subsections"}),"\n",(0,s.jsx)(n.h2,{id:"structure",children:"Structure"}),"\n",(0,s.jsx)(n.p,{children:"Similar to Beamer, Touying also has the concept of sections and subsections."}),"\n",(0,s.jsx)(n.p,{children:"Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["In fact, we can control this behavior through the ",(0,s.jsx)(n.code,{children:"slide-level"})," parameter of the ",(0,s.jsx)(n.code,{children:"slides"})," function. ",(0,s.jsx)(n.code,{children:"slide-level"})," represents the complexity of the nested structure, starting from 0. For example, ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," is equivalent to the section, subsection, and title structure; while ",(0,s.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," is equivalent to the section and title structure."]}),"\n",(0,s.jsx)(n.h2,{id:"numbering",children:"Numbering"}),"\n",(0,s.jsx)(n.p,{children:"To add numbering to sections and subsections, we simply use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["This sets the default numbering to ",(0,s.jsx)(n.code,{children:"1.1"}),", with the section corresponding to ",(0,s.jsx)(n.code,{children:"1."}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsx)(n.p,{children:"Displaying a table of contents in Touying is straightforward:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["Where the definition of ",(0,s.jsx)(n.code,{children:"touying-outline()"})," is:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#let touying-outline(enum-args: (:), padding: 0pt) = { .. }\n"})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify the parameters of the internal enum through ",(0,s.jsx)(n.code,{children:"enum-args"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If you have complex custom requirements for the table of contents, you can use:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,s.jsx)(n.p,{children:"As done in the dewdrop theme."})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>l});var s=t(7294);const i={},o=s.createContext(i);function l(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c38df086.3a34d537.js b/assets/js/c38df086.21aead31.js similarity index 98% rename from assets/js/c38df086.3a34d537.js rename to assets/js/c38df086.21aead31.js index cf9c5fe9e..e330619a1 100644 --- a/assets/js/c38df086.3a34d537.js +++ b/assets/js/c38df086.21aead31.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6154],{82:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var i=t(5893),o=t(1151);const s={sidebar_position:1},a="Pinit",p={id:"integration/pinit",title:"Pinit",description:'Pinit package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.',source:"@site/docs/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"}},r={},l=[{value:"Simple Example",id:"simple-example",level:2},{value:"Complex Example",id:"complex-example",level:2}];function c(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"}),' package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.']}),"\n",(0,i.jsx)(e.h2,{id:"simple-example",children:"Simple Example"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(e.p,{children:["Another ",(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"example"}),":"]}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(e.h2,{id:"complex-example",children:"Complex Example"}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(e.p,{children:"An example of shared usage with Touying:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:e}={...(0,o.a)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>p,a:()=>a});var i=t(7294);const o={},s=i.createContext(o);function a(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:a(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6154],{82:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var i=t(5893),o=t(1151);const s={sidebar_position:1},a="Pinit",p={id:"integration/pinit",title:"Pinit",description:'Pinit package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.',source:"@site/docs/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/docs/next/integration/mitex"}},r={},l=[{value:"Simple Example",id:"simple-example",level:2},{value:"Complex Example",id:"complex-example",level:2}];function c(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"}),' package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.']}),"\n",(0,i.jsx)(e.h2,{id:"simple-example",children:"Simple Example"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(e.p,{children:["Another ",(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"example"}),":"]}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(e.h2,{id:"complex-example",children:"Complex Example"}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(e.p,{children:"An example of shared usage with Touying:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:e}={...(0,o.a)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>p,a:()=>a});var i=t(7294);const o={},s=i.createContext(o);function a(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:a(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/d16cbc15.e70ad829.js b/assets/js/d16cbc15.5450aa44.js similarity index 98% rename from assets/js/d16cbc15.e70ad829.js rename to assets/js/d16cbc15.5450aa44.js index c0b48a5cf..a5dabf9c5 100644 --- a/assets/js/d16cbc15.e70ad829.js +++ b/assets/js/d16cbc15.5450aa44.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2403],{9741:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var s=i(5893),t=i(1151);const l={sidebar_position:3},o="Dewdrop Theme",d={id:"themes/dewdrop",title:"Dewdrop Theme",description:"image",source:"@site/docs/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/docs/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"},next:{title:"University Theme",permalink:"/touying/docs/next/themes/university"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Special Functions",id:"special-functions",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"dewdrop-theme",children:"Dewdrop Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme takes inspiration from Zhibo Wang's ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme features an elegantly designed navigation, including two modes: ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),": The navigation bar style, which can be ",(0,s.jsx)(n.code,{children:'"sidebar"'}),", ",(0,s.jsx)(n.code,{children:'"mini-slides"'}),", or ",(0,s.jsx)(n.code,{children:"none"}),", defaulting to ",(0,s.jsx)(n.code,{children:'"sidebar"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Sidebar navigation settings, defaulting to ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Mini-slides settings, defaulting to ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"height"}),": The height of mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"x"}),": Padding on the x-axis for mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"section"}),": Whether to display slides after the section and before the subsection, defaulting to ",(0,s.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"subsection"}),": Whether to split mini-slides based on subsections or compress them into one line, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"primary"}),": Primary color, defaulting to ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, defaulting to ",(0,s.jsx)(n.code,{children:"70%"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Dewdrop uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-darkest: rgb("#000000"),\n neutral-dark: rgb("#202020"),\n neutral-light: rgb("#f3f3f3"),\n neutral-lightest: rgb("#ffffff"),\n primary: primary,\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Dewdrop theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with navigation and footer, where the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"special-functions",children:"Special Functions"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Displays the current table of contents. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections in an inactive state."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display the sidebar."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display mini-slides."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"2"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/09ddfb40-4f97-4062-8261-23f87690c33e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2403],{9741:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var s=i(5893),t=i(1151);const l={sidebar_position:3},o="Dewdrop Theme",d={id:"themes/dewdrop",title:"Dewdrop Theme",description:"image",source:"@site/docs/themes/dewdrop.md",sourceDirName:"themes",slug:"/themes/dewdrop",permalink:"/touying/docs/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis Theme",permalink:"/touying/docs/next/themes/metropolis"},next:{title:"University Theme",permalink:"/touying/docs/next/themes/university"}},r={},c=[{value:"Initialization",id:"initialization",level:2},{value:"Color Theme",id:"color-theme",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Special Functions",id:"special-functions",level:2},{value:"slides Function",id:"slides-function",level:2},{value:"Example",id:"example",level:2}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"dewdrop-theme",children:"Dewdrop Theme"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["This theme takes inspiration from Zhibo Wang's ",(0,s.jsx)(n.a,{href:"https://github.com/zbowang/BeamerTheme",children:"BeamerTheme"})," and has been modified by ",(0,s.jsx)(n.a,{href:"https://github.com/OrangeX4",children:"OrangeX4"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme features an elegantly designed navigation, including two modes: ",(0,s.jsx)(n.code,{children:"sidebar"})," and ",(0,s.jsx)(n.code,{children:"mini-slides"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,s.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"register"})," function takes the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"navigation"}),": The navigation bar style, which can be ",(0,s.jsx)(n.code,{children:'"sidebar"'}),", ",(0,s.jsx)(n.code,{children:'"mini-slides"'}),", or ",(0,s.jsx)(n.code,{children:"none"}),", defaulting to ",(0,s.jsx)(n.code,{children:'"sidebar"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"sidebar"}),": Sidebar navigation settings, defaulting to ",(0,s.jsx)(n.code,{children:"(width: 10em)"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"mini-slides"}),": Mini-slides settings, defaulting to ",(0,s.jsx)(n.code,{children:"(height: 2em, x: 2em, section: false, subsection: true)"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"height"}),": The height of mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"x"}),": Padding on the x-axis for mini-slides, defaulting to ",(0,s.jsx)(n.code,{children:"2em"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"section"}),": Whether to display slides after the section and before the subsection, defaulting to ",(0,s.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"subsection"}),": Whether to split mini-slides based on subsections or compress them into one line, defaulting to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer"}),": Content displayed in the footer, defaulting to ",(0,s.jsx)(n.code,{children:"[]"}),", or it can be passed as a function like ",(0,s.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"footer-right"}),": Content displayed on the right side of the footer, defaulting to ",(0,s.jsx)(n.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"primary"}),": Primary color, defaulting to ",(0,s.jsx)(n.code,{children:'rgb("#0c4842")'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"alpha"}),": Transparency, defaulting to ",(0,s.jsx)(n.code,{children:"70%"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The Dewdrop theme also provides an ",(0,s.jsx)(n.code,{children:"#alert[..]"})," function, which you can use with ",(0,s.jsx)(n.code,{children:"#show strong: alert"})," using the ",(0,s.jsx)(n.code,{children:"*alert text*"})," syntax."]}),"\n",(0,s.jsx)(n.h2,{id:"color-theme",children:"Color Theme"}),"\n",(0,s.jsx)(n.p,{children:"Dewdrop uses the following default color theme:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.colors)(\n self: s,\n neutral-darkest: rgb("#000000"),\n neutral-dark: rgb("#202020"),\n neutral-light: rgb("#f3f3f3"),\n neutral-lightest: rgb("#ffffff"),\n primary: primary,\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify this color theme using ",(0,s.jsx)(n.code,{children:"#let s = (s.methods.colors)(self: s, ..)"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,s.jsx)(n.p,{children:"The Dewdrop theme provides a variety of custom slide functions:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#title-slide(extra: none, ..args)\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"title-slide"})," reads information from ",(0,s.jsx)(n.code,{children:"self.info"})," for display, and you can also pass in an ",(0,s.jsx)(n.code,{children:"extra"})," parameter to display additional information."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(\n repeat: auto,\n setting: body => body,\n composer: utils.side-by-side,\n section: none,\n subsection: none,\n // Dewdrop theme\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,s.jsx)(n.p,{children:"A default slide with navigation and footer, where the footer is what you set."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#focus-slide[\n ...\n]\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Used to draw attention, with the background color set to ",(0,s.jsx)(n.code,{children:"self.colors.primary"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"special-functions",children:"Special Functions"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-outline(enum-args: (:), list-args: (:), cover: true)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Displays the current table of contents. The ",(0,s.jsx)(n.code,{children:"cover"})," parameter specifies whether to hide sections in an inactive state."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-sidebar()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display the sidebar."}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#d-mini-slides()\n"})}),"\n",(0,s.jsx)(n.p,{children:"An internal function used to display mini-slides."}),"\n",(0,s.jsxs)(n.h2,{id:"slides-function",children:[(0,s.jsx)(n.code,{children:"slides"})," Function"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"slides"})," function has the following parameters:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"title-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"outline-slide"}),": Defaults to ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"slide-level"}),": Defaults to ",(0,s.jsx)(n.code,{children:"2"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can set these using ",(0,s.jsx)(n.code,{children:"#show: slides.with(..)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["PS: You can modify the outline title using ",(0,s.jsx)(n.code,{children:"#(s.outline-title = [Outline])"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["And the function of automatically adding ",(0,s.jsx)(n.code,{children:"new-section-slide"})," can be turned off by ",(0,s.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/09ddfb40-4f97-4062-8261-23f87690c33e",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>d,a:()=>o});var s=i(7294);const t={},l=s.createContext(t);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d287f9e6.06a655ad.js b/assets/js/d287f9e6.1b25ce7b.js similarity index 97% rename from assets/js/d287f9e6.06a655ad.js rename to assets/js/d287f9e6.1b25ce7b.js index 96cc398d6..45738e0c3 100644 --- a/assets/js/d287f9e6.06a655ad.js +++ b/assets/js/d287f9e6.1b25ce7b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[612],{1344:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var i=n(5893),o=n(1151);const s={sidebar_position:5},r="Codly",l={id:"integration/codly",title:"Codly",description:"When using Codly, we should initialize it using the s.methods.append-preamble method.",source:"@site/docs/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/docs/next/integration/ctheorems"}},d={},c=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,i.jsxs)(t.p,{children:["When using Codly, we should initialize it using the ",(0,i.jsx)(t.code,{children:"s.methods.append-preamble"})," method."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var i=n(7294);const o={},s=i.createContext(o);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[612],{1344:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var i=n(5893),o=n(1151);const s={sidebar_position:5},r="Codly",l={id:"integration/codly",title:"Codly",description:"When using Codly, we should initialize it using the s.methods.append-preamble method.",source:"@site/docs/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/docs/next/integration/ctheorems"}},d={},c=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,i.jsxs)(t.p,{children:["When using Codly, we should initialize it using the ",(0,i.jsx)(t.code,{children:"s.methods.append-preamble"})," method."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var i=n(7294);const o={},s=i.createContext(o);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f3a7b3b2.232f5b0b.js b/assets/js/f3a7b3b2.b1e52f6b.js similarity index 99% rename from assets/js/f3a7b3b2.232f5b0b.js rename to assets/js/f3a7b3b2.b1e52f6b.js index be5d285e8..ae14c5b5d 100644 --- a/assets/js/f3a7b3b2.232f5b0b.js +++ b/assets/js/f3a7b3b2.b1e52f6b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9916],{1075:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var s=n(5893),i=n(1151);const o={sidebar_position:6},l="Global Settings",a={id:"global-settings",title:"Global Settings",description:"Global Styles",source:"@site/docs/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Page Layout",permalink:"/touying/docs/next/layout"},next:{title:"Multi-File Architecture",permalink:"/touying/docs/next/multi-file"}},r={},d=[{value:"Global Styles",id:"global-styles",level:2},{value:"Global Information",id:"global-information",level:2},{value:"State Initialization",id:"state-initialization",level:2}];function c(e){const t={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"global-settings",children:"Global Settings"}),"\n",(0,s.jsx)(t.h2,{id:"global-styles",children:"Global Styles"}),"\n",(0,s.jsxs)(t.p,{children:["For Touying, global styles refer to set rules or show rules that need to be applied everywhere, such as ",(0,s.jsx)(t.code,{children:"#set text(size: 20pt)"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["Themes in Touying encapsulate some of their own global styles, which are placed in ",(0,s.jsx)(t.code,{children:"#show: init"}),". For example, the university theme encapsulates the following:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you are not a theme creator but want to add your own global styles to your slides, you can simply place them after ",(0,s.jsx)(t.code,{children:"#show: init"})," and before ",(0,s.jsx)(t.code,{children:"#show: slides"}),". For example, the metropolis theme recommends adding the following global styles:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(t.p,{children:["However, note that you should not use ",(0,s.jsx)(t.code,{children:"#set page(..)"}),". Instead, modify ",(0,s.jsx)(t.code,{children:"s.page-args"})," and ",(0,s.jsx)(t.code,{children:"s.padding"}),", for example:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,s.jsx)(t.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(t.p,{children:"Like Beamer, Touying, through an OOP-style unified API design, can help you better maintain global information, allowing you to easily switch between different themes. Global information is a typical example of this."}),"\n",(0,s.jsx)(t.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:["In subsequent slides, you can access them through ",(0,s.jsx)(t.code,{children:"s.info"})," or ",(0,s.jsx)(t.code,{children:"self.info"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"This information is generally used in the title-slide, header, and footer of the theme, for example:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"date"})," can accept ",(0,s.jsx)(t.code,{children:"datetime"})," format or ",(0,s.jsx)(t.code,{children:"content"})," format, and the display format for the ",(0,s.jsx)(t.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(t.admonition,{title:"Principle",type:"tip",children:[(0,s.jsx)(t.p,{children:"Here, we will introduce a bit of OOP concept in Touying."}),(0,s.jsxs)(t.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering, which means Typst caches the results of previous function calls. This requires that Typst consists of pure functions, meaning functions that do not change external variables. Thus, it is challenging to modify a global variable in the true sense, even with the use of ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"}),". This would require the use of ",(0,s.jsx)(t.code,{children:"locate"})," with callback functions to obtain the values inside, and this approach would have a significant impact on performance."]}),(0,s.jsxs)(t.p,{children:["Touying does not use ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"})," and does not violate the principle of pure functions in Typst. Instead, it uses a clever approach in an object-oriented style, maintaining a global singleton ",(0,s.jsx)(t.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We agree that methods all have a named parameter ",(0,s.jsx)(t.code,{children:"self"})," for passing the object itself, and methods are placed in the ",(0,s.jsx)(t.code,{children:".methods"})," domain. With this concept, it becomes easier to write methods to update ",(0,s.jsx)(t.code,{children:"info"}),":"]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (\n info: (:),\n methods: (\n // update info\n info: (self: none, ..args) => {\n self.info += args.named()\n self\n },\n )\n)\n\n#let s = (s.methods.info)(self: s, title: [title])\n\nTitle is #s.info.title\n"})}),(0,s.jsxs)(t.p,{children:["Now you can understand the purpose of the ",(0,s.jsx)(t.code,{children:"utils.methods()"})," function: to bind ",(0,s.jsx)(t.code,{children:"self"})," to all methods of ",(0,s.jsx)(t.code,{children:"s"})," and return it, simplifying the subsequent usage through unpacking syntax."]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(t.h2,{id:"state-initialization",children:"State Initialization"}),"\n",(0,s.jsxs)(t.p,{children:["In general, the two ways mentioned above are sufficient for adding global settings. However, there are still situations where we need to initialize counters or states. If you place this code before ",(0,s.jsx)(t.code,{children:"#show: slides"}),", a blank page will be created, which is something we don't want to see. In such cases, you can use the ",(0,s.jsx)(t.code,{children:"s.methods.append-preamble"})," method. For example, when using the codly package:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,s.jsx)(t.p,{children:"Or when configuring Pdfpc:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>l});var s=n(7294);const i={},o=s.createContext(i);function l(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9916],{1075:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var s=n(5893),i=n(1151);const o={sidebar_position:6},l="Global Settings",a={id:"global-settings",title:"Global Settings",description:"Global Styles",source:"@site/docs/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Page Layout",permalink:"/touying/docs/next/layout"},next:{title:"Multi-File Architecture",permalink:"/touying/docs/next/multi-file"}},r={},d=[{value:"Global Styles",id:"global-styles",level:2},{value:"Global Information",id:"global-information",level:2},{value:"State Initialization",id:"state-initialization",level:2}];function c(e){const t={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"global-settings",children:"Global Settings"}),"\n",(0,s.jsx)(t.h2,{id:"global-styles",children:"Global Styles"}),"\n",(0,s.jsxs)(t.p,{children:["For Touying, global styles refer to set rules or show rules that need to be applied everywhere, such as ",(0,s.jsx)(t.code,{children:"#set text(size: 20pt)"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["Themes in Touying encapsulate some of their own global styles, which are placed in ",(0,s.jsx)(t.code,{children:"#show: init"}),". For example, the university theme encapsulates the following:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you are not a theme creator but want to add your own global styles to your slides, you can simply place them after ",(0,s.jsx)(t.code,{children:"#show: init"})," and before ",(0,s.jsx)(t.code,{children:"#show: slides"}),". For example, the metropolis theme recommends adding the following global styles:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,s.jsxs)(t.p,{children:["However, note that you should not use ",(0,s.jsx)(t.code,{children:"#set page(..)"}),". Instead, modify ",(0,s.jsx)(t.code,{children:"s.page-args"})," and ",(0,s.jsx)(t.code,{children:"s.padding"}),", for example:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,s.jsx)(t.h2,{id:"global-information",children:"Global Information"}),"\n",(0,s.jsx)(t.p,{children:"Like Beamer, Touying, through an OOP-style unified API design, can help you better maintain global information, allowing you to easily switch between different themes. Global information is a typical example of this."}),"\n",(0,s.jsx)(t.p,{children:"You can set the title, subtitle, author, date, and institution information for slides using:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:["In subsequent slides, you can access them through ",(0,s.jsx)(t.code,{children:"s.info"})," or ",(0,s.jsx)(t.code,{children:"self.info"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"This information is generally used in the title-slide, header, and footer of the theme, for example:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"date"})," can accept ",(0,s.jsx)(t.code,{children:"datetime"})," format or ",(0,s.jsx)(t.code,{children:"content"})," format, and the display format for the ",(0,s.jsx)(t.code,{children:"datetime"})," format can be changed using:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,s.jsxs)(t.admonition,{title:"Principle",type:"tip",children:[(0,s.jsx)(t.p,{children:"Here, we will introduce a bit of OOP concept in Touying."}),(0,s.jsxs)(t.p,{children:["You should know that Typst is a typesetting language that supports incremental rendering, which means Typst caches the results of previous function calls. This requires that Typst consists of pure functions, meaning functions that do not change external variables. Thus, it is challenging to modify a global variable in the true sense, even with the use of ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"}),". This would require the use of ",(0,s.jsx)(t.code,{children:"locate"})," with callback functions to obtain the values inside, and this approach would have a significant impact on performance."]}),(0,s.jsxs)(t.p,{children:["Touying does not use ",(0,s.jsx)(t.code,{children:"state"})," or ",(0,s.jsx)(t.code,{children:"counter"})," and does not violate the principle of pure functions in Typst. Instead, it uses a clever approach in an object-oriented style, maintaining a global singleton ",(0,s.jsx)(t.code,{children:"s"}),". In Touying, an object refers to a Typst dictionary with its own member variables and methods. We agree that methods all have a named parameter ",(0,s.jsx)(t.code,{children:"self"})," for passing the object itself, and methods are placed in the ",(0,s.jsx)(t.code,{children:".methods"})," domain. With this concept, it becomes easier to write methods to update ",(0,s.jsx)(t.code,{children:"info"}),":"]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let s = (\n info: (:),\n methods: (\n // update info\n info: (self: none, ..args) => {\n self.info += args.named()\n self\n },\n )\n)\n\n#let s = (s.methods.info)(self: s, title: [title])\n\nTitle is #s.info.title\n"})}),(0,s.jsxs)(t.p,{children:["Now you can understand the purpose of the ",(0,s.jsx)(t.code,{children:"utils.methods()"})," function: to bind ",(0,s.jsx)(t.code,{children:"self"})," to all methods of ",(0,s.jsx)(t.code,{children:"s"})," and return it, simplifying the subsequent usage through unpacking syntax."]}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,s.jsx)(t.h2,{id:"state-initialization",children:"State Initialization"}),"\n",(0,s.jsxs)(t.p,{children:["In general, the two ways mentioned above are sufficient for adding global settings. However, there are still situations where we need to initialize counters or states. If you place this code before ",(0,s.jsx)(t.code,{children:"#show: slides"}),", a blank page will be created, which is something we don't want to see. In such cases, you can use the ",(0,s.jsx)(t.code,{children:"s.methods.append-preamble"})," method. For example, when using the codly package:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,s.jsx)(t.p,{children:"Or when configuring Pdfpc:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>l});var s=n(7294);const i={},o=s.createContext(i);function l(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.939ad99e.js b/assets/js/runtime~main.9eada2e8.js similarity index 74% rename from assets/js/runtime~main.939ad99e.js rename to assets/js/runtime~main.9eada2e8.js index 1bf2083f2..1718b3c44 100644 --- a/assets/js/runtime~main.939ad99e.js +++ b/assets/js/runtime~main.9eada2e8.js @@ -1 +1 @@ -(()=>{"use strict";var e,c,f,a,b,d={},t={};function r(e){var c=t[e];if(void 0!==c)return c.exports;var f=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(f.exports,f,f.exports,r),f.loaded=!0,f.exports}r.m=d,r.c=t,e=[],r.O=(c,f,a,b)=>{if(!f){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[f,a,b]},r.n=e=>{var c=e&&e.__esModule?()=>e.default:()=>e;return r.d(c,{a:c}),c},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};c=c||[null,f({}),f([]),f(f)];for(var t=2&a&&e;"object"==typeof t&&!~c.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((c=>d[c]=()=>e[c]));return d.default=()=>e,r.d(b,d),b},r.d=(e,c)=>{for(var f in c)r.o(c,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:c[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((c,f)=>(r.f[f](e,c),c)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",69:"018a1506",80:"2c0b54ac",196:"d9bab663",263:"5c062049",417:"080c9bd0",438:"5de4625c",498:"2cc1595c",513:"b6606f5f",530:"e5b11173",612:"d287f9e6",876:"b035a2d2",915:"648478e2",997:"5670b452",1039:"35b233e8",1049:"b472294c",1053:"c51e9508",1089:"04b649ca",1110:"5eea6960",1317:"9cec3c93",1400:"495c719e",1498:"e511abbf",1543:"98ce8162",1546:"92f7ac8d",1560:"0275f7e4",1581:"f8777534",1588:"f80396ac",1626:"a449492b",1827:"5806a9e1",1860:"67bae27a",1893:"340f1526",1949:"7c9c7243",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2216:"c7f97b4e",2289:"51a4d3bf",2322:"f24a23d8",2403:"d16cbc15",2418:"e9b496d5",2432:"116fbef0",2464:"b5dfb830",2528:"ae31ff46",2529:"3143bd0d",2535:"814f3328",2551:"c37d3efc",2701:"1aab1ab5",2707:"ada9f060",2751:"890ef1f8",2784:"f65f6456",2786:"267f059f",2792:"0d1c87af",2830:"86e5cb88",2847:"7927a478",2865:"82487ba9",2868:"ce57b2d1",2925:"d848b1c8",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3134:"86f810a5",3135:"7ba330a5",3209:"80a0c88e",3263:"91bd08ce",3280:"4bb9edb3",3376:"6c8708e3",3389:"4c713790",3432:"de4f60ff",3608:"9e4087bc",3651:"1514c4f3",3655:"b1a1bf59",3684:"797defb6",3715:"583d85fc",3808:"ce30cdaf",3832:"e6bd25e0",3942:"14c08683",3969:"5b27bc59",3994:"41abee02",4013:"01a85c17",4042:"65e4303d",4067:"4e3d17c1",4195:"c4f5d8e4",4288:"a732a165",4368:"a94703ab",4447:"28a86b5d",4450:"c60ded92",4481:"7d3539b2",4599:"a94a4682",4618:"8e2c1ca5",4621:"0479d12b",4725:"06e0043a",4733:"173c8b24",4770:"bf750d2c",4823:"17588091",4842:"0c7d33f3",4873:"83b73936",4984:"b8fd1f7e",5022:"3b36ca8e",5030:"7f50710c",5094:"a3b8b6db",5096:"bef23ce3",5106:"6c1ba8b1",5151:"43e6fa63",5313:"4919068e",5332:"8ded3f77",5428:"11366869",5431:"7329c3b8",5526:"2553c37c",5598:"65e4cc1e",5609:"5035b6a4",5617:"54ea3d6a",5619:"ecfd88b4",5635:"1cf5eacf",5651:"359eb289",5675:"bce42248",5695:"6d7ce909",5701:"5539901a",5739:"717af290",5832:"926843be",5854:"5057383c",5870:"4b91b61e",5921:"1b6fd54f",5954:"ff235272",6085:"3d438ec7",6099:"58092a00",6103:"ccc49370",6114:"89f39702",6118:"c9566e8a",6142:"f2bffab0",6154:"c38df086",6175:"58132609",6193:"864ebe97",6232:"f554ac40",6259:"55b57bd3",6296:"286c2c64",6403:"ad972684",6518:"3fefcd96",6526:"41a6ae87",6567:"b2b68e5a",6662:"555ecac1",6679:"a7cd7c6a",6685:"65dfabbc",6721:"38803c52",6864:"cbce90b2",6893:"d85491b0",6902:"024af9ce",6917:"7f65dfb7",7060:"9f9db465",7190:"ab32da60",7224:"d4a2dc55",7335:"850166d8",7414:"393be207",7503:"05ed0e1f",7504:"5297811e",7545:"2b9fd23c",7668:"acfad3c9",7701:"df5b4e08",7836:"02f62403",7918:"17896441",8010:"99d50e1d",8084:"34ff0b4c",8088:"293f9c83",8110:"56a68450",8210:"29e7adb3",8240:"832b8a10",8300:"e5a884f4",8332:"6607fcb6",8338:"f5938888",8341:"730fef4c",8350:"3f2877b5",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",8694:"30e9e8ba",8814:"11b282fc",8881:"05206b71",8990:"e7541c45",9027:"2b13119a",9090:"4fabf2f1",9095:"ebca17e9",9139:"09ecdeab",9159:"fbe708ec",9183:"2d4a7f47",9199:"f7c1e588",9254:"78c3c618",9259:"a62a85e6",9319:"851c2574",9375:"729d3e1e",9410:"c9c87310",9413:"38682d35",9527:"8ac96054",9543:"f8016cde",9619:"39430005",9661:"5e95c892",9664:"974d09da",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9754:"f3d96861",9817:"14eb3368",9861:"9ea180da",9895:"b7a138aa",9916:"f3a7b3b2",9966:"1748a406",9974:"dc65f2fa"}[e]||e)+"."+{53:"974ba5c9",69:"cd008c45",80:"9605d2b9",196:"1adc00f3",263:"77a22a74",417:"d61411b0",438:"96485ad6",498:"6faa31d3",513:"b7dc4067",530:"590aaa77",612:"06a655ad",876:"1630c731",915:"a22abade",997:"b5eb8c1f",1039:"4059474a",1049:"c1ea99eb",1053:"86c8f721",1089:"3c59d421",1110:"9621cd55",1317:"4c4de52b",1400:"67e1e8f6",1404:"2f578d87",1498:"46354ae6",1543:"0db38a50",1546:"63fc790e",1560:"5c626199",1581:"85fe0a10",1588:"716838d7",1626:"441d5055",1772:"22d645a1",1827:"32f85c6a",1860:"9979e720",1893:"61190a65",1949:"0e5d0aca",2026:"bc35b904",2143:"6764a52d",2172:"92669f93",2191:"c89c1ad8",2216:"f091b0b4",2289:"67d62bc7",2322:"d4c741a2",2403:"e70ad829",2418:"6d0332a4",2432:"6f2750fe",2464:"373601f7",2528:"bc878fd2",2529:"e8d26008",2535:"a329f4f2",2551:"a5207080",2701:"bd9e5db3",2707:"b8b2376c",2751:"9134d19a",2784:"44b0e2f8",2786:"1727bc64",2792:"abe48754",2830:"09fb73d7",2847:"23dc45be",2865:"4f5b83c0",2868:"f674fd38",2925:"297b2448",3034:"499cb318",3085:"fa8680eb",3089:"d410008f",3134:"2c6e3cc2",3135:"cc3b1fc9",3209:"a9a1492a",3263:"52660cd0",3280:"061043fc",3376:"f67c89a2",3389:"f6b6bc02",3432:"3d887583",3608:"8eec8b12",3651:"ac393a14",3655:"fb33b4f8",3684:"2b44684f",3715:"cad2678b",3808:"19309d4f",3832:"a617cf03",3942:"357fda3f",3969:"e72bec1a",3994:"4e7738e6",4013:"354f3ef2",4042:"b27dd161",4067:"8a1553e1",4195:"b82e09e8",4288:"afd23ce7",4368:"9ecc2e7c",4447:"1a361711",4450:"36ded4b4",4481:"b4866903",4599:"f4cd98e8",4618:"bc736dd3",4621:"5e069252",4725:"c7037dab",4733:"e93baa7c",4770:"0f5ea528",4823:"5d773431",4842:"26f21937",4873:"9d7a20ea",4984:"89a9f66b",5022:"c1ec8f85",5030:"a1e836e0",5094:"7e9bd8d8",5096:"12118f94",5106:"75507717",5151:"84cd75ac",5313:"037cee1f",5332:"39e635f8",5428:"f9a0557f",5431:"1006c799",5526:"3a7d06b9",5598:"e076f0aa",5609:"ba29a9c9",5617:"e9dc7a26",5619:"b6991f82",5635:"8d579786",5651:"cc6906df",5675:"672575c5",5695:"da8b2a78",5701:"5cb2744c",5739:"20cf0c37",5832:"e8be20d9",5854:"7a48ca40",5870:"3efbbdec",5921:"c6d6fca9",5954:"e2efa1de",6085:"59bf4311",6099:"4ccccd15",6103:"d9da7455",6114:"36c015ce",6118:"8502a18b",6142:"64bff290",6154:"3a34d537",6175:"f1ab7e4f",6193:"3dcc4b8f",6232:"a965c67c",6259:"afd6b9b2",6296:"608f3c26",6403:"e9454893",6518:"2d31b890",6526:"2629620e",6567:"a600d6fd",6662:"3f3e5636",6679:"b0847aa4",6685:"f8050b8c",6721:"01f754dc",6864:"1cde18b5",6893:"4e72fbe6",6902:"6af7179d",6917:"e0a5ac39",7060:"9e91e83f",7190:"1d07324a",7224:"86b0fccd",7335:"67d41d40",7414:"dbd0b852",7503:"41adfa01",7504:"dad1c705",7545:"45028282",7668:"e9bccc4f",7701:"4507b7bc",7836:"7661051c",7918:"15723699",8010:"2c7e4ba0",8084:"8f9d425a",8088:"e2d4c498",8110:"d14aa706",8210:"64d8e266",8240:"1e3413da",8300:"12442be0",8332:"18359e4f",8338:"8dd127cf",8341:"fcb26556",8350:"be6b644a",8518:"f93b23a7",8565:"c4719110",8610:"686aaf2c",8694:"379cce5b",8814:"01cc229d",8881:"8ec9cc5e",8990:"852c5e45",9027:"18934b93",9090:"6af19ea5",9095:"06c4879f",9139:"82cea7bf",9159:"a8ab2a92",9183:"359d3d24",9199:"38a8f426",9254:"b5e5000a",9259:"55365f9f",9319:"ff9078b6",9375:"35326f17",9410:"c174fd44",9413:"e5782ec2",9527:"67767120",9543:"206179fa",9619:"39096450",9661:"17c48d1d",9664:"d7fb4bd8",9671:"8ef80ab1",9677:"ea822b9e",9705:"1b99490f",9744:"00ff6043",9754:"df8d17f9",9817:"21d38987",9861:"5dedb635",9895:"b665d587",9916:"232f5b0b",9966:"7c49803d",9974:"2f72d63c"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,c)=>Object.prototype.hasOwnProperty.call(e,c),a={},b="docs:",r.l=(e,c,f,d)=>{if(a[e])a[e].push(c);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(f))),c)return c(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/",r.gca=function(e){return e={11366869:"5428",17588091:"4823",17896441:"7918",39430005:"9619",58132609:"6175","935f2afb":"53","018a1506":"69","2c0b54ac":"80",d9bab663:"196","5c062049":"263","080c9bd0":"417","5de4625c":"438","2cc1595c":"498",b6606f5f:"513",e5b11173:"530",d287f9e6:"612",b035a2d2:"876","648478e2":"915","5670b452":"997","35b233e8":"1039",b472294c:"1049",c51e9508:"1053","04b649ca":"1089","5eea6960":"1110","9cec3c93":"1317","495c719e":"1400",e511abbf:"1498","98ce8162":"1543","92f7ac8d":"1546","0275f7e4":"1560",f8777534:"1581",f80396ac:"1588",a449492b:"1626","5806a9e1":"1827","67bae27a":"1860","340f1526":"1893","7c9c7243":"1949","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191",c7f97b4e:"2216","51a4d3bf":"2289",f24a23d8:"2322",d16cbc15:"2403",e9b496d5:"2418","116fbef0":"2432",b5dfb830:"2464",ae31ff46:"2528","3143bd0d":"2529","814f3328":"2535",c37d3efc:"2551","1aab1ab5":"2701",ada9f060:"2707","890ef1f8":"2751",f65f6456:"2784","267f059f":"2786","0d1c87af":"2792","86e5cb88":"2830","7927a478":"2847","82487ba9":"2865",ce57b2d1:"2868",d848b1c8:"2925","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","86f810a5":"3134","7ba330a5":"3135","80a0c88e":"3209","91bd08ce":"3263","4bb9edb3":"3280","6c8708e3":"3376","4c713790":"3389",de4f60ff:"3432","9e4087bc":"3608","1514c4f3":"3651",b1a1bf59:"3655","797defb6":"3684","583d85fc":"3715",ce30cdaf:"3808",e6bd25e0:"3832","14c08683":"3942","5b27bc59":"3969","41abee02":"3994","01a85c17":"4013","65e4303d":"4042","4e3d17c1":"4067",c4f5d8e4:"4195",a732a165:"4288",a94703ab:"4368","28a86b5d":"4447",c60ded92:"4450","7d3539b2":"4481",a94a4682:"4599","8e2c1ca5":"4618","0479d12b":"4621","06e0043a":"4725","173c8b24":"4733",bf750d2c:"4770","0c7d33f3":"4842","83b73936":"4873",b8fd1f7e:"4984","3b36ca8e":"5022","7f50710c":"5030",a3b8b6db:"5094",bef23ce3:"5096","6c1ba8b1":"5106","43e6fa63":"5151","4919068e":"5313","8ded3f77":"5332","7329c3b8":"5431","2553c37c":"5526","65e4cc1e":"5598","5035b6a4":"5609","54ea3d6a":"5617",ecfd88b4:"5619","1cf5eacf":"5635","359eb289":"5651",bce42248:"5675","6d7ce909":"5695","5539901a":"5701","717af290":"5739","926843be":"5832","5057383c":"5854","4b91b61e":"5870","1b6fd54f":"5921",ff235272:"5954","3d438ec7":"6085","58092a00":"6099",ccc49370:"6103","89f39702":"6114",c9566e8a:"6118",f2bffab0:"6142",c38df086:"6154","864ebe97":"6193",f554ac40:"6232","55b57bd3":"6259","286c2c64":"6296",ad972684:"6403","3fefcd96":"6518","41a6ae87":"6526",b2b68e5a:"6567","555ecac1":"6662",a7cd7c6a:"6679","65dfabbc":"6685","38803c52":"6721",cbce90b2:"6864",d85491b0:"6893","024af9ce":"6902","7f65dfb7":"6917","9f9db465":"7060",ab32da60:"7190",d4a2dc55:"7224","850166d8":"7335","393be207":"7414","05ed0e1f":"7503","5297811e":"7504","2b9fd23c":"7545",acfad3c9:"7668",df5b4e08:"7701","02f62403":"7836","99d50e1d":"8010","34ff0b4c":"8084","293f9c83":"8088","56a68450":"8110","29e7adb3":"8210","832b8a10":"8240",e5a884f4:"8300","6607fcb6":"8332",f5938888:"8338","730fef4c":"8341","3f2877b5":"8350",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","30e9e8ba":"8694","11b282fc":"8814","05206b71":"8881",e7541c45:"8990","2b13119a":"9027","4fabf2f1":"9090",ebca17e9:"9095","09ecdeab":"9139",fbe708ec:"9159","2d4a7f47":"9183",f7c1e588:"9199","78c3c618":"9254",a62a85e6:"9259","851c2574":"9319","729d3e1e":"9375",c9c87310:"9410","38682d35":"9413","8ac96054":"9527",f8016cde:"9543","5e95c892":"9661","974d09da":"9664","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744",f3d96861:"9754","14eb3368":"9817","9ea180da":"9861",b7a138aa:"9895",f3a7b3b2:"9916","1748a406":"9966",dc65f2fa:"9974"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(c,f)=>{var a=r.o(e,c)?e[c]:void 0;if(0!==a)if(a)f.push(a[2]);else if(/^(1303|532)$/.test(c))e[c]=0;else{var b=new Promise(((f,b)=>a=e[c]=[f,b]));f.push(a[2]=b);var d=r.p+r.u(c),t=new Error;r.l(d,(f=>{if(r.o(e,c)&&(0!==(a=e[c])&&(e[c]=void 0),a)){var b=f&&("load"===f.type?"missing":f.type),d=f&&f.target&&f.target.src;t.message="Loading chunk "+c+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,a[1](t)}}),"chunk-"+c,c)}},r.O.j=c=>0===e[c];var c=(c,f)=>{var a,b,d=f[0],t=f[1],o=f[2],n=0;if(d.some((c=>0!==e[c]))){for(a in t)r.o(t,a)&&(r.m[a]=t[a]);if(o)var i=o(r)}for(c&&c(f);n{"use strict";var e,c,a,f,b,d={},t={};function r(e){var c=t[e];if(void 0!==c)return c.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=d,r.c=t,e=[],r.O=(c,a,f,b)=>{if(!a){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](a[o])))?a.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[a,f,b]},r.n=e=>{var c=e&&e.__esModule?()=>e.default:()=>e;return r.d(c,{a:c}),c},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};c=c||[null,a({}),a([]),a(a)];for(var t=2&f&&e;"object"==typeof t&&!~c.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach((c=>d[c]=()=>e[c]));return d.default=()=>e,r.d(b,d),b},r.d=(e,c)=>{for(var a in c)r.o(c,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:c[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((c,a)=>(r.f[a](e,c),c)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",69:"018a1506",80:"2c0b54ac",196:"d9bab663",263:"5c062049",417:"080c9bd0",438:"5de4625c",498:"2cc1595c",513:"b6606f5f",530:"e5b11173",612:"d287f9e6",876:"b035a2d2",915:"648478e2",997:"5670b452",1039:"35b233e8",1049:"b472294c",1053:"c51e9508",1089:"04b649ca",1110:"5eea6960",1317:"9cec3c93",1400:"495c719e",1498:"e511abbf",1543:"98ce8162",1546:"92f7ac8d",1560:"0275f7e4",1581:"f8777534",1588:"f80396ac",1626:"a449492b",1827:"5806a9e1",1860:"67bae27a",1893:"340f1526",1949:"7c9c7243",2026:"9d0f4357",2143:"5a57e638",2172:"6bd5e75c",2191:"77e3d78c",2216:"c7f97b4e",2289:"51a4d3bf",2322:"f24a23d8",2403:"d16cbc15",2418:"e9b496d5",2432:"116fbef0",2464:"b5dfb830",2528:"ae31ff46",2529:"3143bd0d",2535:"814f3328",2551:"c37d3efc",2701:"1aab1ab5",2707:"ada9f060",2751:"890ef1f8",2784:"f65f6456",2786:"267f059f",2792:"0d1c87af",2830:"86e5cb88",2847:"7927a478",2865:"82487ba9",2868:"ce57b2d1",2925:"d848b1c8",3034:"9beb87c2",3085:"1f391b9e",3089:"a6aa9e1f",3134:"86f810a5",3135:"7ba330a5",3209:"80a0c88e",3263:"91bd08ce",3280:"4bb9edb3",3376:"6c8708e3",3389:"4c713790",3432:"de4f60ff",3608:"9e4087bc",3651:"1514c4f3",3655:"b1a1bf59",3684:"797defb6",3715:"583d85fc",3808:"ce30cdaf",3832:"e6bd25e0",3942:"14c08683",3969:"5b27bc59",3994:"41abee02",4013:"01a85c17",4042:"65e4303d",4067:"4e3d17c1",4195:"c4f5d8e4",4288:"a732a165",4368:"a94703ab",4447:"28a86b5d",4450:"c60ded92",4481:"7d3539b2",4599:"a94a4682",4618:"8e2c1ca5",4621:"0479d12b",4725:"06e0043a",4733:"173c8b24",4770:"bf750d2c",4823:"17588091",4842:"0c7d33f3",4873:"83b73936",4984:"b8fd1f7e",5022:"3b36ca8e",5030:"7f50710c",5094:"a3b8b6db",5096:"bef23ce3",5106:"6c1ba8b1",5151:"43e6fa63",5313:"4919068e",5332:"8ded3f77",5428:"11366869",5431:"7329c3b8",5526:"2553c37c",5598:"65e4cc1e",5609:"5035b6a4",5617:"54ea3d6a",5619:"ecfd88b4",5635:"1cf5eacf",5651:"359eb289",5675:"bce42248",5695:"6d7ce909",5701:"5539901a",5739:"717af290",5832:"926843be",5854:"5057383c",5870:"4b91b61e",5921:"1b6fd54f",5954:"ff235272",6085:"3d438ec7",6099:"58092a00",6103:"ccc49370",6114:"89f39702",6118:"c9566e8a",6142:"f2bffab0",6154:"c38df086",6175:"58132609",6193:"864ebe97",6232:"f554ac40",6259:"55b57bd3",6296:"286c2c64",6403:"ad972684",6518:"3fefcd96",6526:"41a6ae87",6567:"b2b68e5a",6662:"555ecac1",6679:"a7cd7c6a",6685:"65dfabbc",6721:"38803c52",6864:"cbce90b2",6893:"d85491b0",6902:"024af9ce",6917:"7f65dfb7",7060:"9f9db465",7190:"ab32da60",7224:"d4a2dc55",7335:"850166d8",7414:"393be207",7503:"05ed0e1f",7504:"5297811e",7545:"2b9fd23c",7668:"acfad3c9",7701:"df5b4e08",7836:"02f62403",7918:"17896441",8010:"99d50e1d",8084:"34ff0b4c",8088:"293f9c83",8110:"56a68450",8210:"29e7adb3",8240:"832b8a10",8300:"e5a884f4",8332:"6607fcb6",8338:"f5938888",8341:"730fef4c",8350:"3f2877b5",8518:"a7bd4aaa",8565:"472f8a66",8610:"6875c492",8694:"30e9e8ba",8814:"11b282fc",8881:"05206b71",8990:"e7541c45",9027:"2b13119a",9090:"4fabf2f1",9095:"ebca17e9",9139:"09ecdeab",9159:"fbe708ec",9183:"2d4a7f47",9199:"f7c1e588",9254:"78c3c618",9259:"a62a85e6",9319:"851c2574",9375:"729d3e1e",9410:"c9c87310",9413:"38682d35",9527:"8ac96054",9543:"f8016cde",9619:"39430005",9661:"5e95c892",9664:"974d09da",9671:"0e384e19",9705:"396cf6b9",9744:"10eff399",9754:"f3d96861",9817:"14eb3368",9861:"9ea180da",9895:"b7a138aa",9916:"f3a7b3b2",9966:"1748a406",9974:"dc65f2fa"}[e]||e)+"."+{53:"974ba5c9",69:"cd008c45",80:"9605d2b9",196:"1adc00f3",263:"77a22a74",417:"d61411b0",438:"96485ad6",498:"6faa31d3",513:"b7dc4067",530:"590aaa77",612:"1b25ce7b",876:"1630c731",915:"a22abade",997:"5f7a58b6",1039:"4059474a",1049:"c1ea99eb",1053:"86c8f721",1089:"3c59d421",1110:"9621cd55",1317:"4c4de52b",1400:"67e1e8f6",1404:"2f578d87",1498:"46354ae6",1543:"287e62b5",1546:"63fc790e",1560:"5c626199",1581:"85fe0a10",1588:"716838d7",1626:"441d5055",1772:"22d645a1",1827:"32f85c6a",1860:"9979e720",1893:"61190a65",1949:"0e5d0aca",2026:"bc35b904",2143:"e978d988",2172:"92669f93",2191:"c89c1ad8",2216:"f091b0b4",2289:"67d62bc7",2322:"d4c741a2",2403:"5450aa44",2418:"6d0332a4",2432:"6f2750fe",2464:"373601f7",2528:"bc878fd2",2529:"e8d26008",2535:"a329f4f2",2551:"a5207080",2701:"bd9e5db3",2707:"b8b2376c",2751:"9134d19a",2784:"44b0e2f8",2786:"1727bc64",2792:"1af163d0",2830:"09fb73d7",2847:"23dc45be",2865:"4f5b83c0",2868:"f674fd38",2925:"297b2448",3034:"499cb318",3085:"fa8680eb",3089:"d410008f",3134:"2c6e3cc2",3135:"cc3b1fc9",3209:"b733f954",3263:"52660cd0",3280:"061043fc",3376:"f67c89a2",3389:"f6b6bc02",3432:"3d887583",3608:"8eec8b12",3651:"ac393a14",3655:"fb33b4f8",3684:"2b44684f",3715:"cad2678b",3808:"19309d4f",3832:"a617cf03",3942:"357fda3f",3969:"e72bec1a",3994:"4e7738e6",4013:"354f3ef2",4042:"b27dd161",4067:"8a1553e1",4195:"b82e09e8",4288:"afd23ce7",4368:"9ecc2e7c",4447:"1a361711",4450:"36ded4b4",4481:"06b94f08",4599:"f4cd98e8",4618:"bc736dd3",4621:"5e069252",4725:"c7037dab",4733:"e93baa7c",4770:"0f5ea528",4823:"5d773431",4842:"26f21937",4873:"9d7a20ea",4984:"89a9f66b",5022:"c1ec8f85",5030:"a1e836e0",5094:"7e9bd8d8",5096:"12118f94",5106:"75507717",5151:"84cd75ac",5313:"037cee1f",5332:"39e635f8",5428:"f9a0557f",5431:"1006c799",5526:"3a7d06b9",5598:"e076f0aa",5609:"ba29a9c9",5617:"e9dc7a26",5619:"b6991f82",5635:"8d579786",5651:"cc6906df",5675:"672575c5",5695:"da8b2a78",5701:"5cb2744c",5739:"20cf0c37",5832:"e8be20d9",5854:"ecf8e775",5870:"3efbbdec",5921:"c6d6fca9",5954:"e2efa1de",6085:"59bf4311",6099:"4ccccd15",6103:"d9da7455",6114:"36c015ce",6118:"8502a18b",6142:"64bff290",6154:"21aead31",6175:"f1ab7e4f",6193:"3dcc4b8f",6232:"a965c67c",6259:"648f91c3",6296:"608f3c26",6403:"e9454893",6518:"2d31b890",6526:"2629620e",6567:"a600d6fd",6662:"3f3e5636",6679:"b0847aa4",6685:"f8050b8c",6721:"01f754dc",6864:"1cde18b5",6893:"4e72fbe6",6902:"6af7179d",6917:"26d35ace",7060:"9e91e83f",7190:"7b00de2b",7224:"86b0fccd",7335:"67d41d40",7414:"dbd0b852",7503:"41adfa01",7504:"dad1c705",7545:"45028282",7668:"e9bccc4f",7701:"4507b7bc",7836:"7661051c",7918:"15723699",8010:"2c7e4ba0",8084:"8f9d425a",8088:"3b48b842",8110:"d14aa706",8210:"64d8e266",8240:"1e3413da",8300:"12442be0",8332:"4d9db996",8338:"8dd127cf",8341:"fcb26556",8350:"4796c932",8518:"f93b23a7",8565:"6827c4cb",8610:"686aaf2c",8694:"379cce5b",8814:"01cc229d",8881:"8ec9cc5e",8990:"852c5e45",9027:"18934b93",9090:"6af19ea5",9095:"06c4879f",9139:"82cea7bf",9159:"a8ab2a92",9183:"359d3d24",9199:"38a8f426",9254:"b5e5000a",9259:"55365f9f",9319:"ff9078b6",9375:"35326f17",9410:"c174fd44",9413:"e5782ec2",9527:"96187a17",9543:"206179fa",9619:"282e5018",9661:"17c48d1d",9664:"d7fb4bd8",9671:"8ef80ab1",9677:"ea822b9e",9705:"1b99490f",9744:"00ff6043",9754:"df8d17f9",9817:"21d38987",9861:"5dedb635",9895:"b665d587",9916:"b1e52f6b",9966:"7c49803d",9974:"2f72d63c"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,c)=>Object.prototype.hasOwnProperty.call(e,c),f={},b="docs:",r.l=(e,c,a,d)=>{if(f[e])f[e].push(c);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(a))),c)return c(a)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/",r.gca=function(e){return e={11366869:"5428",17588091:"4823",17896441:"7918",39430005:"9619",58132609:"6175","935f2afb":"53","018a1506":"69","2c0b54ac":"80",d9bab663:"196","5c062049":"263","080c9bd0":"417","5de4625c":"438","2cc1595c":"498",b6606f5f:"513",e5b11173:"530",d287f9e6:"612",b035a2d2:"876","648478e2":"915","5670b452":"997","35b233e8":"1039",b472294c:"1049",c51e9508:"1053","04b649ca":"1089","5eea6960":"1110","9cec3c93":"1317","495c719e":"1400",e511abbf:"1498","98ce8162":"1543","92f7ac8d":"1546","0275f7e4":"1560",f8777534:"1581",f80396ac:"1588",a449492b:"1626","5806a9e1":"1827","67bae27a":"1860","340f1526":"1893","7c9c7243":"1949","9d0f4357":"2026","5a57e638":"2143","6bd5e75c":"2172","77e3d78c":"2191",c7f97b4e:"2216","51a4d3bf":"2289",f24a23d8:"2322",d16cbc15:"2403",e9b496d5:"2418","116fbef0":"2432",b5dfb830:"2464",ae31ff46:"2528","3143bd0d":"2529","814f3328":"2535",c37d3efc:"2551","1aab1ab5":"2701",ada9f060:"2707","890ef1f8":"2751",f65f6456:"2784","267f059f":"2786","0d1c87af":"2792","86e5cb88":"2830","7927a478":"2847","82487ba9":"2865",ce57b2d1:"2868",d848b1c8:"2925","9beb87c2":"3034","1f391b9e":"3085",a6aa9e1f:"3089","86f810a5":"3134","7ba330a5":"3135","80a0c88e":"3209","91bd08ce":"3263","4bb9edb3":"3280","6c8708e3":"3376","4c713790":"3389",de4f60ff:"3432","9e4087bc":"3608","1514c4f3":"3651",b1a1bf59:"3655","797defb6":"3684","583d85fc":"3715",ce30cdaf:"3808",e6bd25e0:"3832","14c08683":"3942","5b27bc59":"3969","41abee02":"3994","01a85c17":"4013","65e4303d":"4042","4e3d17c1":"4067",c4f5d8e4:"4195",a732a165:"4288",a94703ab:"4368","28a86b5d":"4447",c60ded92:"4450","7d3539b2":"4481",a94a4682:"4599","8e2c1ca5":"4618","0479d12b":"4621","06e0043a":"4725","173c8b24":"4733",bf750d2c:"4770","0c7d33f3":"4842","83b73936":"4873",b8fd1f7e:"4984","3b36ca8e":"5022","7f50710c":"5030",a3b8b6db:"5094",bef23ce3:"5096","6c1ba8b1":"5106","43e6fa63":"5151","4919068e":"5313","8ded3f77":"5332","7329c3b8":"5431","2553c37c":"5526","65e4cc1e":"5598","5035b6a4":"5609","54ea3d6a":"5617",ecfd88b4:"5619","1cf5eacf":"5635","359eb289":"5651",bce42248:"5675","6d7ce909":"5695","5539901a":"5701","717af290":"5739","926843be":"5832","5057383c":"5854","4b91b61e":"5870","1b6fd54f":"5921",ff235272:"5954","3d438ec7":"6085","58092a00":"6099",ccc49370:"6103","89f39702":"6114",c9566e8a:"6118",f2bffab0:"6142",c38df086:"6154","864ebe97":"6193",f554ac40:"6232","55b57bd3":"6259","286c2c64":"6296",ad972684:"6403","3fefcd96":"6518","41a6ae87":"6526",b2b68e5a:"6567","555ecac1":"6662",a7cd7c6a:"6679","65dfabbc":"6685","38803c52":"6721",cbce90b2:"6864",d85491b0:"6893","024af9ce":"6902","7f65dfb7":"6917","9f9db465":"7060",ab32da60:"7190",d4a2dc55:"7224","850166d8":"7335","393be207":"7414","05ed0e1f":"7503","5297811e":"7504","2b9fd23c":"7545",acfad3c9:"7668",df5b4e08:"7701","02f62403":"7836","99d50e1d":"8010","34ff0b4c":"8084","293f9c83":"8088","56a68450":"8110","29e7adb3":"8210","832b8a10":"8240",e5a884f4:"8300","6607fcb6":"8332",f5938888:"8338","730fef4c":"8341","3f2877b5":"8350",a7bd4aaa:"8518","472f8a66":"8565","6875c492":"8610","30e9e8ba":"8694","11b282fc":"8814","05206b71":"8881",e7541c45:"8990","2b13119a":"9027","4fabf2f1":"9090",ebca17e9:"9095","09ecdeab":"9139",fbe708ec:"9159","2d4a7f47":"9183",f7c1e588:"9199","78c3c618":"9254",a62a85e6:"9259","851c2574":"9319","729d3e1e":"9375",c9c87310:"9410","38682d35":"9413","8ac96054":"9527",f8016cde:"9543","5e95c892":"9661","974d09da":"9664","0e384e19":"9671","396cf6b9":"9705","10eff399":"9744",f3d96861:"9754","14eb3368":"9817","9ea180da":"9861",b7a138aa:"9895",f3a7b3b2:"9916","1748a406":"9966",dc65f2fa:"9974"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(c,a)=>{var f=r.o(e,c)?e[c]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(1303|532)$/.test(c))e[c]=0;else{var b=new Promise(((a,b)=>f=e[c]=[a,b]));a.push(f[2]=b);var d=r.p+r.u(c),t=new Error;r.l(d,(a=>{if(r.o(e,c)&&(0!==(f=e[c])&&(e[c]=void 0),f)){var b=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;t.message="Loading chunk "+c+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,f[1](t)}}),"chunk-"+c,c)}},r.O.j=c=>0===e[c];var c=(c,a)=>{var f,b,d=a[0],t=a[1],o=a[2],n=0;if(d.some((c=>0!==e[c]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(c&&c(a);n Archive | Touying - + diff --git a/blog/index.html b/blog/index.html index 15ad9b563..d8aac51f8 100644 --- a/blog/index.html +++ b/blog/index.html @@ -5,7 +5,7 @@ Blog | Touying - + diff --git a/blog/tags/development/index.html b/blog/tags/development/index.html index 5bd912d65..953670455 100644 --- a/blog/tags/development/index.html +++ b/blog/tags/development/index.html @@ -5,7 +5,7 @@ One post tagged with "development" | Touying - + diff --git a/blog/tags/index.html b/blog/tags/index.html index 09da6cddf..8eaf9d017 100644 --- a/blog/tags/index.html +++ b/blog/tags/index.html @@ -5,7 +5,7 @@ Tags | Touying - + diff --git a/blog/touying-0-2-0/index.html b/blog/touying-0-2-0/index.html index 9041df84b..6fe7ce7db 100644 --- a/blog/touying-0-2-0/index.html +++ b/blog/touying-0-2-0/index.html @@ -5,7 +5,7 @@ Touying 0.2.0 | Touying - + diff --git a/docs/0.2.x/build-your-own-theme/index.html b/docs/0.2.x/build-your-own-theme/index.html index 871e2d010..e79ae87b5 100644 --- a/docs/0.2.x/build-your-own-theme/index.html +++ b/docs/0.2.x/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Build Your Own Theme | Touying - + diff --git a/docs/0.2.x/category/dynamic-slides/index.html b/docs/0.2.x/category/dynamic-slides/index.html index fc0e4f4dd..ec7eedd17 100644 --- a/docs/0.2.x/category/dynamic-slides/index.html +++ b/docs/0.2.x/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/docs/0.2.x/category/external-tools/index.html b/docs/0.2.x/category/external-tools/index.html index 9b94959b0..87a6cf565 100644 --- a/docs/0.2.x/category/external-tools/index.html +++ b/docs/0.2.x/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/docs/0.2.x/category/progress/index.html b/docs/0.2.x/category/progress/index.html index e3762f335..49223d3ac 100644 --- a/docs/0.2.x/category/progress/index.html +++ b/docs/0.2.x/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/docs/0.2.x/category/themes/index.html b/docs/0.2.x/category/themes/index.html index 3f58bfcb3..f2a5491fc 100644 --- a/docs/0.2.x/category/themes/index.html +++ b/docs/0.2.x/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/docs/0.2.x/category/utilities/index.html b/docs/0.2.x/category/utilities/index.html index c232d3434..2af5c88e0 100644 --- a/docs/0.2.x/category/utilities/index.html +++ b/docs/0.2.x/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/docs/0.2.x/changelog/index.html b/docs/0.2.x/changelog/index.html index 6c4fdad73..b02a03620 100644 --- a/docs/0.2.x/changelog/index.html +++ b/docs/0.2.x/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/0.2.x/dynamic/complex/index.html b/docs/0.2.x/dynamic/complex/index.html index cb46164bb..da49da03e 100644 --- a/docs/0.2.x/dynamic/complex/index.html +++ b/docs/0.2.x/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + diff --git a/docs/0.2.x/dynamic/cover/index.html b/docs/0.2.x/dynamic/cover/index.html index cef26d371..af6cde215 100644 --- a/docs/0.2.x/dynamic/cover/index.html +++ b/docs/0.2.x/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover Function | Touying - + diff --git a/docs/0.2.x/dynamic/equation/index.html b/docs/0.2.x/dynamic/equation/index.html index 47c883ccf..d69de615c 100644 --- a/docs/0.2.x/dynamic/equation/index.html +++ b/docs/0.2.x/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + diff --git a/docs/0.2.x/dynamic/handout/index.html b/docs/0.2.x/dynamic/handout/index.html index 956c955ad..9740f841b 100644 --- a/docs/0.2.x/dynamic/handout/index.html +++ b/docs/0.2.x/dynamic/handout/index.html @@ -5,7 +5,7 @@ Handout Mode | Touying - + diff --git a/docs/0.2.x/dynamic/other/index.html b/docs/0.2.x/dynamic/other/index.html index 9bdc2ab07..23bc298d7 100644 --- a/docs/0.2.x/dynamic/other/index.html +++ b/docs/0.2.x/dynamic/other/index.html @@ -5,7 +5,7 @@ Other Animations | Touying - + diff --git a/docs/0.2.x/dynamic/simple/index.html b/docs/0.2.x/dynamic/simple/index.html index 49c7f4ac7..9cf361ba7 100644 --- a/docs/0.2.x/dynamic/simple/index.html +++ b/docs/0.2.x/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + diff --git a/docs/0.2.x/external/pdfpc/index.html b/docs/0.2.x/external/pdfpc/index.html index ef85f44c8..e6b697a39 100644 --- a/docs/0.2.x/external/pdfpc/index.html +++ b/docs/0.2.x/external/pdfpc/index.html @@ -5,7 +5,7 @@ Pdfpc | Touying - + diff --git a/docs/0.2.x/external/typst-preview/index.html b/docs/0.2.x/external/typst-preview/index.html index 5c835d2bf..9120e0286 100644 --- a/docs/0.2.x/external/typst-preview/index.html +++ b/docs/0.2.x/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/docs/0.2.x/intro/index.html b/docs/0.2.x/intro/index.html index 44c178214..c2a737ccf 100644 --- a/docs/0.2.x/intro/index.html +++ b/docs/0.2.x/intro/index.html @@ -5,7 +5,7 @@ Introduction to Touying | Touying - + diff --git a/docs/0.2.x/layout/index.html b/docs/0.2.x/layout/index.html index 01019555e..5ef0a672f 100644 --- a/docs/0.2.x/layout/index.html +++ b/docs/0.2.x/layout/index.html @@ -5,7 +5,7 @@ Layout Your Contents | Touying - + diff --git a/docs/0.2.x/progress/counters/index.html b/docs/0.2.x/progress/counters/index.html index 4ea8c7e47..95c300421 100644 --- a/docs/0.2.x/progress/counters/index.html +++ b/docs/0.2.x/progress/counters/index.html @@ -5,7 +5,7 @@ Touying Counters | Touying - + diff --git a/docs/0.2.x/progress/sections/index.html b/docs/0.2.x/progress/sections/index.html index 580f96b58..c6f30aef1 100644 --- a/docs/0.2.x/progress/sections/index.html +++ b/docs/0.2.x/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/0.2.x/start/index.html b/docs/0.2.x/start/index.html index 5993bcd85..762607e75 100644 --- a/docs/0.2.x/start/index.html +++ b/docs/0.2.x/start/index.html @@ -5,7 +5,7 @@ Getting Started | Touying - + diff --git a/docs/0.2.x/style/index.html b/docs/0.2.x/style/index.html index 377a7a52e..7771e7463 100644 --- a/docs/0.2.x/style/index.html +++ b/docs/0.2.x/style/index.html @@ -5,7 +5,7 @@ Code Styles | Touying - + diff --git a/docs/0.2.x/themes/dewdrop/index.html b/docs/0.2.x/themes/dewdrop/index.html index 9666530ec..c663263e7 100644 --- a/docs/0.2.x/themes/dewdrop/index.html +++ b/docs/0.2.x/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop Theme | Touying - + diff --git a/docs/0.2.x/themes/metropolis/index.html b/docs/0.2.x/themes/metropolis/index.html index 6c8937b22..f256bd840 100644 --- a/docs/0.2.x/themes/metropolis/index.html +++ b/docs/0.2.x/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis Theme | Touying - + diff --git a/docs/0.2.x/themes/simple/index.html b/docs/0.2.x/themes/simple/index.html index 1bfaeb107..6a17d364f 100644 --- a/docs/0.2.x/themes/simple/index.html +++ b/docs/0.2.x/themes/simple/index.html @@ -5,7 +5,7 @@ Simple Theme | Touying - + diff --git a/docs/0.2.x/themes/university/index.html b/docs/0.2.x/themes/university/index.html index 217c3893c..8121ef3ab 100644 --- a/docs/0.2.x/themes/university/index.html +++ b/docs/0.2.x/themes/university/index.html @@ -5,7 +5,7 @@ University Theme | Touying - + diff --git a/docs/0.2.x/utilities/fit-to/index.html b/docs/0.2.x/utilities/fit-to/index.html index 093a7e31a..955b62ecf 100644 --- a/docs/0.2.x/utilities/fit-to/index.html +++ b/docs/0.2.x/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + diff --git a/docs/0.2.x/utilities/oop/index.html b/docs/0.2.x/utilities/oop/index.html index e550349f6..6fdec371a 100644 --- a/docs/0.2.x/utilities/oop/index.html +++ b/docs/0.2.x/utilities/oop/index.html @@ -5,7 +5,7 @@ Object-Oriented Programming | Touying - + diff --git a/docs/0.3.2+/build-your-own-theme/index.html b/docs/0.3.2+/build-your-own-theme/index.html index c3c38085a..cbe0f03bb 100644 --- a/docs/0.3.2+/build-your-own-theme/index.html +++ b/docs/0.3.2+/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Creating Your Own Theme | Touying - + diff --git a/docs/0.3.2+/category/dynamic-slides/index.html b/docs/0.3.2+/category/dynamic-slides/index.html index 0e17e79b8..a5ae14dc2 100644 --- a/docs/0.3.2+/category/dynamic-slides/index.html +++ b/docs/0.3.2+/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/docs/0.3.2+/category/external-tools/index.html b/docs/0.3.2+/category/external-tools/index.html index e92dfd7ce..fbacc895d 100644 --- a/docs/0.3.2+/category/external-tools/index.html +++ b/docs/0.3.2+/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/docs/0.3.2+/category/package-integration/index.html b/docs/0.3.2+/category/package-integration/index.html index 8134fb503..874b9d02f 100644 --- a/docs/0.3.2+/category/package-integration/index.html +++ b/docs/0.3.2+/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/docs/0.3.2+/category/progress/index.html b/docs/0.3.2+/category/progress/index.html index 44d542ae7..aeaa94bac 100644 --- a/docs/0.3.2+/category/progress/index.html +++ b/docs/0.3.2+/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/docs/0.3.2+/category/themes/index.html b/docs/0.3.2+/category/themes/index.html index 50edfd6c7..6f5c52e1d 100644 --- a/docs/0.3.2+/category/themes/index.html +++ b/docs/0.3.2+/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/docs/0.3.2+/category/utilities/index.html b/docs/0.3.2+/category/utilities/index.html index 41f85166d..4cbc9b92b 100644 --- a/docs/0.3.2+/category/utilities/index.html +++ b/docs/0.3.2+/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/docs/0.3.2+/changelog/index.html b/docs/0.3.2+/changelog/index.html index a7ae13910..ccd491815 100644 --- a/docs/0.3.2+/changelog/index.html +++ b/docs/0.3.2+/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/0.3.2+/code-styles/index.html b/docs/0.3.2+/code-styles/index.html index 4359eb808..713eca0f1 100644 --- a/docs/0.3.2+/code-styles/index.html +++ b/docs/0.3.2+/code-styles/index.html @@ -5,7 +5,7 @@ Code Style | Touying - + diff --git a/docs/0.3.2+/dynamic/complex/index.html b/docs/0.3.2+/dynamic/complex/index.html index d5b899501..bc927d538 100644 --- a/docs/0.3.2+/dynamic/complex/index.html +++ b/docs/0.3.2+/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + diff --git a/docs/0.3.2+/dynamic/cover/index.html b/docs/0.3.2+/dynamic/cover/index.html index 5accfe76d..c16a6ab2c 100644 --- a/docs/0.3.2+/dynamic/cover/index.html +++ b/docs/0.3.2+/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover Function | Touying - + diff --git a/docs/0.3.2+/dynamic/equation/index.html b/docs/0.3.2+/dynamic/equation/index.html index 4c0823bf6..51a9de432 100644 --- a/docs/0.3.2+/dynamic/equation/index.html +++ b/docs/0.3.2+/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + diff --git a/docs/0.3.2+/dynamic/handout/index.html b/docs/0.3.2+/dynamic/handout/index.html index 41c5b0902..6e230bb98 100644 --- a/docs/0.3.2+/dynamic/handout/index.html +++ b/docs/0.3.2+/dynamic/handout/index.html @@ -5,7 +5,7 @@ Handout Mode | Touying - + diff --git a/docs/0.3.2+/dynamic/other/index.html b/docs/0.3.2+/dynamic/other/index.html index 14a261012..7f83ca5b3 100644 --- a/docs/0.3.2+/dynamic/other/index.html +++ b/docs/0.3.2+/dynamic/other/index.html @@ -5,7 +5,7 @@ Other Animations | Touying - + diff --git a/docs/0.3.2+/dynamic/simple/index.html b/docs/0.3.2+/dynamic/simple/index.html index 13e21579e..bbed6f000 100644 --- a/docs/0.3.2+/dynamic/simple/index.html +++ b/docs/0.3.2+/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + diff --git a/docs/0.3.2+/external/pdfpc/index.html b/docs/0.3.2+/external/pdfpc/index.html index cb325dc9e..c55d5a2e1 100644 --- a/docs/0.3.2+/external/pdfpc/index.html +++ b/docs/0.3.2+/external/pdfpc/index.html @@ -5,7 +5,7 @@ Pdfpc | Touying - + diff --git a/docs/0.3.2+/external/typst-preview/index.html b/docs/0.3.2+/external/typst-preview/index.html index 654158653..475632a38 100644 --- a/docs/0.3.2+/external/typst-preview/index.html +++ b/docs/0.3.2+/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/docs/0.3.2+/global-settings/index.html b/docs/0.3.2+/global-settings/index.html index af30d50e2..afc8ba82a 100644 --- a/docs/0.3.2+/global-settings/index.html +++ b/docs/0.3.2+/global-settings/index.html @@ -5,7 +5,7 @@ Global Settings | Touying - + diff --git a/docs/0.3.2+/integration/cetz/index.html b/docs/0.3.2+/integration/cetz/index.html index 1497536bb..5cbb29c11 100644 --- a/docs/0.3.2+/integration/cetz/index.html +++ b/docs/0.3.2+/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/docs/0.3.2+/integration/codly/index.html b/docs/0.3.2+/integration/codly/index.html index 5be5e36f4..a8cb477a5 100644 --- a/docs/0.3.2+/integration/codly/index.html +++ b/docs/0.3.2+/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/docs/0.3.2+/integration/fletcher/index.html b/docs/0.3.2+/integration/fletcher/index.html index 7f9f190cb..598465135 100644 --- a/docs/0.3.2+/integration/fletcher/index.html +++ b/docs/0.3.2+/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/docs/0.3.2+/integration/mitex/index.html b/docs/0.3.2+/integration/mitex/index.html index 48a0548e0..10d51a309 100644 --- a/docs/0.3.2+/integration/mitex/index.html +++ b/docs/0.3.2+/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/docs/0.3.2+/integration/pinit/index.html b/docs/0.3.2+/integration/pinit/index.html index 038326629..bd1651aed 100644 --- a/docs/0.3.2+/integration/pinit/index.html +++ b/docs/0.3.2+/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/docs/0.3.2+/integration/polylux/index.html b/docs/0.3.2+/integration/polylux/index.html index 7e2170680..b6a944247 100644 --- a/docs/0.3.2+/integration/polylux/index.html +++ b/docs/0.3.2+/integration/polylux/index.html @@ -5,7 +5,7 @@ Polylux | Touying - + diff --git a/docs/0.3.2+/intro/index.html b/docs/0.3.2+/intro/index.html index e5999674c..056f663b4 100644 --- a/docs/0.3.2+/intro/index.html +++ b/docs/0.3.2+/intro/index.html @@ -5,7 +5,7 @@ Introduction to Touying | Touying - + diff --git a/docs/0.3.2+/layout/index.html b/docs/0.3.2+/layout/index.html index 6e80d121c..6499f0bbe 100644 --- a/docs/0.3.2+/layout/index.html +++ b/docs/0.3.2+/layout/index.html @@ -5,7 +5,7 @@ Page Layout | Touying - + diff --git a/docs/0.3.2+/progress/counters/index.html b/docs/0.3.2+/progress/counters/index.html index 7cc1ba909..18f1b3c46 100644 --- a/docs/0.3.2+/progress/counters/index.html +++ b/docs/0.3.2+/progress/counters/index.html @@ -5,7 +5,7 @@ Touying Counters | Touying - + diff --git a/docs/0.3.2+/progress/sections/index.html b/docs/0.3.2+/progress/sections/index.html index b67bf661b..ee65ff334 100644 --- a/docs/0.3.2+/progress/sections/index.html +++ b/docs/0.3.2+/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/0.3.2+/sections/index.html b/docs/0.3.2+/sections/index.html index ae671b63f..f5bc7d637 100644 --- a/docs/0.3.2+/sections/index.html +++ b/docs/0.3.2+/sections/index.html @@ -5,7 +5,7 @@ Sections and Subsections | Touying - + diff --git a/docs/0.3.2+/start/index.html b/docs/0.3.2+/start/index.html index ff43dd368..4390cfeec 100644 --- a/docs/0.3.2+/start/index.html +++ b/docs/0.3.2+/start/index.html @@ -5,7 +5,7 @@ Getting Started | Touying - + diff --git a/docs/0.3.2+/themes/aqua/index.html b/docs/0.3.2+/themes/aqua/index.html index d92d5a4d1..d1acdeafb 100644 --- a/docs/0.3.2+/themes/aqua/index.html +++ b/docs/0.3.2+/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua Theme | Touying - + diff --git a/docs/0.3.2+/themes/dewdrop/index.html b/docs/0.3.2+/themes/dewdrop/index.html index 5a0353a7a..f61ddfd69 100644 --- a/docs/0.3.2+/themes/dewdrop/index.html +++ b/docs/0.3.2+/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop Theme | Touying - + diff --git a/docs/0.3.2+/themes/metropolis/index.html b/docs/0.3.2+/themes/metropolis/index.html index b9176e5fd..52d90d82c 100644 --- a/docs/0.3.2+/themes/metropolis/index.html +++ b/docs/0.3.2+/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis Theme | Touying - + diff --git a/docs/0.3.2+/themes/simple/index.html b/docs/0.3.2+/themes/simple/index.html index 2fdb7a484..c3bb6b05d 100644 --- a/docs/0.3.2+/themes/simple/index.html +++ b/docs/0.3.2+/themes/simple/index.html @@ -5,7 +5,7 @@ Simple Theme | Touying - + diff --git a/docs/0.3.2+/themes/university/index.html b/docs/0.3.2+/themes/university/index.html index a3f210d86..554840099 100644 --- a/docs/0.3.2+/themes/university/index.html +++ b/docs/0.3.2+/themes/university/index.html @@ -5,7 +5,7 @@ University Theme | Touying - + diff --git a/docs/0.3.2+/utilities/fit-to/index.html b/docs/0.3.2+/utilities/fit-to/index.html index ef465314e..958af46f9 100644 --- a/docs/0.3.2+/utilities/fit-to/index.html +++ b/docs/0.3.2+/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + diff --git a/docs/0.3.2+/utilities/oop/index.html b/docs/0.3.2+/utilities/oop/index.html index 5b738b4a2..ce1a110c0 100644 --- a/docs/0.3.2+/utilities/oop/index.html +++ b/docs/0.3.2+/utilities/oop/index.html @@ -5,7 +5,7 @@ Object-Oriented Programming | Touying - + diff --git a/docs/0.3.x/build-your-own-theme/index.html b/docs/0.3.x/build-your-own-theme/index.html index 5414c5eb3..4ec5546af 100644 --- a/docs/0.3.x/build-your-own-theme/index.html +++ b/docs/0.3.x/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Creating Your Own Theme | Touying - + diff --git a/docs/0.3.x/category/dynamic-slides/index.html b/docs/0.3.x/category/dynamic-slides/index.html index a66074eeb..fb800a0f9 100644 --- a/docs/0.3.x/category/dynamic-slides/index.html +++ b/docs/0.3.x/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/docs/0.3.x/category/external-tools/index.html b/docs/0.3.x/category/external-tools/index.html index 135394475..387bc33d8 100644 --- a/docs/0.3.x/category/external-tools/index.html +++ b/docs/0.3.x/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/docs/0.3.x/category/package-integration/index.html b/docs/0.3.x/category/package-integration/index.html index 7ac48f7cb..cf6911eef 100644 --- a/docs/0.3.x/category/package-integration/index.html +++ b/docs/0.3.x/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/docs/0.3.x/category/progress/index.html b/docs/0.3.x/category/progress/index.html index 826b74e7d..641813ffd 100644 --- a/docs/0.3.x/category/progress/index.html +++ b/docs/0.3.x/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/docs/0.3.x/category/themes/index.html b/docs/0.3.x/category/themes/index.html index 5e39ea695..256052f56 100644 --- a/docs/0.3.x/category/themes/index.html +++ b/docs/0.3.x/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/docs/0.3.x/category/utilities/index.html b/docs/0.3.x/category/utilities/index.html index f1d33cf36..b2db4aed1 100644 --- a/docs/0.3.x/category/utilities/index.html +++ b/docs/0.3.x/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/docs/0.3.x/changelog/index.html b/docs/0.3.x/changelog/index.html index 25ceee0fc..ca4cc97c6 100644 --- a/docs/0.3.x/changelog/index.html +++ b/docs/0.3.x/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/0.3.x/code-styles/index.html b/docs/0.3.x/code-styles/index.html index 5fa57a6a4..6bc725885 100644 --- a/docs/0.3.x/code-styles/index.html +++ b/docs/0.3.x/code-styles/index.html @@ -5,7 +5,7 @@ Code Style | Touying - + diff --git a/docs/0.3.x/dynamic/complex/index.html b/docs/0.3.x/dynamic/complex/index.html index 9d697d858..fb9d8b3ac 100644 --- a/docs/0.3.x/dynamic/complex/index.html +++ b/docs/0.3.x/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + diff --git a/docs/0.3.x/dynamic/cover/index.html b/docs/0.3.x/dynamic/cover/index.html index 99b66bb78..048c16f77 100644 --- a/docs/0.3.x/dynamic/cover/index.html +++ b/docs/0.3.x/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover Function | Touying - + diff --git a/docs/0.3.x/dynamic/equation/index.html b/docs/0.3.x/dynamic/equation/index.html index c6aba1bd5..1dafb29ec 100644 --- a/docs/0.3.x/dynamic/equation/index.html +++ b/docs/0.3.x/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + diff --git a/docs/0.3.x/dynamic/handout/index.html b/docs/0.3.x/dynamic/handout/index.html index 3f742e03e..b9691b6cc 100644 --- a/docs/0.3.x/dynamic/handout/index.html +++ b/docs/0.3.x/dynamic/handout/index.html @@ -5,7 +5,7 @@ Handout Mode | Touying - + diff --git a/docs/0.3.x/dynamic/other/index.html b/docs/0.3.x/dynamic/other/index.html index 4239f6660..d2e4a6218 100644 --- a/docs/0.3.x/dynamic/other/index.html +++ b/docs/0.3.x/dynamic/other/index.html @@ -5,7 +5,7 @@ Other Animations | Touying - + diff --git a/docs/0.3.x/dynamic/simple/index.html b/docs/0.3.x/dynamic/simple/index.html index f6226a52e..17aa40c1d 100644 --- a/docs/0.3.x/dynamic/simple/index.html +++ b/docs/0.3.x/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + diff --git a/docs/0.3.x/external/pdfpc/index.html b/docs/0.3.x/external/pdfpc/index.html index 5944720cf..cdf3bcd3f 100644 --- a/docs/0.3.x/external/pdfpc/index.html +++ b/docs/0.3.x/external/pdfpc/index.html @@ -5,7 +5,7 @@ Pdfpc | Touying - + diff --git a/docs/0.3.x/external/typst-preview/index.html b/docs/0.3.x/external/typst-preview/index.html index 500d54332..212e911a5 100644 --- a/docs/0.3.x/external/typst-preview/index.html +++ b/docs/0.3.x/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/docs/0.3.x/global-settings/index.html b/docs/0.3.x/global-settings/index.html index 6afbb5d4d..09a083b20 100644 --- a/docs/0.3.x/global-settings/index.html +++ b/docs/0.3.x/global-settings/index.html @@ -5,7 +5,7 @@ Global Settings | Touying - + diff --git a/docs/0.3.x/integration/cetz/index.html b/docs/0.3.x/integration/cetz/index.html index 570ab260c..fe5f559a1 100644 --- a/docs/0.3.x/integration/cetz/index.html +++ b/docs/0.3.x/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/docs/0.3.x/integration/codly/index.html b/docs/0.3.x/integration/codly/index.html index c8724fc06..db3398e16 100644 --- a/docs/0.3.x/integration/codly/index.html +++ b/docs/0.3.x/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/docs/0.3.x/integration/fletcher/index.html b/docs/0.3.x/integration/fletcher/index.html index 57db9c626..f85995cbc 100644 --- a/docs/0.3.x/integration/fletcher/index.html +++ b/docs/0.3.x/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/docs/0.3.x/integration/mitex/index.html b/docs/0.3.x/integration/mitex/index.html index 045bf5888..b4b4cc219 100644 --- a/docs/0.3.x/integration/mitex/index.html +++ b/docs/0.3.x/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/docs/0.3.x/integration/pinit/index.html b/docs/0.3.x/integration/pinit/index.html index 14735e1d2..0991671b5 100644 --- a/docs/0.3.x/integration/pinit/index.html +++ b/docs/0.3.x/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/docs/0.3.x/integration/polylux/index.html b/docs/0.3.x/integration/polylux/index.html index 9f7a251dd..b5e4d90ea 100644 --- a/docs/0.3.x/integration/polylux/index.html +++ b/docs/0.3.x/integration/polylux/index.html @@ -5,7 +5,7 @@ Polylux | Touying - + diff --git a/docs/0.3.x/intro/index.html b/docs/0.3.x/intro/index.html index adf8ec3b7..5cadeaeda 100644 --- a/docs/0.3.x/intro/index.html +++ b/docs/0.3.x/intro/index.html @@ -5,7 +5,7 @@ Introduction to Touying | Touying - + diff --git a/docs/0.3.x/layout/index.html b/docs/0.3.x/layout/index.html index 79277ae0d..ef31b07f8 100644 --- a/docs/0.3.x/layout/index.html +++ b/docs/0.3.x/layout/index.html @@ -5,7 +5,7 @@ Page Layout | Touying - + diff --git a/docs/0.3.x/progress/counters/index.html b/docs/0.3.x/progress/counters/index.html index a8775e9d2..8cd6fddeb 100644 --- a/docs/0.3.x/progress/counters/index.html +++ b/docs/0.3.x/progress/counters/index.html @@ -5,7 +5,7 @@ Touying Counters | Touying - + diff --git a/docs/0.3.x/progress/sections/index.html b/docs/0.3.x/progress/sections/index.html index 84c2d4f92..af9116864 100644 --- a/docs/0.3.x/progress/sections/index.html +++ b/docs/0.3.x/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/0.3.x/sections/index.html b/docs/0.3.x/sections/index.html index 128bd3965..942e07060 100644 --- a/docs/0.3.x/sections/index.html +++ b/docs/0.3.x/sections/index.html @@ -5,7 +5,7 @@ Sections and Subsections | Touying - + diff --git a/docs/0.3.x/start/index.html b/docs/0.3.x/start/index.html index a20997ac7..fd60c1758 100644 --- a/docs/0.3.x/start/index.html +++ b/docs/0.3.x/start/index.html @@ -5,7 +5,7 @@ Getting Started | Touying - + diff --git a/docs/0.3.x/themes/dewdrop/index.html b/docs/0.3.x/themes/dewdrop/index.html index 6816c9125..7d705948e 100644 --- a/docs/0.3.x/themes/dewdrop/index.html +++ b/docs/0.3.x/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop Theme | Touying - + diff --git a/docs/0.3.x/themes/metropolis/index.html b/docs/0.3.x/themes/metropolis/index.html index 7bb401d35..6b750027d 100644 --- a/docs/0.3.x/themes/metropolis/index.html +++ b/docs/0.3.x/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis Theme | Touying - + diff --git a/docs/0.3.x/themes/simple/index.html b/docs/0.3.x/themes/simple/index.html index 276a56106..0bde67db2 100644 --- a/docs/0.3.x/themes/simple/index.html +++ b/docs/0.3.x/themes/simple/index.html @@ -5,7 +5,7 @@ Simple Theme | Touying - + diff --git a/docs/0.3.x/themes/university/index.html b/docs/0.3.x/themes/university/index.html index 90a9a3cb0..e819b7249 100644 --- a/docs/0.3.x/themes/university/index.html +++ b/docs/0.3.x/themes/university/index.html @@ -5,7 +5,7 @@ University Theme | Touying - + diff --git a/docs/0.3.x/utilities/fit-to/index.html b/docs/0.3.x/utilities/fit-to/index.html index a1889b5a1..087080690 100644 --- a/docs/0.3.x/utilities/fit-to/index.html +++ b/docs/0.3.x/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + diff --git a/docs/0.3.x/utilities/oop/index.html b/docs/0.3.x/utilities/oop/index.html index d50bdb76f..f66b98328 100644 --- a/docs/0.3.x/utilities/oop/index.html +++ b/docs/0.3.x/utilities/oop/index.html @@ -5,7 +5,7 @@ Object-Oriented Programming | Touying - + diff --git a/docs/build-your-own-theme/index.html b/docs/build-your-own-theme/index.html index 05718e5c1..1a986155e 100644 --- a/docs/build-your-own-theme/index.html +++ b/docs/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Creating Your Own Theme | Touying - + diff --git a/docs/category/dynamic-slides/index.html b/docs/category/dynamic-slides/index.html index 6aba668ba..04b9c39e0 100644 --- a/docs/category/dynamic-slides/index.html +++ b/docs/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/docs/category/external-tools/index.html b/docs/category/external-tools/index.html index 8451f3b61..c6f11491c 100644 --- a/docs/category/external-tools/index.html +++ b/docs/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/docs/category/package-integration/index.html b/docs/category/package-integration/index.html index 31477bd0a..efd66905e 100644 --- a/docs/category/package-integration/index.html +++ b/docs/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/docs/category/progress/index.html b/docs/category/progress/index.html index 809f7cbee..1f4428bdc 100644 --- a/docs/category/progress/index.html +++ b/docs/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/docs/category/themes/index.html b/docs/category/themes/index.html index a0c5bd195..eb482673d 100644 --- a/docs/category/themes/index.html +++ b/docs/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/docs/category/utilities/index.html b/docs/category/utilities/index.html index fa8d5f70f..9929c7f05 100644 --- a/docs/category/utilities/index.html +++ b/docs/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/docs/changelog/index.html b/docs/changelog/index.html index 46842e550..5422c0bc8 100644 --- a/docs/changelog/index.html +++ b/docs/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/code-styles/index.html b/docs/code-styles/index.html index b655820ba..80921ee95 100644 --- a/docs/code-styles/index.html +++ b/docs/code-styles/index.html @@ -5,7 +5,7 @@ Code Style | Touying - + diff --git a/docs/dynamic/complex/index.html b/docs/dynamic/complex/index.html index 18074565d..2584c1d35 100644 --- a/docs/dynamic/complex/index.html +++ b/docs/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + diff --git a/docs/dynamic/cover/index.html b/docs/dynamic/cover/index.html index 89d746dfb..558da7a7d 100644 --- a/docs/dynamic/cover/index.html +++ b/docs/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover Function | Touying - + diff --git a/docs/dynamic/equation/index.html b/docs/dynamic/equation/index.html index 9656589d2..862469ec9 100644 --- a/docs/dynamic/equation/index.html +++ b/docs/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + diff --git a/docs/dynamic/handout/index.html b/docs/dynamic/handout/index.html index ffc0b4a0b..48a695fb8 100644 --- a/docs/dynamic/handout/index.html +++ b/docs/dynamic/handout/index.html @@ -5,7 +5,7 @@ Handout Mode | Touying - + diff --git a/docs/dynamic/other/index.html b/docs/dynamic/other/index.html index f43609c24..5b94eebee 100644 --- a/docs/dynamic/other/index.html +++ b/docs/dynamic/other/index.html @@ -5,7 +5,7 @@ Other Animations | Touying - + diff --git a/docs/dynamic/simple/index.html b/docs/dynamic/simple/index.html index ac04df635..188ba64e3 100644 --- a/docs/dynamic/simple/index.html +++ b/docs/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + diff --git a/docs/external/pdfpc/index.html b/docs/external/pdfpc/index.html index 4ba1ef58d..48180eb51 100644 --- a/docs/external/pdfpc/index.html +++ b/docs/external/pdfpc/index.html @@ -5,7 +5,7 @@ Pdfpc | Touying - + diff --git a/docs/external/typst-preview/index.html b/docs/external/typst-preview/index.html index 1a9eab411..a9b9dfcf7 100644 --- a/docs/external/typst-preview/index.html +++ b/docs/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/docs/global-settings/index.html b/docs/global-settings/index.html index 62bab174f..1a410fa6a 100644 --- a/docs/global-settings/index.html +++ b/docs/global-settings/index.html @@ -5,7 +5,7 @@ Global Settings | Touying - + diff --git a/docs/integration/cetz/index.html b/docs/integration/cetz/index.html index 022a6324a..dc05f3d93 100644 --- a/docs/integration/cetz/index.html +++ b/docs/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/docs/integration/codly/index.html b/docs/integration/codly/index.html index 1e24fdbb9..7f895c85e 100644 --- a/docs/integration/codly/index.html +++ b/docs/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/docs/integration/ctheorems/index.html b/docs/integration/ctheorems/index.html index 76fbf53a8..c938a4b73 100644 --- a/docs/integration/ctheorems/index.html +++ b/docs/integration/ctheorems/index.html @@ -5,7 +5,7 @@ Ctheorems | Touying - + diff --git a/docs/integration/fletcher/index.html b/docs/integration/fletcher/index.html index 4334664ca..899a571d0 100644 --- a/docs/integration/fletcher/index.html +++ b/docs/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/docs/integration/mitex/index.html b/docs/integration/mitex/index.html index dfa003c49..0454780ce 100644 --- a/docs/integration/mitex/index.html +++ b/docs/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/docs/integration/pinit/index.html b/docs/integration/pinit/index.html index eaa6b90c9..b45b598b1 100644 --- a/docs/integration/pinit/index.html +++ b/docs/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/docs/intro/index.html b/docs/intro/index.html index cd52325cc..16f520441 100644 --- a/docs/intro/index.html +++ b/docs/intro/index.html @@ -5,7 +5,7 @@ Introduction to Touying | Touying - + diff --git a/docs/layout/index.html b/docs/layout/index.html index 934e7995c..88138dc2e 100644 --- a/docs/layout/index.html +++ b/docs/layout/index.html @@ -5,7 +5,7 @@ Page Layout | Touying - + diff --git a/docs/multi-file/index.html b/docs/multi-file/index.html index 1f2108193..172063315 100644 --- a/docs/multi-file/index.html +++ b/docs/multi-file/index.html @@ -5,7 +5,7 @@ Multi-File Architecture | Touying - + diff --git a/docs/next/build-your-own-theme/index.html b/docs/next/build-your-own-theme/index.html index c1d3fbf54..d63014b62 100644 --- a/docs/next/build-your-own-theme/index.html +++ b/docs/next/build-your-own-theme/index.html @@ -5,7 +5,7 @@ Creating Your Own Theme | Touying - + @@ -28,16 +28,16 @@

Mo
  1. Copy the theme code from the themes directory to your local machine. For example, copy themes/university.typ to a local file named university.typ.
  2. Remove all #import "../xxx.typ" commands at the top of the university.typ file.
  3. -
  4. Add #import "@preview/touying:0.4.0": * at the top of the university.typ file to import all modules.
  5. +
  6. Add #import "@preview/touying:0.4.1": * at the top of the university.typ file to import all modules.
  7. Replace self: s in the register function with self: themes.default.register() (Important).

You can then import and use the theme by:

-
#import "@preview/touying:0.4.0": *
#import "university.typ"

#let s = university.register(aspect-ratio: "16-9")
+
#import "@preview/touying:0.4.1": *
#import "university.typ"

#let s = university.register(aspect-ratio: "16-9")

For a specific example, refer to: https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA

Import

Depending on whether the theme is for personal use or part of Touying, you can import in two ways:

If for personal use:

-
#import "@preview/touying:0.4.0": *
+
#import "@preview/touying:0.4.1": *

If part of Touying themes:

#import "../utils/utils.typ"
#import "../utils/states.typ"
#import "../utils/components.typ"

Additionally, add the import statement in Touying's themes/themes.typ:

@@ -45,7 +45,7 @@

ImportRegister Function and Init Method

Next, we'll distinguish between the bamboo.typ template file and the main.typ file, the latter of which is sometimes omitted.

Generally, the first step in creating slides is to determine font size and page aspect ratio. Therefore, we need to register an initialization method:

-
// bamboo.typ
#import "@preview/touying:0.4.0": *

#let register(
self: themes.default.register(),
aspect-ratio: "16-9",
) = {
self.page-args += (
paper: "presentation-" + aspect-ratio,
)
self.methods.init = (self: none, body) => {
set text(size: 20pt)
body
}
self
}

// main.typ
#import "@preview/touying:0.4.0": *
#import "bamboo.typ"

#let s = bamboo.register(aspect-ratio: "16-9")
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= First Section

== First Slide

#slide[
A slide with a title and an *important* information.
]
+
// bamboo.typ
#import "@preview/touying:0.4.1": *

#let register(
self: themes.default.register(),
aspect-ratio: "16-9",
) = {
self.page-args += (
paper: "presentation-" + aspect-ratio,
)
self.methods.init = (self: none, body) => {
set text(size: 20pt)
body
}
self
}

// main.typ
#import "@preview/touying:0.4.1": *
#import "bamboo.typ"

#let s = bamboo.register(aspect-ratio: "16-9")
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= First Section

== First Slide

#slide[
A slide with a title and an *important* information.
]

As you can see, we created a register function and passed an aspect-ratio parameter to set the page aspect ratio. We get default self by self: themes.default.register(). As you might already know, in Touying, we should not use set page(..) to set page parameters but rather use the syntax self.page-args += (..) to set them, as explained in the Page Layout section.

In addition, we registered a self.methods.init method, which can be used for some global style settings. For example, in this case, we added set text(size: 20pt) to set the font size. You can also place additional global style settings here, such as set par(justify: true). Since the init function is placed inside self.methods, it is a method, not a regular function. Therefore, we need to add the parameter self: none to use it properly.

As you can see, later in main.typ, we apply the global style settings in init using #show: init, where init is bound and unpacked through utils.methods(s).

@@ -72,7 +72,7 @@

Custom Special Slide

Building upon the basic slide, we further add some special slide functions such as title-slide, focus-slide, and a custom slides method.

@@ -81,7 +81,7 @@

Custom

For the new-section-slide method, the process is similar. The only thing to note is that in (self.methods.touying-slide)(self: self, repeat: none, section: section, body), we pass an additional section: section parameter to declare the creation of a new section. Another point to note is that besides self.methods.new-section-slide = new-section-slide, we also register self.methods.touying-new-section-slide = new-section-slide, so new-section-slide will be automatically called when encountering a first-level title.

For the focus-slide method, most of the content is similar, but it's worth noting that we use self.page-args += (..) to update the page's background color.

Finally, we update the slides(self: none, title-slide: true, slide-level: 1, ..args) method. When title-slide is true, using #show: slides will automatically create a title-slide. Setting slide-level: 1 indicates that the first-level and second-level titles correspond to section and title, respectively.

-
// bamboo.typ
#import "@preview/touying:0.4.0": *

#let slide(self: none, title: auto, ..args) = {
if title != auto {
self.bamboo-title = title
}
(self.methods.touying-slide)(self: self, ..args)
}

#let title-slide(self: none, ..args) = {
self = utils.empty-page(self)
let info = self.info + args.named()
let body = {
set align(center + horizon)
block(
fill: self.colors.primary,
width: 80%,
inset: (y: 1em),
radius: 1em,
text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)
)
set text(fill: self.colors.neutral-darkest)
if info.author != none {
block(info.author)
}
if info.date != none {
block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })
}
}
(self.methods.touying-slide)(self: self, repeat: none, body)
}

#let new-section-slide(self: none, section) = {
self = utils.empty-page(self)
let body = {
set align(center + horizon)
set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")
section
}
(self.methods.touying-slide)(self: self, repeat: none, section: section, body)
}

#let focus-slide(self: none, body) = {
self = utils.empty-page(self)
self.page-args += (
fill: self.colors.primary,
margin: 2em,
)
set text(fill: self.colors.neutral-lightest, size: 2em)
(self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))
}

#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {
if title-slide {
(self.methods.title-slide)(self: self)
}
(self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)
}

#let register(
self: themes.default.register(),
aspect-ratio: "16-9",
footer: [],
) = {
// color theme
self = (self.methods.colors)(
self: self,
primary: rgb("#5E8B65"),
neutral-lightest: rgb("#ffffff"),
neutral-darkest: rgb("#000000"),
)
// variables for later use
self.bamboo-title = []
self.bamboo-footer = footer
// set page
let header(self) = {
set align(top)
show: components.cell.with(fill: self.colors.primary, inset: 1em)
set align(horizon)
set text(fill: self.colors.neutral-lightest, size: .7em)
states.current-section-title
linebreak()
set text(size: 1.5em)
utils.call-or-display(self, self.bamboo-title)
}
let footer(self) = {
set align(bottom)
show: pad.with(.4em)
set text(fill: self.colors.neutral-darkest, size: .8em)
utils.call-or-display(self, self.bamboo-footer)
h(1fr)
states.slide-counter.display() + " / " + states.last-slide-number
}
self.page-args += (
paper: "presentation-" + aspect-ratio,
header: header,
footer: footer,
margin: (top: 4em, bottom: 1.5em, x: 2em),
)
// register methods
self.methods.slide = slide
self.methods.title-slide = title-slide
self.methods.new-section-slide = new-section-slide
self.methods.touying-new-section-slide = new-section-slide
self.methods.focus-slide = focus-slide
self.methods.slides = slides
self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
self.methods.init = (self: none, body) => {
set text(size: 20pt)
body
}
self
}


// main.typ
#import "@preview/touying:0.4.0": *
#import "bamboo.typ"

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

#show strong: alert

#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)
#show: slides

= First Section

== First Slide

#slide[
A slide with a title and an *important* information.
]

#focus-slide[
Focus on it!
]
+
// bamboo.typ
#import "@preview/touying:0.4.1": *

#let slide(self: none, title: auto, ..args) = {
if title != auto {
self.bamboo-title = title
}
(self.methods.touying-slide)(self: self, ..args)
}

#let title-slide(self: none, ..args) = {
self = utils.empty-page(self)
let info = self.info + args.named()
let body = {
set align(center + horizon)
block(
fill: self.colors.primary,
width: 80%,
inset: (y: 1em),
radius: 1em,
text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)
)
set text(fill: self.colors.neutral-darkest)
if info.author != none {
block(info.author)
}
if info.date != none {
block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })
}
}
(self.methods.touying-slide)(self: self, repeat: none, body)
}

#let new-section-slide(self: none, section) = {
self = utils.empty-page(self)
let body = {
set align(center + horizon)
set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")
section
}
(self.methods.touying-slide)(self: self, repeat: none, section: section, body)
}

#let focus-slide(self: none, body) = {
self = utils.empty-page(self)
self.page-args += (
fill: self.colors.primary,
margin: 2em,
)
set text(fill: self.colors.neutral-lightest, size: 2em)
(self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))
}

#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {
if title-slide {
(self.methods.title-slide)(self: self)
}
(self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)
}

#let register(
self: themes.default.register(),
aspect-ratio: "16-9",
footer: [],
) = {
// color theme
self = (self.methods.colors)(
self: self,
primary: rgb("#5E8B65"),
neutral-lightest: rgb("#ffffff"),
neutral-darkest: rgb("#000000"),
)
// variables for later use
self.bamboo-title = []
self.bamboo-footer = footer
// set page
let header(self) = {
set align(top)
show: components.cell.with(fill: self.colors.primary, inset: 1em)
set align(horizon)
set text(fill: self.colors.neutral-lightest, size: .7em)
states.current-section-title
linebreak()
set text(size: 1.5em)
utils.call-or-display(self, self.bamboo-title)
}
let footer(self) = {
set align(bottom)
show: pad.with(.4em)
set text(fill: self.colors.neutral-darkest, size: .8em)
utils.call-or-display(self, self.bamboo-footer)
h(1fr)
states.slide-counter.display() + " / " + states.last-slide-number
}
self.page-args += (
paper: "presentation-" + aspect-ratio,
header: header,
footer: footer,
margin: (top: 4em, bottom: 1.5em, x: 2em),
)
// register methods
self.methods.slide = slide
self.methods.title-slide = title-slide
self.methods.new-section-slide = new-section-slide
self.methods.touying-new-section-slide = new-section-slide
self.methods.focus-slide = focus-slide
self.methods.slides = slides
self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
self.methods.init = (self: none, body) => {
set text(size: 20pt)
body
}
self
}


// main.typ
#import "@preview/touying:0.4.1": *
#import "bamboo.typ"

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

#show strong: alert

#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)
#show: slides

= First Section

== First Slide

#slide[
A slide with a title and an *important* information.
]

#focus-slide[
Focus on it!
]

image

Conclusion

Congratulations! You've created a simple and elegant theme. Perhaps you may find that Touying introduces a wealth of concepts, making it initially challenging to grasp. This is normal, as Touying opts for functionality over simplicity. However, thanks to Touying's comprehensive and unified approach, you can easily extract commonalities between different themes and transfer your knowledge seamlessly. You can also save global variables, modify existing themes, or switch between themes effortlessly, showcasing the benefits of Touying's decoupling and object-oriented programming.

diff --git a/docs/next/category/dynamic-slides/index.html b/docs/next/category/dynamic-slides/index.html index 18b309020..a273a9e75 100644 --- a/docs/next/category/dynamic-slides/index.html +++ b/docs/next/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/docs/next/category/external-tools/index.html b/docs/next/category/external-tools/index.html index 12df8445c..ede007a0b 100644 --- a/docs/next/category/external-tools/index.html +++ b/docs/next/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/docs/next/category/package-integration/index.html b/docs/next/category/package-integration/index.html index 28d7b5fda..9ac93d347 100644 --- a/docs/next/category/package-integration/index.html +++ b/docs/next/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/docs/next/category/progress/index.html b/docs/next/category/progress/index.html index 3692057fb..b5014ae94 100644 --- a/docs/next/category/progress/index.html +++ b/docs/next/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/docs/next/category/themes/index.html b/docs/next/category/themes/index.html index 255842de2..5421737f8 100644 --- a/docs/next/category/themes/index.html +++ b/docs/next/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/docs/next/category/utilities/index.html b/docs/next/category/utilities/index.html index 8d6e3d357..82e2b78cc 100644 --- a/docs/next/category/utilities/index.html +++ b/docs/next/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/docs/next/changelog/index.html b/docs/next/changelog/index.html index d4ccc2553..c572666bf 100644 --- a/docs/next/changelog/index.html +++ b/docs/next/changelog/index.html @@ -5,7 +5,7 @@ Changelog | Touying - + diff --git a/docs/next/code-styles/index.html b/docs/next/code-styles/index.html index 6a2c2586a..9a7b22843 100644 --- a/docs/next/code-styles/index.html +++ b/docs/next/code-styles/index.html @@ -5,21 +5,21 @@ Code Style | Touying - +
Version: Next

Code Style

Simple Style

If we only need simplicity, we can directly input content under the heading, just like writing a normal Typst document. The heading here serves to divide the pages, and we can use commands like #pause to achieve animation effects.

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

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+
#import "@preview/touying:0.4.1": *

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

image

You can use an empty heading == to create a new page. This skill also helps clear the continuation of the previous title.

PS: We can use the #slides-end marker to signify the end of #show: slides.

Block Style

Many times, using simple style alone cannot achieve all the functions we need. For more powerful features and clearer structure, we can also use block style in the form of #slide[...]. The #slide function needs to be unpacked using the syntax #let (slide, empty-slide) = utils.slides(s) to be used correctly after #show: slides.

For example, the previous example can be transformed into:

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

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

#slide[
Hello, Touying!

#pause

Hello, Typst!
]
+
#import "@preview/touying:0.4.1": *

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

#slide[
Hello, Touying!

#pause

Hello, Typst!
]

and #empty-slide[] to create an empty slide without header and footer.

There are many advantages to doing this:

    @@ -31,15 +31,15 @@

    Block StyleConvention Over Configuration

    You may have noticed that when using the simple theme, using a level-one heading automatically creates a new section slide. This is because the simple theme registers an s.methods.touying-new-section-slide method, so Touying will automatically call this method.

    If we don't want it to automatically create such a section slide, we can delete this method:

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

    #let s = themes.simple.register()
    #(s.methods.touying-new-section-slide = none)
    #let (init, slides) = utils.methods(s)
    #show: init

    #let (slide, empty-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!
    +
    #import "@preview/touying:0.4.1": *

    #let s = themes.simple.register()
    #(s.methods.touying-new-section-slide = none)
    #let (init, slides) = utils.methods(s)
    #show: init

    #let (slide, empty-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!

    image

    As you can see, there are only two pages left, and the default section slide is gone.

    Similarly, we can register a new section slide:

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

    #let s = themes.simple.register()
    #(s.methods.touying-new-section-slide = (self: none, section, ..args) => {
    self = utils.empty-page(self)
    (s.methods.touying-slide)(self: self, section: section, {
    set align(center + horizon)
    set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")
    section
    }, ..args)
    })
    #let (init, slides, touying-outline) = utils.methods(s)
    #show: init

    #let (slide, empty-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!
    +
    #import "@preview/touying:0.4.1": *

    #let s = themes.simple.register()
    #(s.methods.touying-new-section-slide = (self: none, section, ..args) => {
    self = utils.empty-page(self)
    (s.methods.touying-slide)(self: self, section: section, {
    set align(center + horizon)
    set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")
    section
    }, ..args)
    })
    #let (init, slides, touying-outline) = utils.methods(s)
    #show: init

    #let (slide, empty-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!

    image

    Similarly, we can modify s.methods.touying-new-subsection-slide to do the same for subsection.

    In fact, besides s.methods.touying-new-section-slide, another special slide function is the s.methods.slide function, which will be called by default in simple style when #slide[...] is not explicitly used.

    Also, since #slide[...] is registered in s.slides = ("slide",), the section, subsection, and title parameters will be automatically passed, while others like #focus-slide[...] will not automatically receive these three parameters.

    -
    Principle

    In fact, you can also not use #show: slides and utils.slides(s), but only use utils.methods(s), for example:

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

    #let s = themes.simple.register()
    #let (init, touying-outline, slide) = utils.methods(s)
    #show: init

    #slide(section: [Title], title: [First Slide])[
    Hello, Touying!

    #pause

    Hello, Typst!
    ]

    Here, you need to manually pass in section, subsection, and title, but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages.

+
Principle

In fact, you can also not use #show: slides and utils.slides(s), but only use utils.methods(s), for example:

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

#let s = themes.simple.register()
#let (init, touying-outline, slide) = utils.methods(s)
#show: init

#slide(section: [Title], title: [First Slide])[
Hello, Touying!

#pause

Hello, Typst!
]

Here, you need to manually pass in section, subsection, and title, but it will have better performance, suitable for cases where faster performance is needed, such as when there are more than dozens or hundreds of pages.

\ No newline at end of file diff --git a/docs/next/dynamic/complex/index.html b/docs/next/dynamic/complex/index.html index 62afc125b..b25c53294 100644 --- a/docs/next/dynamic/complex/index.html +++ b/docs/next/dynamic/complex/index.html @@ -5,7 +5,7 @@ Complex Animations | Touying - + diff --git a/docs/next/dynamic/cover/index.html b/docs/next/dynamic/cover/index.html index d7c04416c..24bfc272b 100644 --- a/docs/next/dynamic/cover/index.html +++ b/docs/next/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover Function | Touying - + diff --git a/docs/next/dynamic/equation/index.html b/docs/next/dynamic/equation/index.html index 72e884d26..5341c76d6 100644 --- a/docs/next/dynamic/equation/index.html +++ b/docs/next/dynamic/equation/index.html @@ -5,7 +5,7 @@ Math Equation Animations | Touying - + diff --git a/docs/next/dynamic/handout/index.html b/docs/next/dynamic/handout/index.html index 6a0bd2f59..9cf9b5a9f 100644 --- a/docs/next/dynamic/handout/index.html +++ b/docs/next/dynamic/handout/index.html @@ -5,7 +5,7 @@ Handout Mode | Touying - + diff --git a/docs/next/dynamic/other/index.html b/docs/next/dynamic/other/index.html index 058877356..4b1e3e809 100644 --- a/docs/next/dynamic/other/index.html +++ b/docs/next/dynamic/other/index.html @@ -5,7 +5,7 @@ Other Animations | Touying - + @@ -13,7 +13,7 @@

Touying also provides touying-reducer, which adds pause and meanwhile animations to cetz and fletcher.

Simple Animations

Here's an example:

-
#import "@preview/touying:0.4.0": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]

image

only and uncover

In fact, we can also use only and uncover within cetz, just requiring a bit of skill:

diff --git a/docs/next/dynamic/simple/index.html b/docs/next/dynamic/simple/index.html index a061a2be6..ec8be0c3d 100644 --- a/docs/next/dynamic/simple/index.html +++ b/docs/next/dynamic/simple/index.html @@ -5,7 +5,7 @@ Simple Animations | Touying - + diff --git a/docs/next/external/pdfpc/index.html b/docs/next/external/pdfpc/index.html index b8cabdbfb..1728c8251 100644 --- a/docs/next/external/pdfpc/index.html +++ b/docs/next/external/pdfpc/index.html @@ -5,7 +5,7 @@ Pdfpc | Touying - + @@ -23,6 +23,6 @@

Exporti

Assuming your document is ./example.typ, you can export the .pdfpc file directly using:

typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc

With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:

-
#import "@preview/touying:0.4.0"

#locate(loc => touying.pdfpc.pdfpc-file(loc))
+
#import "@preview/touying:0.4.1"

#locate(loc => touying.pdfpc.pdfpc-file(loc))
\ No newline at end of file diff --git a/docs/next/external/pympress/index.html b/docs/next/external/pympress/index.html index 676e88309..42d0a5ce9 100644 --- a/docs/next/external/pympress/index.html +++ b/docs/next/external/pympress/index.html @@ -5,14 +5,14 @@ Pympress | Touying - +
Version: Next

Pympress

Pympress 是一种 PDF 演示工具,专为演示文稿和公开演讲等双屏设置而设计。高度可配置、功能齐全且可移植。

笔记支持

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

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

// Set the speaker notes configuration, you can show it by pympress
#let s = (s.methods.show-notes-on-second-screen)(self: s, right)

#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Animation

== Simple Animation

We can use `#pause` to #pause display something later.

#pause

Just like this.

#meanwhile

Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.

#speaker-note[
+ This is a speaker note.
+ You won't see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`
]
+
#import "@preview/touying:0.4.1": *

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

// Set the speaker notes configuration, you can show it by pympress
#let s = (s.methods.show-notes-on-second-screen)(self: s, right)

#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Animation

== Simple Animation

We can use `#pause` to #pause display something later.

#pause

Just like this.

#meanwhile

Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.

#speaker-note[
+ This is a speaker note.
+ You won't see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`
]

image

然后我们就可以使用 pympress 放映了。

image

diff --git a/docs/next/external/typst-preview/index.html b/docs/next/external/typst-preview/index.html index d28cbfa26..3ed15fc16 100644 --- a/docs/next/external/typst-preview/index.html +++ b/docs/next/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/docs/next/global-settings/index.html b/docs/next/global-settings/index.html index 895bcb267..40e83822b 100644 --- a/docs/next/global-settings/index.html +++ b/docs/next/global-settings/index.html @@ -5,7 +5,7 @@ Global Settings | Touying - + @@ -30,7 +30,7 @@

Global In
Principle

Here, we will introduce a bit of OOP concept in Touying.

You should know that Typst is a typesetting language that supports incremental rendering, which means Typst caches the results of previous function calls. This requires that Typst consists of pure functions, meaning functions that do not change external variables. Thus, it is challenging to modify a global variable in the true sense, even with the use of state or counter. This would require the use of locate with callback functions to obtain the values inside, and this approach would have a significant impact on performance.

Touying does not use state or counter and does not violate the principle of pure functions in Typst. Instead, it uses a clever approach in an object-oriented style, maintaining a global singleton s. In Touying, an object refers to a Typst dictionary with its own member variables and methods. We agree that methods all have a named parameter self for passing the object itself, and methods are placed in the .methods domain. With this concept, it becomes easier to write methods to update info:

#let s = (
info: (:),
methods: (
// update info
info: (self: none, ..args) => {
self.info += args.named()
self
},
)
)

#let s = (s.methods.info)(self: s, title: [title])

Title is #s.info.title

Now you can understand the purpose of the utils.methods() function: to bind self to all methods of s and return it, simplifying the subsequent usage through unpacking syntax.

#let (init, slides, alert) = utils.methods(s)

State Initialization

In general, the two ways mentioned above are sufficient for adding global settings. However, there are still situations where we need to initialize counters or states. If you place this code before #show: slides, a blank page will be created, which is something we don't want to see. In such cases, you can use the s.methods.append-preamble method. For example, when using the codly package:

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

#let s = themes.simple.register(aspect-ratio: "16-9")
#let s = (s.methods.append-preamble)(self: s)[
#codly(languages: (
rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
))
]
#let (init, slides) = utils.methods(s)
#show heading.where(level: 2): set block(below: 1em)
#show: init
#show: codly-init.with()

#let (slide, empty-slide) = utils.slides(s)
#show: slides

#slide[
== First slide

#raw(lang: "rust", block: true,
`pub fn main() {
println!("Hello, world!");
}`.text)
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/codly:0.2.0": *

#let s = themes.simple.register(aspect-ratio: "16-9")
#let s = (s.methods.append-preamble)(self: s)[
#codly(languages: (
rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
))
]
#let (init, slides) = utils.methods(s)
#show heading.where(level: 2): set block(below: 1em)
#show: init
#show: codly-init.with()

#let (slide, empty-slide) = utils.slides(s)
#show: slides

#slide[
== First slide

#raw(lang: "rust", block: true,
`pub fn main() {
println!("Hello, world!");
}`.text)
]

image

Or when configuring Pdfpc:

// Pdfpc configuration
// typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
#let s = (s.methods.append-preamble)(self: s, pdfpc.config(
duration-minutes: 30,
start-time: datetime(hour: 14, minute: 10, second: 0),
end-time: datetime(hour: 14, minute: 40, second: 0),
last-minutes: 5,
note-font-size: 12,
disable-markdown: false,
default-transition: (
type: "push",
duration-seconds: 2,
angle: ltr,
alignment: "vertical",
direction: "inward",
),
))
diff --git a/docs/next/integration/cetz/index.html b/docs/next/integration/cetz/index.html index ca5ab1e1c..33fab9342 100644 --- a/docs/next/integration/cetz/index.html +++ b/docs/next/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + @@ -13,7 +13,7 @@

Touying provides the touying-reducer, which adds pause and meanwhile animations to CeTZ and Fletcher.

Simple Animation

An example:

-
#import "@preview/touying:0.4.0": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]

image

only and uncover

In fact, we can also use only and uncover within CeTZ, but it requires a bit of technique:

diff --git a/docs/next/integration/codly/index.html b/docs/next/integration/codly/index.html index 4956029ae..b181588bb 100644 --- a/docs/next/integration/codly/index.html +++ b/docs/next/integration/codly/index.html @@ -5,13 +5,13 @@ Codly | Touying - +
Version: Next

Codly

When using Codly, we should initialize it using the s.methods.append-preamble method.

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

#let s = themes.simple.register(aspect-ratio: "16-9")
#let s = (s.methods.append-preamble)(self: s)[
#codly(languages: (
rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
))
]
#let (init, slides) = utils.methods(s)
#show heading.where(level: 2): set block(below: 1em)
#show: init
#show: codly-init.with()

#let (slide, empty-slide) = utils.slides(s)
#show: slides

#slide[
== First slide

#raw(lang: "rust", block: true,
`pub fn main() {
println!("Hello, world!");
}`.text)
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/codly:0.2.0": *

#let s = themes.simple.register(aspect-ratio: "16-9")
#let s = (s.methods.append-preamble)(self: s)[
#codly(languages: (
rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
))
]
#let (init, slides) = utils.methods(s)
#show heading.where(level: 2): set block(below: 1em)
#show: init
#show: codly-init.with()

#let (slide, empty-slide) = utils.slides(s)
#show: slides

#slide[
== First slide

#raw(lang: "rust", block: true,
`pub fn main() {
println!("Hello, world!");
}`.text)
]

image

\ No newline at end of file diff --git a/docs/next/integration/ctheorems/index.html b/docs/next/integration/ctheorems/index.html index 2713c48e8..00a431d7c 100644 --- a/docs/next/integration/ctheorems/index.html +++ b/docs/next/integration/ctheorems/index.html @@ -5,14 +5,14 @@ Ctheorems | Touying - +
Version: Next

Ctheorems

Touying can work seamlessly with the ctheorems package, allowing you to directly use the ctheorems package.

Moreover, you can utilize #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") to set numbering for sections and subsections.

-
#import "@preview/touying:0.4.0": *
#import "@preview/ctheorems:1.1.2": *

// Register university theme
#let s = themes.simple.register(aspect-ratio: "16-9")

// Set the numbering of section and subsection
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

// Theroems configuration by ctheorems
#show: thmrules.with(qed-symbol: $square$)
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain(
"corollary",
"Corollary",
base: "theorem",
titlefmt: strong
)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")

// Extract methods
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

// Extract slide functions
#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Theroems

== Prime numbers

#definition[
A natural number is called a #highlight[_prime number_] if it is greater
than 1 and cannot be written as the product of two smaller natural numbers.
]
#example[
The numbers $2$, $3$, and $17$ are prime.
@cor_largest_prime shows that this list is not exhaustive!
]

#theorem("Euclid")[
There are infinitely many primes.
]
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
contradiction.
]

#corollary[
There is no largest prime number.
] <cor_largest_prime>
#corollary[
There are infinitely many composite numbers.
]

#theorem[
There are arbitrarily long stretches of composite numbers.
]

#proof[
For any $n > 2$, consider $
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
$
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/ctheorems:1.1.2": *

// Register university theme
#let s = themes.simple.register(aspect-ratio: "16-9")

// Set the numbering of section and subsection
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

// Theroems configuration by ctheorems
#show: thmrules.with(qed-symbol: $square$)
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain(
"corollary",
"Corollary",
base: "theorem",
titlefmt: strong
)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")

// Extract methods
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

// Extract slide functions
#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Theroems

== Prime numbers

#definition[
A natural number is called a #highlight[_prime number_] if it is greater
than 1 and cannot be written as the product of two smaller natural numbers.
]
#example[
The numbers $2$, $3$, and $17$ are prime.
@cor_largest_prime shows that this list is not exhaustive!
]

#theorem("Euclid")[
There are infinitely many primes.
]
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
contradiction.
]

#corollary[
There is no largest prime number.
] <cor_largest_prime>
#corollary[
There are infinitely many composite numbers.
]

#theorem[
There are arbitrarily long stretches of composite numbers.
]

#proof[
For any $n > 2$, consider $
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
$
]

image

\ No newline at end of file diff --git a/docs/next/integration/fletcher/index.html b/docs/next/integration/fletcher/index.html index 56be7c22e..6f3dbdd35 100644 --- a/docs/next/integration/fletcher/index.html +++ b/docs/next/integration/fletcher/index.html @@ -5,14 +5,14 @@ Fletcher | Touying - +
Version: Next

Fletcher

Touying provides the touying-reducer, which adds pause and meanwhile animations to Fletcher.

An example:

-
#import "@preview/touying:0.4.0": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(title-slide: false, outline-slide: false)

// cetz animation
#slide[
Cetz in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})
]

// fletcher animation
#slide[
Fletcher in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]

image

\ No newline at end of file diff --git a/docs/next/integration/mitex/index.html b/docs/next/integration/mitex/index.html index 45f13df00..276e791ea 100644 --- a/docs/next/integration/mitex/index.html +++ b/docs/next/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/docs/next/integration/pinit/index.html b/docs/next/integration/pinit/index.html index 2c9841631..6b1266fb3 100644 --- a/docs/next/integration/pinit/index.html +++ b/docs/next/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + @@ -19,7 +19,7 @@

Simple Exampl

Complex Example

image

An example of shared usage with Touying:

-
#import "@preview/touying:0.4.0": *
#import "@preview/pinit:0.1.3": *

#(s.page-args.paper = "presentation-4-3")
#let (init, slides) = utils.methods(s)
#show: init

#set text(size: 20pt, font: "Calibri", ligatures: false)
#show heading: set text(weight: "regular")
#show heading: set block(above: 1.4em, below: 1em)
#show heading.where(level: 1): set text(size: 1.5em)

// Useful functions
#let crimson = rgb("#c00000")
#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)
#let redbold(body) = {
set text(fill: crimson, weight: "bold")
body
}
#let blueit(body) = {
set text(fill: blue)
body
}

#let (slide, empty-slide) = utils.slides(s)
#show: slides

// Main body
#slide(self => [
#let (uncover, only) = utils.methods(self)

= Asymptotic Notation: $O$

Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.
(Ignore constant coefficients and lower-order terms.)

#pause

#greybox[
Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:
#redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)
]

#pinit-highlight("h1", "h2")

#pause

$f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)

// #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))

#pause

$f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.

#only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))

#pause

#block[Insertion Sort as an #pin("r1")example#pin("r2"):]

- Best Case: $T(n) approx c n + c' n - c''$ #pin(3)
- Worst case: $T(n) approx c n + (c' \/ 2) n^2 - c''$ #pin(4)

#pinit-rect("r1", "r2")

#pause

#pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]
#pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]

#pause

#blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]

#pause

#only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))
#only("8-", pinit-point-from("ans", body-dx: -150pt)[
Show that the equation $(3/2)^n >= c$ \
has infinitely many solutions for $n$.
])
])
+
#import "@preview/touying:0.4.1": *
#import "@preview/pinit:0.1.3": *

#(s.page-args.paper = "presentation-4-3")
#let (init, slides) = utils.methods(s)
#show: init

#set text(size: 20pt, font: "Calibri", ligatures: false)
#show heading: set text(weight: "regular")
#show heading: set block(above: 1.4em, below: 1em)
#show heading.where(level: 1): set text(size: 1.5em)

// Useful functions
#let crimson = rgb("#c00000")
#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)
#let redbold(body) = {
set text(fill: crimson, weight: "bold")
body
}
#let blueit(body) = {
set text(fill: blue)
body
}

#let (slide, empty-slide) = utils.slides(s)
#show: slides

// Main body
#slide(self => [
#let (uncover, only) = utils.methods(self)

= Asymptotic Notation: $O$

Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.
(Ignore constant coefficients and lower-order terms.)

#pause

#greybox[
Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:
#redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)
]

#pinit-highlight("h1", "h2")

#pause

$f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)

// #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))

#pause

$f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.

#only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))

#pause

#block[Insertion Sort as an #pin("r1")example#pin("r2"):]

- Best Case: $T(n) approx c n + c' n - c''$ #pin(3)
- Worst case: $T(n) approx c n + (c' \/ 2) n^2 - c''$ #pin(4)

#pinit-rect("r1", "r2")

#pause

#pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]
#pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]

#pause

#blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]

#pause

#only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))
#only("8-", pinit-point-from("ans", body-dx: -150pt)[
Show that the equation $(3/2)^n >= c$ \
has infinitely many solutions for $n$.
])
])

image

\ No newline at end of file diff --git a/docs/next/intro/index.html b/docs/next/intro/index.html index 726804015..60417dd7f 100644 --- a/docs/next/intro/index.html +++ b/docs/next/intro/index.html @@ -5,7 +5,7 @@ Introduction to Touying | Touying - + diff --git a/docs/next/layout/index.html b/docs/next/layout/index.html index 6a93dcfad..3aee58199 100644 --- a/docs/next/layout/index.html +++ b/docs/next/layout/index.html @@ -5,7 +5,7 @@ Page Layout | Touying - + @@ -41,7 +41,7 @@

Page Managem

Adding a logo to slides is a very common but also a very versatile requirement. The difficulty lies in the fact that the required size and position of the logo often vary from person to person. Therefore, most of Touying's themes do not include configuration options for logos. But with the concepts of page layout mentioned in this section, we know that we can use the place function in the header or footer to place a logo image.

For example, suppose we decide to add the GitHub icon to the metropolis theme. We can implement it like this:

-
#import "@preview/touying:0.4.0": *
#import "@preview/octique:0.1.0": *

#let s = themes.metropolis.register(aspect-ratio: "16-9")
#(s.page-args.header = self => {
// display the original header
utils.call-or-display(self, s.page-args.header)
// place logo at the top-right
place(top + right, dx: -0.5em, dy: 0.3em)[
#octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)
]
})
#let (init, slide) = utils.methods(s)
#show: init

#slide(title: [Title])[
Logo example.
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/octique:0.1.0": *

#let s = themes.metropolis.register(aspect-ratio: "16-9")
#(s.page-args.header = self => {
// display the original header
utils.call-or-display(self, s.page-args.header)
// place logo at the top-right
place(top + right, dx: -0.5em, dy: 0.3em)[
#octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)
]
})
#let (init, slide) = utils.methods(s)
#show: init

#slide(title: [Title])[
Logo example.
]

image

Here, utils.call-or-display(self, body) can be used to display body as content or a callback function in the form self => content.

Page Columns

diff --git a/docs/next/multi-file/index.html b/docs/next/multi-file/index.html index 0a2a38af1..3624f1fb0 100644 --- a/docs/next/multi-file/index.html +++ b/docs/next/multi-file/index.html @@ -5,7 +5,7 @@ Multi-File Architecture | Touying - + @@ -16,7 +16,7 @@

// globals.typ
#import "@preview/touying:0.4.0": *

#let s = themes.university.register(aspect-ratio: "16-9")
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slides, touying-outline, alert) = utils.methods(s)
#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)

// as well as some utility functions
+
// globals.typ
#import "@preview/touying:0.4.1": *

#let s = themes.university.register(aspect-ratio: "16-9")
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slides, touying-outline, alert) = utils.methods(s)
#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)

// as well as some utility functions

main.typ, as the main entry point of the project, applies show rules by importing globals.typ and includes content.typ using #include:

// main.typ
#import "/globals.typ": *

#show: init
#show strong: alert
#show: slides

#include "content.typ"

content.typ is where you write the actual content:

diff --git a/docs/next/progress/counters/index.html b/docs/next/progress/counters/index.html index 6100cf44a..998279598 100644 --- a/docs/next/progress/counters/index.html +++ b/docs/next/progress/counters/index.html @@ -5,7 +5,7 @@ Touying Counters | Touying - + diff --git a/docs/next/progress/sections/index.html b/docs/next/progress/sections/index.html index 378950e45..e32697714 100644 --- a/docs/next/progress/sections/index.html +++ b/docs/next/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/next/sections/index.html b/docs/next/sections/index.html index 54b5492ad..9311b943d 100644 --- a/docs/next/sections/index.html +++ b/docs/next/sections/index.html @@ -5,7 +5,7 @@ Sections and Subsections | Touying - + @@ -13,10 +13,10 @@

Structure

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

Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme.

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

#let s = themes.dewdrop.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Section

== Subsection

=== Title

Hello, Touying!
+
#import "@preview/touying:0.4.1": *

#let s = themes.dewdrop.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Section

== Subsection

=== Title

Hello, Touying!

image

However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme.

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

#let s = themes.university.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Section

== Title

Hello, Touying!
+
#import "@preview/touying:0.4.1": *

#let s = themes.university.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Section

== Title

Hello, Touying!

image

In fact, we can control this behavior through the slide-level parameter of the slides function. slide-level represents the complexity of the nested structure, starting from 0. For example, #show: slides.with(slide-level: 2) is equivalent to the section, subsection, and title structure; while #show: slides.with(slide-level: 1) is equivalent to the section and title structure.

Numbering

@@ -25,7 +25,7 @@

NumberingTable of Contents

Displaying a table of contents in Touying is straightforward:

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

#let s = themes.simple.register()
#let (init, slides, alert, touying-outline) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(slide-level: 2)

= Section

== Subsection

=== Title

==== Table of contents

#touying-outline()
+
#import "@preview/touying:0.4.1": *

#let s = themes.simple.register()
#let (init, slides, alert, touying-outline) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides.with(slide-level: 2)

= Section

== Subsection

=== Title

==== Table of contents

#touying-outline()

image

Where the definition of touying-outline() is:

#let touying-outline(enum-args: (:), padding: 0pt) = { .. }
diff --git a/docs/next/start/index.html b/docs/next/start/index.html index ec59ee580..bfff5a628 100644 --- a/docs/next/start/index.html +++ b/docs/next/start/index.html @@ -5,14 +5,14 @@ Getting Started | Touying - +
Version: Next

Getting Started

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

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

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

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!
+
#import "@preview/touying:0.4.1": *

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

Hello, Touying!

#pause

Hello, Typst!

image

It's that simple! You've created your first Touying slides. Congratulations! 🎉

Tip: You can use Typst syntax like #import "config.typ": * or #include "content.typ" to implement Touying's multi-file architecture.

@@ -23,7 +23,7 @@

More C

Touying offers many built-in themes to easily create beautiful slides. For example, in this case:

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

you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections.

-
#import "@preview/touying:0.4.0": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge
#import "@preview/ctheorems:1.1.2": *

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

// Register university theme
// You can replace it with other themes and it can still work normally
#let s = themes.university.register(aspect-ratio: "16-9")

// Set the numbering of section and subsection
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

// Global information configuration
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)

// Pdfpc configuration
// typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
#let s = (s.methods.append-preamble)(self: s, pdfpc.config(
duration-minutes: 30,
start-time: datetime(hour: 14, minute: 10, second: 0),
end-time: datetime(hour: 14, minute: 40, second: 0),
last-minutes: 5,
note-font-size: 12,
disable-markdown: false,
default-transition: (
type: "push",
duration-seconds: 2,
angle: ltr,
alignment: "vertical",
direction: "inward",
),
))

// Theroems configuration by ctheorems
#show: thmrules.with(qed-symbol: $square$)
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain(
"corollary",
"Corollary",
base: "theorem",
titlefmt: strong
)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")

// Extract methods
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

// Extract slide functions
#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Animation

== Simple Animation

We can use `#pause` to #pause display something later.

#pause

Just like this.

#meanwhile

Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.


== Complex Animation

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

At subslide #self.subslide, we can

use #uncover("2-")[`#uncover` function] for reserving space,

use #only("2-")[`#only` function] for not reserving space,

#alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
])


== Math Equation Animation

Touying equation with `pause`:

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

#meanwhile

Here, #pause we have the expression of $f(x)$.

#pause

By factorizing, we can obtain this result.


== CeTZ Animation

CeTZ Animation in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})


== Fletcher Animation

Fletcher Animation in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)


= Theroems

== Prime numbers

#definition[
A natural number is called a #highlight[_prime number_] if it is greater
than 1 and cannot be written as the product of two smaller natural numbers.
]
#example[
The numbers $2$, $3$, and $17$ are prime.
@cor_largest_prime shows that this list is not exhaustive!
]

#theorem("Euclid")[
There are infinitely many primes.
]
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
contradiction.
]

#corollary[
There is no largest prime number.
] <cor_largest_prime>
#corollary[
There are infinitely many composite numbers.
]

#theorem[
There are arbitrarily long stretches of composite numbers.
]

#proof[
For any $n > 2$, consider $
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
$
]


= Others

== Side-by-side

#slide(composer: (1fr, 1fr))[
First column.
][
Second column.
]


== Multiple Pages

#lorem(200)


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

== Appendix

#slide[
Please pay attention to the current slide number.
]
+
#import "@preview/touying:0.4.1": *
#import "@preview/cetz:0.2.2"
#import "@preview/fletcher:0.4.4" as fletcher: node, edge
#import "@preview/ctheorems:1.1.2": *

// cetz and fletcher bindings for touying
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

// Register university theme
// You can replace it with other themes and it can still work normally
#let s = themes.university.register(aspect-ratio: "16-9")

// Set the numbering of section and subsection
#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

// Global information configuration
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)

// Pdfpc configuration
// typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
#let s = (s.methods.append-preamble)(self: s, pdfpc.config(
duration-minutes: 30,
start-time: datetime(hour: 14, minute: 10, second: 0),
end-time: datetime(hour: 14, minute: 40, second: 0),
last-minutes: 5,
note-font-size: 12,
disable-markdown: false,
default-transition: (
type: "push",
duration-seconds: 2,
angle: ltr,
alignment: "vertical",
direction: "inward",
),
))

// Theroems configuration by ctheorems
#show: thmrules.with(qed-symbol: $square$)
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain(
"corollary",
"Corollary",
base: "theorem",
titlefmt: strong
)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")

// Extract methods
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

// Extract slide functions
#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Animation

== Simple Animation

We can use `#pause` to #pause display something later.

#pause

Just like this.

#meanwhile

Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.


== Complex Animation

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

At subslide #self.subslide, we can

use #uncover("2-")[`#uncover` function] for reserving space,

use #only("2-")[`#only` function] for not reserving space,

#alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
])


== Math Equation Animation

Touying equation with `pause`:

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

#meanwhile

Here, #pause we have the expression of $f(x)$.

#pause

By factorizing, we can obtain this result.


== CeTZ Animation

CeTZ Animation in Touying:

#cetz-canvas({
import cetz.draw: *

rect((0,0), (5,5))

(pause,)

rect((0,0), (1,1))
rect((1,1), (2,2))
rect((2,2), (3,3))

(pause,)

line((0,0), (2.5, 2.5), name: "line")
})


== Fletcher Animation

Fletcher Animation in Touying:

#fletcher-diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
pause,
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)


= Theroems

== Prime numbers

#definition[
A natural number is called a #highlight[_prime number_] if it is greater
than 1 and cannot be written as the product of two smaller natural numbers.
]
#example[
The numbers $2$, $3$, and $17$ are prime.
@cor_largest_prime shows that this list is not exhaustive!
]

#theorem("Euclid")[
There are infinitely many primes.
]
#proof[
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
contradiction.
]

#corollary[
There is no largest prime number.
] <cor_largest_prime>
#corollary[
There are infinitely many composite numbers.
]

#theorem[
There are arbitrarily long stretches of composite numbers.
]

#proof[
For any $n > 2$, consider $
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
$
]


= Others

== Side-by-side

#slide(composer: (1fr, 1fr))[
First column.
][
Second column.
]


== Multiple Pages

#lorem(200)


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

== Appendix

#slide[
Please pay attention to the current slide number.
]

image

Touying offers many built-in themes to easily create beautiful slides. For example, in this case:

#let s = themes.university.register(aspect-ratio: "16-9")
diff --git a/docs/next/themes/aqua/index.html b/docs/next/themes/aqua/index.html index f18d6030e..6d3507711 100644 --- a/docs/next/themes/aqua/index.html +++ b/docs/next/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua Theme | Touying - + @@ -14,7 +14,7 @@

This theme is created by @pride7, featuring beautiful backgrounds made with Typst's visualization capabilities.

Initialization

You can initialize it with the following code:

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

#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
#show: slides
+
#import "@preview/touying:0.4.1": *

#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
#show: slides

Where register takes parameters:

  • aspect-ratio: The aspect ratio of slides, either "16-9" or "4-3", default is "16-9".
  • @@ -52,9 +52,9 @@

    slides

    They can be set via #show: slides.with(..).

    PS: The outline title can be modified via #(s.outline-title = [Outline]).

    Additionally, you can disable the automatic inclusion of new-section-slide functionality by #(s.methods.touying-new-section-slide = none).

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

    #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
    #let s = (s.methods.info)(
    self: s,
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    )
    #let (init, slides, touying-outline, alert) = utils.methods(s)
    #show: init

    #show strong: alert

    #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!
    +
    #import "@preview/touying:0.4.1": *

    #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
    #let s = (s.methods.info)(
    self: s,
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    )
    #let (init, slides, touying-outline, alert) = utils.methods(s)
    #show: init

    #show strong: alert

    #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!

    image

    Example

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

    #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
    #let s = (s.methods.info)(
    self: s,
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    )
    #let (init, slides, touying-outline, alert) = utils.methods(s)
    #show: init

    #show strong: alert

    #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
    #show: slides

    = The Section

    == Slide Title

    #slide[
    #lorem(40)
    ]

    #focus-slide[
    Another variant with primary color in background...
    ]

    == Summary

    #align(center + horizon)[
    #set text(size: 3em, weight: "bold", s.colors.primary)
    THANKS FOR ALL
    ]

+
#import "@preview/touying:0.4.1": *

#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
#show: slides

= The Section

== Slide Title

#slide[
#lorem(40)
]

#focus-slide[
Another variant with primary color in background...
]

== Summary

#align(center + horizon)[
#set text(size: 3em, weight: "bold", s.colors.primary)
THANKS FOR ALL
]
\ No newline at end of file diff --git a/docs/next/themes/dewdrop/index.html b/docs/next/themes/dewdrop/index.html index 259bffe54..a2d593e0c 100644 --- a/docs/next/themes/dewdrop/index.html +++ b/docs/next/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop Theme | Touying - + @@ -15,7 +15,7 @@

The Dewdrop theme features an elegantly designed navigation, including two modes: sidebar and mini-slides.

Initialization

You can initialize it using the following code:

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

#let s = themes.dewdrop.register(
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 (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
#show: slides
+
#import "@preview/touying:0.4.1": *

#let s = themes.dewdrop.register(
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 (init, slides, touying-outline, alert) = utils.methods(s)
#show: init

#show strong: alert

#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
#show: slides

The register function takes the following parameters:

  • aspect-ratio: The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."
  • @@ -68,9 +68,9 @@

    slides

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

    PS: You can modify the outline title using #(s.outline-title = [Outline]).

    And the function of automatically adding new-section-slide can be turned off by #(s.methods.touying-new-section-slide = none).

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

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!
    +
    #import "@preview/touying:0.4.1": *

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Title

    == First Slide

    Hello, Touying!

    #pause

    Hello, Typst!

    image

    Example

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

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Section A

    == Subsection A.1

    #slide[
    A slide with equation:

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

    == Subsection A.2

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

    = Section B

    == Subsection B.1

    #slide[
    #lorem(80)
    ]

    #focus-slide[
    Wake up!
    ]

    == Subsection B.2

    #slide[
    We can use `#pause` to #pause display something later.

    #pause

    Just like this.

    #meanwhile

    Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.
    ]

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

    = Appendix

    === Appendix

    #slide[
    Please pay attention to the current slide number.
    ]
    +
    #import "@preview/touying:0.4.1": *

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides

    = Section A

    == Subsection A.1

    #slide[
    A slide with equation:

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

    == Subsection A.2

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

    = Section B

    == Subsection B.1

    #slide[
    #lorem(80)
    ]

    #focus-slide[
    Wake up!
    ]

    == Subsection B.2

    #slide[
    We can use `#pause` to #pause display something later.

    #pause

    Just like this.

    #meanwhile

    Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.
    ]

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

    = Appendix

    === Appendix

    #slide[
    Please pay attention to the current slide number.
    ]
    \ No newline at end of file diff --git a/docs/next/themes/metropolis/index.html b/docs/next/themes/metropolis/index.html index 1e3158564..1f46cbacb 100644 --- a/docs/next/themes/metropolis/index.html +++ b/docs/next/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis Theme | Touying - + @@ -15,7 +15,7 @@

    The Metropolis theme is elegant and suitable for everyday use. It is recommended to have Fira Sans and Fira Math fonts installed on your computer for the best results.

    Initialization

    You can initialize it using the following code:

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

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides
    +
    #import "@preview/touying:0.4.1": *

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

    #show strong: alert

    #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
    #show: slides

    The register function takes the following parameters:

    • aspect-ratio: The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."
    • @@ -52,9 +52,9 @@

      slides

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

      PS: You can modify the outline title using #(s.outline-title = [Outline]).

      And the function of automatically adding new-section-slide can be turned off by #(s.methods.touying-new-section-slide = none).

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

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let 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!
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let 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.4.0": *

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

      #set text(font: "Fira Sans", weight: "light", size: 20pt)
      #show math.equation: set text(font: "Fira Math")
      #set strong(delta: 100)
      #set par(justify: true)
      #show strong: alert

      #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
      #show: slides

      = First Section

      #slide[
      A slide without a title but with some *important* information.
      ]

      == 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

      #slide[
      A slide with equation:

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

      #lorem(200)
      ]

      = Second Section

      #focus-slide[
      Wake up!
      ]

      == Simple Animation

      #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, empty-slide) = utils.slides(s)

      = Appendix

      #slide[
      Appendix.
      ]
      +
      #import "@preview/touying:0.4.1": *

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

      #set text(font: "Fira Sans", weight: "light", size: 20pt)
      #show math.equation: set text(font: "Fira Math")
      #set strong(delta: 100)
      #set par(justify: true)
      #show strong: alert

      #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
      #show: slides

      = First Section

      #slide[
      A slide without a title but with some *important* information.
      ]

      == 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

      #slide[
      A slide with equation:

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

      #lorem(200)
      ]

      = Second Section

      #focus-slide[
      Wake up!
      ]

      == Simple Animation

      #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, empty-slide) = utils.slides(s)

      = Appendix

      #slide[
      Appendix.
      ]
      \ No newline at end of file diff --git a/docs/next/themes/simple/index.html b/docs/next/themes/simple/index.html index a9c155091..50f7e4701 100644 --- a/docs/next/themes/simple/index.html +++ b/docs/next/themes/simple/index.html @@ -5,7 +5,7 @@ Simple Theme | Touying - + @@ -15,7 +15,7 @@

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

      Initialization

      You can initialize it using the following code:

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

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

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides
      +
      #import "@preview/touying:0.4.1": *

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

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides

      The register function takes the following parameters:

      • aspect-ratio: The aspect ratio of the slides, either "16-9" or "4-3," defaulting to "16-9."
      • @@ -45,9 +45,9 @@

        slides

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

      And the function of automatically adding new-section-slide can be turned off by #(s.methods.touying-new-section-slide = none).

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

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

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!
      +
      #import "@preview/touying:0.4.1": *

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

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!

      image

      Example

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

      #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides

      #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
      ]

      == First slide

      #slide[
      #lorem(20)
      ]

      #focus-slide[
      _Focus!_

      This is very important.
      ]

      = Let's start a new section!

      == Dynamic slide

      #slide[
      Did you know that...

      #pause

      ...you can see the current section at the top of the slide?
      ]
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
      #show: slides

      #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
      ]

      == First slide

      #slide[
      #lorem(20)
      ]

      #focus-slide[
      _Focus!_

      This is very important.
      ]

      = Let's start a new section!

      == Dynamic slide

      #slide[
      Did you know that...

      #pause

      ...you can see the current section at the top of the slide?
      ]
      \ No newline at end of file diff --git a/docs/next/themes/university/index.html b/docs/next/themes/university/index.html index 778cd44b9..1671e468a 100644 --- a/docs/next/themes/university/index.html +++ b/docs/next/themes/university/index.html @@ -5,7 +5,7 @@ University Theme | Touying - + @@ -14,7 +14,7 @@

      This aesthetically pleasing theme is courtesy of Pol Dellaiera.

      Initialization

      You can initialize the University theme using the following code:

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

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides
      +
      #import "@preview/touying:0.4.1": *

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides

      The register function accepts the following parameters:

      • aspect-ratio: Sets the aspect ratio of the slides to "16-9" or "4-3," with the default being "16-9."
      • @@ -53,9 +53,9 @@

        slides

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

      And the function of automatically adding new-section-slide can be turned off by #(s.methods.touying-new-section-slide = none).

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

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!
      +
      #import "@preview/touying:0.4.1": *

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!

      image

      Example

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

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides.with(title-slide: false)

      #title-slide(authors: ([Author A], [Author B]))

      = The Section

      == Slide Title

      #slide[
      #lorem(40)
      ]

      #slide(subtitle: emph[What is the problem?])[
      #lorem(40)
      ]

      #focus-slide[
      Another variant with primary color in background...
      ]

      #matrix-slide[
      left
      ][
      middle
      ][
      right
      ]

      #matrix-slide(columns: 1)[
      top
      ][
      bottom
      ]

      #matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)
      +
      #import "@preview/touying:0.4.1": *

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
      #show: slides.with(title-slide: false)

      #title-slide(authors: ([Author A], [Author B]))

      = The Section

      == Slide Title

      #slide[
      #lorem(40)
      ]

      #slide(subtitle: emph[What is the problem?])[
      #lorem(40)
      ]

      #focus-slide[
      Another variant with primary color in background...
      ]

      #matrix-slide[
      left
      ][
      middle
      ][
      right
      ]

      #matrix-slide(columns: 1)[
      top
      ][
      bottom
      ]

      #matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)
      \ No newline at end of file diff --git a/docs/next/utilities/fit-to/index.html b/docs/next/utilities/fit-to/index.html index 75ef095e2..51b44927b 100644 --- a/docs/next/utilities/fit-to/index.html +++ b/docs/next/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + diff --git a/docs/next/utilities/oop/index.html b/docs/next/utilities/oop/index.html index 2ea8a4214..a99fa743d 100644 --- a/docs/next/utilities/oop/index.html +++ b/docs/next/utilities/oop/index.html @@ -5,7 +5,7 @@ Object-Oriented Programming | Touying - + diff --git a/docs/progress/counters/index.html b/docs/progress/counters/index.html index d312f6b22..f5f5d1f55 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 fdb6e8886..842bb60cc 100644 --- a/docs/progress/sections/index.html +++ b/docs/progress/sections/index.html @@ -5,7 +5,7 @@ Touying Sections | Touying - + diff --git a/docs/sections/index.html b/docs/sections/index.html index 3a6ef7121..eebd528d0 100644 --- a/docs/sections/index.html +++ b/docs/sections/index.html @@ -5,7 +5,7 @@ Sections and Subsections | Touying - + diff --git a/docs/start/index.html b/docs/start/index.html index 2b55e2389..42dbf4ed9 100644 --- a/docs/start/index.html +++ b/docs/start/index.html @@ -5,7 +5,7 @@ Getting Started | Touying - + diff --git a/docs/themes/aqua/index.html b/docs/themes/aqua/index.html index 29fe40309..40f42ec63 100644 --- a/docs/themes/aqua/index.html +++ b/docs/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua Theme | Touying - + diff --git a/docs/themes/dewdrop/index.html b/docs/themes/dewdrop/index.html index a3cf87d42..cd91e3813 100644 --- a/docs/themes/dewdrop/index.html +++ b/docs/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop Theme | Touying - + diff --git a/docs/themes/metropolis/index.html b/docs/themes/metropolis/index.html index 20cae789b..270880536 100644 --- a/docs/themes/metropolis/index.html +++ b/docs/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis Theme | Touying - + diff --git a/docs/themes/simple/index.html b/docs/themes/simple/index.html index 1698f4dcf..726fc1e9c 100644 --- a/docs/themes/simple/index.html +++ b/docs/themes/simple/index.html @@ -5,7 +5,7 @@ Simple Theme | Touying - + diff --git a/docs/themes/university/index.html b/docs/themes/university/index.html index 2fd1e5168..ba491df6c 100644 --- a/docs/themes/university/index.html +++ b/docs/themes/university/index.html @@ -5,7 +5,7 @@ University Theme | Touying - + diff --git a/docs/utilities/fit-to/index.html b/docs/utilities/fit-to/index.html index 78d73ba19..2192075eb 100644 --- a/docs/utilities/fit-to/index.html +++ b/docs/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to Height / Width | Touying - + diff --git a/docs/utilities/oop/index.html b/docs/utilities/oop/index.html index ec7ecd876..60f3a36e6 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 b1bc9fbcf..ef5bd346d 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 d78cb3eec..e16d9b710 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 d704b6921..df94ad43b 100644 --- a/zh/404.html +++ b/zh/404.html @@ -5,7 +5,7 @@ 找不到页面 | Touying - + diff --git a/zh/assets/js/20f452e9.e3e69eea.js b/zh/assets/js/20f452e9.325ef419.js similarity index 98% rename from zh/assets/js/20f452e9.e3e69eea.js rename to zh/assets/js/20f452e9.325ef419.js index 341d79c4f..8afdf74ba 100644 --- a/zh/assets/js/20f452e9.e3e69eea.js +++ b/zh/assets/js/20f452e9.325ef419.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3843],{6135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var i=t(5893),r=t(1151);const s={sidebar_position:5},o="\u5176\u4ed6\u52a8\u753b",c={id:"dynamic/other",title:"\u5176\u4ed6\u52a8\u753b",description:"Touying \u8fd8\u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/zh/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover \u51fd\u6570",permalink:"/touying/zh/docs/next/dynamic/cover"},next:{title:"\u521b\u5efa\u8bb2\u4e49",permalink:"/touying/zh/docs/next/dynamic/handout"}},d={},l=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"only \u4e0e uncover",id:"only-\u4e0e-uncover",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u5176\u4ed6\u52a8\u753b",children:"\u5176\u4ed6\u52a8\u753b"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u8fd8\u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-\u4e0e-uncover",children:"only \u4e0e uncover"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 cetz \u5185\u90e8\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"only"})," \u548c ",(0,i.jsx)(n.code,{children:"uncover"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3843],{6135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var i=t(5893),r=t(1151);const s={sidebar_position:5},o="\u5176\u4ed6\u52a8\u753b",c={id:"dynamic/other",title:"\u5176\u4ed6\u52a8\u753b",description:"Touying \u8fd8\u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/dynamic/other.md",sourceDirName:"dynamic",slug:"/dynamic/other",permalink:"/touying/zh/docs/next/dynamic/other",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/dynamic/other.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Cover \u51fd\u6570",permalink:"/touying/zh/docs/next/dynamic/cover"},next:{title:"\u521b\u5efa\u8bb2\u4e49",permalink:"/touying/zh/docs/next/dynamic/handout"}},d={},l=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"only \u4e0e uncover",id:"only-\u4e0e-uncover",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u5176\u4ed6\u52a8\u753b",children:"\u5176\u4ed6\u52a8\u753b"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u8fd8\u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-\u4e0e-uncover",children:"only \u4e0e uncover"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 cetz \u5185\u90e8\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"only"})," \u548c ",(0,i.jsx)(n.code,{children:"uncover"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/24f6044e.c0a225e3.js b/zh/assets/js/24f6044e.a1e6abc1.js similarity index 98% rename from zh/assets/js/24f6044e.c0a225e3.js rename to zh/assets/js/24f6044e.a1e6abc1.js index 9ec979299..0b2ab7e82 100644 --- a/zh/assets/js/24f6044e.c0a225e3.js +++ b/zh/assets/js/24f6044e.a1e6abc1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8993],{1660:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>c,default:()=>a,frontMatter:()=>p,metadata:()=>o,toc:()=>r});var s=t(5893),d=t(1151);const p={sidebar_position:1},c="pdfpc",o={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',source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/zh/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/zh/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/zh/docs/next/external/pympress"}},i={},r=[{value:"\u52a0\u5165 Metadata",id:"\u52a0\u5165-metadata",level:2},{value:"pdfpc \u914d\u7f6e",id:"pdfpc-\u914d\u7f6e",level:2},{value:"\u8f93\u51fa .pdfpc \u6587\u4ef6",id:"\u8f93\u51fa-pdfpc-\u6587\u4ef6",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,d.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"pdfpc",children:"pdfpc"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"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']}),"\n",(0,s.jsxs)(n.p,{children:["pdfpc \u6709\u4e00\u4e2a JSON \u683c\u5f0f\u7684 ",(0,s.jsx)(n.code,{children:".pdfpc"})," \u6587\u4ef6\uff0c\u5b83\u53ef\u4ee5\u4e3a PDF slides \u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\u3002\u867d\u7136\u60a8\u53ef\u4ee5\u624b\u52a8\u7f16\u5199\u5b83\uff0c\u4f46\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7 Touying \u6765\u7ba1\u7406\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u52a0\u5165-metadata",children:"\u52a0\u5165 Metadata"}),"\n",(0,s.jsxs)(n.p,{children:["Touying \u4e0e ",(0,s.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," \u4fdd\u6301\u4e00\u81f4\uff0c\u4ee5\u907f\u514d API \u4e4b\u95f4\u7684\u51b2\u7a81\u3002"]}),"\n",(0,s.jsxs)(n.p,{children:["\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,s.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'})," \u52a0\u5165 notes\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"pdfpc-\u914d\u7f6e",children:"pdfpc \u914d\u7f6e"}),"\n",(0,s.jsx)(n.p,{children:"\u4e3a\u4e86\u52a0\u5165 pdfpc \u914d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,s.jsxs)(n.p,{children:["\u52a0\u5165\u5bf9\u5e94\u7684\u914d\u7f6e\uff0c\u5177\u4f53\u914d\u7f6e\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,s.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"}),"\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u8f93\u51fa-pdfpc-\u6587\u4ef6",children:"\u8f93\u51fa .pdfpc \u6587\u4ef6"}),"\n",(0,s.jsxs)(n.p,{children:["\u5047\u8bbe\u4f60\u7684\u6587\u6863\u4e3a ",(0,s.jsx)(n.code,{children:"./example.typ"}),"\uff0c\u5219\u4f60\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,s.jsxs)(n.p,{children:["\u76f4\u63a5\u5bfc\u51fa ",(0,s.jsx)(n.code,{children:".pdfpc"})," \u6587\u4ef6\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u501f\u52a9 Touying \u4e0e Polylux \u7684\u517c\u5bb9\u6027\uff0c\u4f60\u53ef\u4ee5\u8ba9 Polylux \u4e5f\u652f\u6301\u76f4\u63a5\u5bfc\u51fa\uff0c\u53ea\u9700\u8981\u52a0\u5165\u4e0b\u9762\u7684\u4ee3\u7801\u5373\u53ef\u3002"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'#import "@preview/touying:0.4.0"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function a(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>o,a:()=>c});var s=t(7294);const d={},p=s.createContext(d);function c(e){const n=s.useContext(p);return s.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(d):e.components||d:c(e.components),s.createElement(p.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8993],{1660:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>c,default:()=>a,frontMatter:()=>p,metadata:()=>o,toc:()=>r});var s=t(5893),d=t(1151);const p={sidebar_position:1},c="pdfpc",o={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',source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/external/pdfpc.md",sourceDirName:"external",slug:"/external/pdfpc",permalink:"/touying/zh/docs/next/external/pdfpc",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pdfpc.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"External Tools",permalink:"/touying/zh/docs/next/category/external-tools"},next:{title:"Pympress",permalink:"/touying/zh/docs/next/external/pympress"}},i={},r=[{value:"\u52a0\u5165 Metadata",id:"\u52a0\u5165-metadata",level:2},{value:"pdfpc \u914d\u7f6e",id:"pdfpc-\u914d\u7f6e",level:2},{value:"\u8f93\u51fa .pdfpc \u6587\u4ef6",id:"\u8f93\u51fa-pdfpc-\u6587\u4ef6",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,d.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"pdfpc",children:"pdfpc"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{href:"https://pdfpc.github.io/",children:"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']}),"\n",(0,s.jsxs)(n.p,{children:["pdfpc \u6709\u4e00\u4e2a JSON \u683c\u5f0f\u7684 ",(0,s.jsx)(n.code,{children:".pdfpc"})," \u6587\u4ef6\uff0c\u5b83\u53ef\u4ee5\u4e3a PDF slides \u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\u3002\u867d\u7136\u60a8\u53ef\u4ee5\u624b\u52a8\u7f16\u5199\u5b83\uff0c\u4f46\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7 Touying \u6765\u7ba1\u7406\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u52a0\u5165-metadata",children:"\u52a0\u5165 Metadata"}),"\n",(0,s.jsxs)(n.p,{children:["Touying \u4e0e ",(0,s.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"})," \u4fdd\u6301\u4e00\u81f4\uff0c\u4ee5\u907f\u514d API \u4e4b\u95f4\u7684\u51b2\u7a81\u3002"]}),"\n",(0,s.jsxs)(n.p,{children:["\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 ",(0,s.jsx)(n.code,{children:'#pdfpc.speaker-note("This is a note that only the speaker will see.")'})," \u52a0\u5165 notes\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"pdfpc-\u914d\u7f6e",children:"pdfpc \u914d\u7f6e"}),"\n",(0,s.jsx)(n.p,{children:"\u4e3a\u4e86\u52a0\u5165 pdfpc \u914d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})}),"\n",(0,s.jsxs)(n.p,{children:["\u52a0\u5165\u5bf9\u5e94\u7684\u914d\u7f6e\uff0c\u5177\u4f53\u914d\u7f6e\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003 ",(0,s.jsx)(n.a,{href:"https://polylux.dev/book/external/pdfpc.html",children:"Polylux"}),"\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u8f93\u51fa-pdfpc-\u6587\u4ef6",children:"\u8f93\u51fa .pdfpc \u6587\u4ef6"}),"\n",(0,s.jsxs)(n.p,{children:["\u5047\u8bbe\u4f60\u7684\u6587\u6863\u4e3a ",(0,s.jsx)(n.code,{children:"./example.typ"}),"\uff0c\u5219\u4f60\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n'})}),"\n",(0,s.jsxs)(n.p,{children:["\u76f4\u63a5\u5bfc\u51fa ",(0,s.jsx)(n.code,{children:".pdfpc"})," \u6587\u4ef6\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u501f\u52a9 Touying \u4e0e Polylux \u7684\u517c\u5bb9\u6027\uff0c\u4f60\u53ef\u4ee5\u8ba9 Polylux \u4e5f\u652f\u6301\u76f4\u63a5\u5bfc\u51fa\uff0c\u53ea\u9700\u8981\u52a0\u5165\u4e0b\u9762\u7684\u4ee3\u7801\u5373\u53ef\u3002"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:'#import "@preview/touying:0.4.1"\n\n#locate(loc => touying.pdfpc.pdfpc-file(loc))\n'})})]})}function a(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>o,a:()=>c});var s=t(7294);const d={},p=s.createContext(d);function c(e){const n=s.useContext(p);return s.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(d):e.components||d:c(e.components),s.createElement(p.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/2e03f7f4.db446fe7.js b/zh/assets/js/2e03f7f4.fb84fa15.js similarity index 97% rename from zh/assets/js/2e03f7f4.db446fe7.js rename to zh/assets/js/2e03f7f4.fb84fa15.js index 0c371e470..a41ea1ba7 100644 --- a/zh/assets/js/2e03f7f4.db446fe7.js +++ b/zh/assets/js/2e03f7f4.fb84fa15.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3440],{5694:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>d,default:()=>u,frontMatter:()=>t,metadata:()=>o,toc:()=>r});var i=n(5893),l=n(1151);const t={sidebar_position:4},d="\u4ee3\u7801\u98ce\u683c",o={id:"code-styles",title:"\u4ee3\u7801\u98ce\u683c",description:"\u7b80\u5355\u98ce\u683c",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/zh/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\u8282\u4e0e\u5c0f\u8282",permalink:"/touying/zh/docs/next/sections"},next:{title:"\u9875\u9762\u5e03\u5c40",permalink:"/touying/zh/docs/next/layout"}},c={},r=[{value:"\u7b80\u5355\u98ce\u683c",id:"\u7b80\u5355\u98ce\u683c",level:2},{value:"\u5757\u98ce\u683c",id:"\u5757\u98ce\u683c",level:2},{value:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",id:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",level:2}];function h(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"\u4ee3\u7801\u98ce\u683c",children:"\u4ee3\u7801\u98ce\u683c"}),"\n",(0,i.jsx)(s.h2,{id:"\u7b80\u5355\u98ce\u683c",children:"\u7b80\u5355\u98ce\u683c"}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u6211\u4eec\u53ea\u662f\u9700\u8981\u7b80\u5355\u4f7f\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u6807\u9898\u4e0b\u8f93\u5165\u5185\u5bb9\uff0c\u5c31\u50cf\u662f\u5728\u7f16\u5199\u6b63\u5e38 Typst \u6587\u6863\u4e00\u6837\u3002\u8fd9\u91cc\u7684\u6807\u9898\u6709\u7740\u5206\u5272\u9875\u9762\u7684\u4f5c\u7528\uff0c\u540c\u65f6\u6211\u4eec\u4e5f\u80fd\u6b63\u5e38\u5730\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#pause"})," \u7b49\u547d\u4ee4\u5b9e\u73b0\u52a8\u753b\u6548\u679c\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u4f60\u53ef\u4ee5\u4f7f\u7528\u7a7a\u6807\u9898 ",(0,i.jsx)(s.code,{children:"=="})," \u521b\u5efa\u4e00\u4e2a\u65b0\u9875\uff0c\u8fd9\u4e2a\u6280\u5de7\u4e5f\u6709\u52a9\u4e8e\u6e05\u9664\u4e0a\u4e00\u4e2a\u6807\u9898\u7684\u7ee7\u7eed\u5e94\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["PS\uff1a\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slides-end"})," \u8bb0\u53f7\u6765\u6807\u5fd7 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u7684\u7ed3\u675f\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u5757\u98ce\u683c",children:"\u5757\u98ce\u683c"}),"\n",(0,i.jsxs)(s.p,{children:["\u5f88\u591a\u65f6\u5019\uff0c\u4ec5\u4ec5\u4f7f\u7528\u7b80\u5355\u98ce\u683c\u5e76\u4e0d\u80fd\u5b9e\u73b0\u6211\u4eec\u9700\u8981\u7684\u6240\u6709\u529f\u80fd\uff0c\u4e3a\u4e86\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u548c\u66f4\u6e05\u6670\u7684\u7ed3\u6784\uff0c\u6211\u4eec\u540c\u6837\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u5f62\u5f0f\u7684\u5757\u98ce\u683c\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"#slide"})," \u51fd\u6570\u9700\u8981\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u8bed\u6cd5\u8fdb\u884c\u89e3\u5305\uff0c\u624d\u80fd\u6b63\u5e38\u5728 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u540e\u4f7f\u7528\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u4f8b\u5982\u4e0a\u9762\u7684\u4f8b\u5b50\u5c31\u53ef\u4ee5\u6539\u9020\u6210"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," \u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u6ca1\u6709 header \u548c footer \u7684\u7a7a Slide\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u6837\u505a\u7684\u597d\u5904\u6709\u5f88\u591a\uff1a"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\u5f88\u591a\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u53ea\u662f\u9700\u8981\u9ed8\u8ba4\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"}),"\uff0c\u8fd8\u9700\u8981 ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," \u8fd9\u4e9b\u7279\u6b8a\u7684 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u4e0d\u540c\u4e3b\u9898\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u51fd\u6570\u53ef\u80fd\u6709\u6bd4\u9ed8\u8ba4\u66f4\u591a\u7684\u53c2\u6570\uff0c\u4f8b\u5982 university \u4e3b\u9898\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u51fd\u6570\u5c31\u4f1a\u6709\u7740 ",(0,i.jsx)(s.code,{children:"subtitle"})," \u53c2\u6570\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u53ea\u6709 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\u624d\u53ef\u4ee5\u901a\u8fc7\u56de\u8c03\u98ce\u683c\u7684\u5185\u5bb9\u5757\u6765\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#only"})," \u548c ",(0,i.jsx)(s.code,{children:"#uncover"})," \u51fd\u6570\u5b9e\u73b0\u590d\u6742\u7684\u52a8\u753b\u6548\u679c\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u80fd\u6709\u7740\u66f4\u6e05\u6670\u7684\u7ed3\u6784\uff0c\u901a\u8fc7\u8fa8\u522b ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5206\u8fa8\u51fa slides \u7684\u5177\u4f53\u5206\u9875\u6548\u679c\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",children:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e"}),"\n",(0,i.jsxs)(s.p,{children:["\u4f60\u53ef\u80fd\u6ce8\u610f\u5230\u4e86\uff0c\u5728\u4f7f\u7528 simple \u4e3b\u9898\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u4e00\u7ea7\u6807\u9898\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a section slide\uff0c\u8fd9\u662f\u56e0\u4e3a simple \u4e3b\u9898\u6ce8\u518c\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," \u65b9\u6cd5\uff0c\u56e0\u6b64 touying \u4f1a\u9ed8\u8ba4\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u6211\u4eec\u4e0d\u5e0c\u671b\u5b83\u81ea\u52a8\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a section slide\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u65b9\u6cd5\u5220\u9664\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u4f60\u6240\u89c1\uff0c\u8fd9\u6837\u5c31\u53ea\u4f1a\u5269\u4e0b\u4e24\u9875\uff0c\u800c\u9ed8\u8ba4\u7684 section slide \u5c31\u4f1a\u6d88\u5931\u4e86\u3002"}),"\n",(0,i.jsx)(s.p,{children:"\u540c\u7406\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u6ce8\u518c\u4e00\u4e2a\u65b0\u7684 section slide\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["\u540c\u6837\u5730\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4fee\u6539 ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," \u6765\u5bf9 ",(0,i.jsx)(s.code,{children:"subsection"})," \u505a\u540c\u6837\u7684\u4e8b\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u9664\u4e86 ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),"\uff0c\u53e6\u4e00\u4e2a\u7279\u6b8a\u7684 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\u5c31\u662f ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," \u51fd\u6570\uff0c\u5b83\u4f1a\u5728\u7b80\u5355\u98ce\u683c\u91cc\u6ca1\u6709\u663e\u793a\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u7684\u60c5\u51b5\u4e0b\u9ed8\u8ba4\u88ab\u8c03\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u540c\u65f6\uff0c\u7531\u4e8e ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u88ab\u6ce8\u518c\u5728\u4e86 ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'})," \u91cc\uff0c\u56e0\u6b64 ",(0,i.jsx)(s.code,{children:"section"}),"\uff0c",(0,i.jsx)(s.code,{children:"subsection"})," \u548c ",(0,i.jsx)(s.code,{children:"title"})," \u53c2\u6570\u4f1a\u88ab\u81ea\u52a8\u4f20\u5165\uff0c\u800c\u5176\u4ed6\u7684\u5982 ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," \u5219\u4e0d\u4f1a\u81ea\u52a8\u4f20\u5165\u8fd9\u4e09\u4e2a\u53c2\u6570\u3002"]}),"\n",(0,i.jsxs)(s.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,i.jsxs)(s.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e0d\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u548c ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),"\uff0c\u800c\u662f\u53ea\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),"\uff0c\u4f8b\u5982"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["\u8fd9\u65f6\u5019\u9700\u8981\u624b\u52a8\u4f20\u5165 ",(0,i.jsx)(s.code,{children:"section"}),"\u3001",(0,i.jsx)(s.code,{children:"subsection"})," \u548c ",(0,i.jsx)(s.code,{children:"title"}),"\uff0c\u4f46\u662f\u4f1a\u6709\u66f4\u597d\u7684\u6027\u80fd\uff0c\u9002\u5408\u9700\u8981\u66f4\u5feb\u7684\u6027\u80fd\u7684\u60c5\u51b5\uff0c\u4f8b\u5982\u8d85\u8fc7\u6570\u5341\u6570\u767e\u9875\u7684\u60c5\u5f62\u3002"]})]})]})}function u(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>o,a:()=>d});var i=n(7294);const l={},t=i.createContext(l);function d(e){const s=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:d(e.components),i.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3440],{5694:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>d,default:()=>u,frontMatter:()=>t,metadata:()=>o,toc:()=>r});var i=n(5893),l=n(1151);const t={sidebar_position:4},d="\u4ee3\u7801\u98ce\u683c",o={id:"code-styles",title:"\u4ee3\u7801\u98ce\u683c",description:"\u7b80\u5355\u98ce\u683c",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/code-styles.md",sourceDirName:".",slug:"/code-styles",permalink:"/touying/zh/docs/next/code-styles",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/code-styles.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\u8282\u4e0e\u5c0f\u8282",permalink:"/touying/zh/docs/next/sections"},next:{title:"\u9875\u9762\u5e03\u5c40",permalink:"/touying/zh/docs/next/layout"}},c={},r=[{value:"\u7b80\u5355\u98ce\u683c",id:"\u7b80\u5355\u98ce\u683c",level:2},{value:"\u5757\u98ce\u683c",id:"\u5757\u98ce\u683c",level:2},{value:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",id:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",level:2}];function h(e){const s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"\u4ee3\u7801\u98ce\u683c",children:"\u4ee3\u7801\u98ce\u683c"}),"\n",(0,i.jsx)(s.h2,{id:"\u7b80\u5355\u98ce\u683c",children:"\u7b80\u5355\u98ce\u683c"}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u6211\u4eec\u53ea\u662f\u9700\u8981\u7b80\u5355\u4f7f\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u6807\u9898\u4e0b\u8f93\u5165\u5185\u5bb9\uff0c\u5c31\u50cf\u662f\u5728\u7f16\u5199\u6b63\u5e38 Typst \u6587\u6863\u4e00\u6837\u3002\u8fd9\u91cc\u7684\u6807\u9898\u6709\u7740\u5206\u5272\u9875\u9762\u7684\u4f5c\u7528\uff0c\u540c\u65f6\u6211\u4eec\u4e5f\u80fd\u6b63\u5e38\u5730\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#pause"})," \u7b49\u547d\u4ee4\u5b9e\u73b0\u52a8\u753b\u6548\u679c\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u4f60\u53ef\u4ee5\u4f7f\u7528\u7a7a\u6807\u9898 ",(0,i.jsx)(s.code,{children:"=="})," \u521b\u5efa\u4e00\u4e2a\u65b0\u9875\uff0c\u8fd9\u4e2a\u6280\u5de7\u4e5f\u6709\u52a9\u4e8e\u6e05\u9664\u4e0a\u4e00\u4e2a\u6807\u9898\u7684\u7ee7\u7eed\u5e94\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["PS\uff1a\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slides-end"})," \u8bb0\u53f7\u6765\u6807\u5fd7 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u7684\u7ed3\u675f\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u5757\u98ce\u683c",children:"\u5757\u98ce\u683c"}),"\n",(0,i.jsxs)(s.p,{children:["\u5f88\u591a\u65f6\u5019\uff0c\u4ec5\u4ec5\u4f7f\u7528\u7b80\u5355\u98ce\u683c\u5e76\u4e0d\u80fd\u5b9e\u73b0\u6211\u4eec\u9700\u8981\u7684\u6240\u6709\u529f\u80fd\uff0c\u4e3a\u4e86\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u548c\u66f4\u6e05\u6670\u7684\u7ed3\u6784\uff0c\u6211\u4eec\u540c\u6837\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u5f62\u5f0f\u7684\u5757\u98ce\u683c\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"#slide"})," \u51fd\u6570\u9700\u8981\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u8bed\u6cd5\u8fdb\u884c\u89e3\u5305\uff0c\u624d\u80fd\u6b63\u5e38\u5728 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u540e\u4f7f\u7528\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u4f8b\u5982\u4e0a\u9762\u7684\u4f8b\u5b50\u5c31\u53ef\u4ee5\u6539\u9020\u6210"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\n#slide[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca ",(0,i.jsx)(s.code,{children:"#empty-slide[]"})," \u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u6ca1\u6709 header \u548c footer \u7684\u7a7a Slide\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u6837\u505a\u7684\u597d\u5904\u6709\u5f88\u591a\uff1a"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\u5f88\u591a\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u53ea\u662f\u9700\u8981\u9ed8\u8ba4\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"}),"\uff0c\u8fd8\u9700\u8981 ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," \u8fd9\u4e9b\u7279\u6b8a\u7684 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u4e0d\u540c\u4e3b\u9898\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u51fd\u6570\u53ef\u80fd\u6709\u6bd4\u9ed8\u8ba4\u66f4\u591a\u7684\u53c2\u6570\uff0c\u4f8b\u5982 university \u4e3b\u9898\u7684 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u51fd\u6570\u5c31\u4f1a\u6709\u7740 ",(0,i.jsx)(s.code,{children:"subtitle"})," \u53c2\u6570\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u53ea\u6709 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\u624d\u53ef\u4ee5\u901a\u8fc7\u56de\u8c03\u98ce\u683c\u7684\u5185\u5bb9\u5757\u6765\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#only"})," \u548c ",(0,i.jsx)(s.code,{children:"#uncover"})," \u51fd\u6570\u5b9e\u73b0\u590d\u6742\u7684\u52a8\u753b\u6548\u679c\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u80fd\u6709\u7740\u66f4\u6e05\u6670\u7684\u7ed3\u6784\uff0c\u901a\u8fc7\u8fa8\u522b ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5206\u8fa8\u51fa slides \u7684\u5177\u4f53\u5206\u9875\u6548\u679c\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e",children:"\u7ea6\u5b9a\u4f18\u4e8e\u914d\u7f6e"}),"\n",(0,i.jsxs)(s.p,{children:["\u4f60\u53ef\u80fd\u6ce8\u610f\u5230\u4e86\uff0c\u5728\u4f7f\u7528 simple \u4e3b\u9898\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u4e00\u7ea7\u6807\u9898\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a section slide\uff0c\u8fd9\u662f\u56e0\u4e3a simple \u4e3b\u9898\u6ce8\u518c\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"})," \u65b9\u6cd5\uff0c\u56e0\u6b64 touying \u4f1a\u9ed8\u8ba4\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u6211\u4eec\u4e0d\u5e0c\u671b\u5b83\u81ea\u52a8\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a section slide\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u65b9\u6cd5\u5220\u9664\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = none)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/17a89a59-9491-4e1f-95c0-09a22105ab35",alt:"image"})}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u4f60\u6240\u89c1\uff0c\u8fd9\u6837\u5c31\u53ea\u4f1a\u5269\u4e0b\u4e24\u9875\uff0c\u800c\u9ed8\u8ba4\u7684 section slide \u5c31\u4f1a\u6d88\u5931\u4e86\u3002"}),"\n",(0,i.jsx)(s.p,{children:"\u540c\u7406\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u6ce8\u518c\u4e00\u4e2a\u65b0\u7684 section slide\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {\n self = utils.empty-page(self)\n (s.methods.touying-slide)(self: self, section: section, {\n set align(center + horizon)\n set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")\n section\n }, ..args)\n})\n#let (init, slides, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5305efda-0cd4-42eb-9f2e-89abc30b6ca2",alt:"image"})}),"\n",(0,i.jsxs)(s.p,{children:["\u540c\u6837\u5730\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4fee\u6539 ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-subsection-slide"})," \u6765\u5bf9 ",(0,i.jsx)(s.code,{children:"subsection"})," \u505a\u540c\u6837\u7684\u4e8b\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u9664\u4e86 ",(0,i.jsx)(s.code,{children:"s.methods.touying-new-section-slide"}),"\uff0c\u53e6\u4e00\u4e2a\u7279\u6b8a\u7684 ",(0,i.jsx)(s.code,{children:"slide"})," \u51fd\u6570\u5c31\u662f ",(0,i.jsx)(s.code,{children:"s.methods.slide"})," \u51fd\u6570\uff0c\u5b83\u4f1a\u5728\u7b80\u5355\u98ce\u683c\u91cc\u6ca1\u6709\u663e\u793a\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u7684\u60c5\u51b5\u4e0b\u9ed8\u8ba4\u88ab\u8c03\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u540c\u65f6\uff0c\u7531\u4e8e ",(0,i.jsx)(s.code,{children:"#slide[...]"})," \u88ab\u6ce8\u518c\u5728\u4e86 ",(0,i.jsx)(s.code,{children:'s.slides = ("slide",)'})," \u91cc\uff0c\u56e0\u6b64 ",(0,i.jsx)(s.code,{children:"section"}),"\uff0c",(0,i.jsx)(s.code,{children:"subsection"})," \u548c ",(0,i.jsx)(s.code,{children:"title"})," \u53c2\u6570\u4f1a\u88ab\u81ea\u52a8\u4f20\u5165\uff0c\u800c\u5176\u4ed6\u7684\u5982 ",(0,i.jsx)(s.code,{children:"#focus-slide[...]"})," \u5219\u4e0d\u4f1a\u81ea\u52a8\u4f20\u5165\u8fd9\u4e09\u4e2a\u53c2\u6570\u3002"]}),"\n",(0,i.jsxs)(s.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,i.jsxs)(s.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e0d\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u548c ",(0,i.jsx)(s.code,{children:"utils.slides(s)"}),"\uff0c\u800c\u662f\u53ea\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"utils.methods(s)"}),"\uff0c\u4f8b\u5982"]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, touying-outline, slide) = utils.methods(s)\n#show: init\n\n#slide(section: [Title], title: [First Slide])[\n Hello, Touying!\n\n #pause\n\n Hello, Typst!\n]\n'})}),(0,i.jsxs)(s.p,{children:["\u8fd9\u65f6\u5019\u9700\u8981\u624b\u52a8\u4f20\u5165 ",(0,i.jsx)(s.code,{children:"section"}),"\u3001",(0,i.jsx)(s.code,{children:"subsection"})," \u548c ",(0,i.jsx)(s.code,{children:"title"}),"\uff0c\u4f46\u662f\u4f1a\u6709\u66f4\u597d\u7684\u6027\u80fd\uff0c\u9002\u5408\u9700\u8981\u66f4\u5feb\u7684\u6027\u80fd\u7684\u60c5\u51b5\uff0c\u4f8b\u5982\u8d85\u8fc7\u6570\u5341\u6570\u767e\u9875\u7684\u60c5\u5f62\u3002"]})]})]})}function u(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>o,a:()=>d});var i=n(7294);const l={},t=i.createContext(l);function d(e){const s=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:d(e.components),i.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/339ee8e1.1ca78cd1.js b/zh/assets/js/339ee8e1.ed73a73c.js similarity index 98% rename from zh/assets/js/339ee8e1.1ca78cd1.js rename to zh/assets/js/339ee8e1.ed73a73c.js index 201d9fc2f..962654c57 100644 --- a/zh/assets/js/339ee8e1.1ca78cd1.js +++ b/zh/assets/js/339ee8e1.ed73a73c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5329],{607:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>a,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/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/simple"},next:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/next/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 h(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/383ceb22-f696-4450-83a6-c0f17e4597e1",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.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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)[\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,t.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,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.4.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function a(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(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([[5329],{607:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>a,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/next/themes/metropolis",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/metropolis.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Simple \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/simple"},next:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/next/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 h(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/383ceb22-f696-4450-83a6-c0f17e4597e1",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.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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)[\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,t.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,t.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slide, slides, title-slide, new-section-slide, focus-slide, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,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.4.1": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n#slide[\n A slide without a title but with some *important* information.\n]\n\n== A long long long long long long long long long long long long long long long long long long long long long long long long Title\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n\n #lorem(200)\n]\n\n= Second Section\n\n#focus-slide[\n Wake up!\n]\n\n== Simple Animation\n\n#slide[\n A simple #pause dynamic slide with #alert[alert]\n\n #pause\n \n text.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n#slide[\n Appendix.\n]\n'})})]})}function a(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(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/4c00a561.5599e7c7.js b/zh/assets/js/4c00a561.cd87c5af.js similarity index 99% rename from zh/assets/js/4c00a561.5599e7c7.js rename to zh/assets/js/4c00a561.cd87c5af.js index 49ecc17d6..67589f072 100644 --- a/zh/assets/js/4c00a561.5599e7c7.js +++ b/zh/assets/js/4c00a561.cd87c5af.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5850],{8714:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var t=s(5893),i=s(1151);const l={sidebar_position:6},o="\u5168\u5c40\u8bbe\u7f6e",d={id:"global-settings",title:"\u5168\u5c40\u8bbe\u7f6e",description:"\u5168\u5c40\u6837\u5f0f",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/zh/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\u9875\u9762\u5e03\u5c40",permalink:"/touying/zh/docs/next/layout"},next:{title:"\u591a\u6587\u4ef6\u67b6\u6784",permalink:"/touying/zh/docs/next/multi-file"}},r={},c=[{value:"\u5168\u5c40\u6837\u5f0f",id:"\u5168\u5c40\u6837\u5f0f",level:2},{value:"\u5168\u5c40\u4fe1\u606f",id:"\u5168\u5c40\u4fe1\u606f",level:2},{value:"\u72b6\u6001\u521d\u59cb\u5316",id:"\u72b6\u6001\u521d\u59cb\u5316",level:2}];function a(e){const n={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:"\u5168\u5c40\u8bbe\u7f6e",children:"\u5168\u5c40\u8bbe\u7f6e"}),"\n",(0,t.jsx)(n.h2,{id:"\u5168\u5c40\u6837\u5f0f",children:"\u5168\u5c40\u6837\u5f0f"}),"\n",(0,t.jsxs)(n.p,{children:["\u5bf9 Touying \u800c\u8a00\uff0c\u5168\u5c40\u6837\u5f0f\u5373\u4e3a\u9700\u8981\u5e94\u7528\u5230\u6240\u6709\u5730\u65b9\u7684 set rules \u6216 show rules\uff0c\u4f8b\u5982 ",(0,t.jsx)(n.code,{children:"#set text(size: 20pt)"}),"\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d\uff0cTouying \u7684\u4e3b\u9898\u4f1a\u5c01\u88c5\u4e00\u4e9b\u81ea\u5df1\u7684\u5168\u5c40\u6837\u5f0f\uff0c\u4ed6\u4eec\u4f1a\u88ab\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: init"})," \u4e2d\uff0c\u4f8b\u5982 university \u4e3b\u9898\u5c31\u5c01\u88c5\u4e86"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u5e76\u975e\u4e00\u4e2a\u4e3b\u9898\u5236\u4f5c\u8005\uff0c\u800c\u53ea\u662f\u60f3\u7ed9\u4f60\u7684 slides \u6dfb\u52a0\u4e00\u4e9b\u81ea\u5df1\u7684\u5168\u5c40\u6837\u5f0f\uff0c\u4f60\u53ef\u4ee5\u7b80\u5355\u5730\u5c06\u5b83\u4eec\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: init"})," \u4e4b\u540e\uff0c\u4ee5\u53ca ",(0,t.jsx)(n.code,{children:"#show: slides"})," \u4e4b\u524d\uff0c\u4f8b\u5982 metropolis \u4e3b\u9898\u5c31\u63a8\u8350\u4f60\u81ea\u884c\u52a0\u5165\u4ee5\u4e0b\u5168\u5c40\u6837\u5f0f\uff1a"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["\u4f46\u662f\u6ce8\u610f\uff0c\u4f60\u4e0d\u5e94\u8be5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"#set page(..)"}),"\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,t.jsx)(n.code,{children:"s.page-args"})," \u548c ",(0,t.jsx)(n.code,{children:"s.padding"}),"\uff0c\u4f8b\u5982"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u5168\u5c40\u4fe1\u606f",children:"\u5168\u5c40\u4fe1\u606f"}),"\n",(0,t.jsx)(n.p,{children:"\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u901a\u8fc7 OOP \u98ce\u683c\u7684\u7edf\u4e00 API \u8bbe\u8ba1\uff0c\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u8ba9\u60a8\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u5207\u6362\uff0c\u5168\u5c40\u4fe1\u606f\u5c31\u662f\u4e00\u4e2a\u5f88\u5178\u578b\u7684\u4f8b\u5b50\u3002"}),"\n",(0,t.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.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,t.jsxs)(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\u5728\u540e\u7eed\uff0c\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"s.info"})," \u6216 ",(0,t.jsx)(n.code,{children:"self.info"})," \u8fd9\u6837\u7684\u65b9\u5f0f\u8bbf\u95ee\u5b83\u4eec\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u8fd9\u4e9b\u4fe1\u606f\u4e00\u822c\u4f1a\u5728\u4e3b\u9898\u7684 ",(0,t.jsx)(n.code,{children:"title-slide"}),"\u3001",(0,t.jsx)(n.code,{children:"header"})," \u548c ",(0,t.jsx)(n.code,{children:"footer"})," \u88ab\u4f7f\u7528\u5230\uff0c\u4f8b\u5982 ",(0,t.jsx)(n.code,{children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)'}),"\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"date"})," \u53ef\u4ee5\u63a5\u6536 ",(0,t.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u548c ",(0,t.jsx)(n.code,{children:"content"})," \u683c\u5f0f\uff0c\u5e76\u4e14 ",(0,t.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u7684\u65e5\u671f\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,t.jsx)(n.p,{children:"\u7684\u65b9\u5f0f\u66f4\u6539\u3002"}),"\n",(0,t.jsxs)(n.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,t.jsx)(n.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f1a\u7a0d\u5fae\u5f15\u5165\u4e00\u70b9 Touying \u7684 OOP \u6982\u5ff5\u3002"}),(0,t.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,t.jsx)(n.code,{children:"state"})," \u6216 ",(0,t.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u9700\u8981\u4f7f\u7528 ",(0,t.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,t.jsxs)(n.p,{children:["Touying \u5e76\u6ca1\u6709\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"state"})," \u548c ",(0,t.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,t.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,t.jsx)(n.code,{children:"self"})," \u7528\u4e8e\u4f20\u5165\u5bf9\u8c61\u81ea\u8eab\uff0c\u5e76\u4e14\u65b9\u6cd5\u5747\u653e\u5728 ",(0,t.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,t.jsx)(n.code,{children:"info"})," \u7684\u65b9\u6cd5\u4e86\uff1a"]}),(0,t.jsx)(n.pre,{children:(0,t.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,t.jsxs)(n.p,{children:["\u8fd9\u6837\uff0c\u4f60\u4e5f\u80fd\u591f\u7406\u89e3 ",(0,t.jsx)(n.code,{children:"utils.methods()"})," \u51fd\u6570\u7684\u7528\u9014\u4e86\uff1a\u5c06 ",(0,t.jsx)(n.code,{children:"self"})," \u7ed1\u5b9a\u5230 ",(0,t.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,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,t.jsx)(n.h2,{id:"\u72b6\u6001\u521d\u59cb\u5316",children:"\u72b6\u6001\u521d\u59cb\u5316"}),"\n",(0,t.jsxs)(n.p,{children:["\u4e00\u822c\u800c\u8a00\uff0c\u4e0a\u9762\u7684\u4e24\u79cd\u65b9\u5f0f\u5c31\u5df2\u7ecf\u8db3\u591f\u7528\u4e8e\u52a0\u5165\u5168\u5c40\u8bbe\u7f6e\u4e86\uff0c\u4f46\u662f\u4ecd\u7136\u4f1a\u6709\u90e8\u5206\u60c5\u51b5\uff0c\u6211\u4eec\u9700\u8981\u521d\u59cb\u5316 counters \u6216 states\u3002\u5982\u679c\u5c06\u8fd9\u4e9b\u4ee3\u7801\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: slides"})," \u4e4b\u524d\uff0c\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u9875\uff0c\u8fd9\u662f\u6211\u4eec\u4e0d\u60f3\u770b\u89c1\u7684\uff0c\u56e0\u6b64\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"s.methods.append-preamble"})," \u65b9\u6cd5\u3002\u4f8b\u5982\u5728\u4f7f\u7528 codly \u5305\u7684\u65f6\u5019\uff1a"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,t.jsx)(n.p,{children:"\u53c8\u6216\u8005\u662f\u8fdb\u884c Pdfpc \u7684\u914d\u7f6e\u7684\u65f6\u5019\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper: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:()=>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 d(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([[5850],{8714:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var t=s(5893),i=s(1151);const l={sidebar_position:6},o="\u5168\u5c40\u8bbe\u7f6e",d={id:"global-settings",title:"\u5168\u5c40\u8bbe\u7f6e",description:"\u5168\u5c40\u6837\u5f0f",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/global-settings.md",sourceDirName:".",slug:"/global-settings",permalink:"/touying/zh/docs/next/global-settings",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/global-settings.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\u9875\u9762\u5e03\u5c40",permalink:"/touying/zh/docs/next/layout"},next:{title:"\u591a\u6587\u4ef6\u67b6\u6784",permalink:"/touying/zh/docs/next/multi-file"}},r={},c=[{value:"\u5168\u5c40\u6837\u5f0f",id:"\u5168\u5c40\u6837\u5f0f",level:2},{value:"\u5168\u5c40\u4fe1\u606f",id:"\u5168\u5c40\u4fe1\u606f",level:2},{value:"\u72b6\u6001\u521d\u59cb\u5316",id:"\u72b6\u6001\u521d\u59cb\u5316",level:2}];function a(e){const n={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:"\u5168\u5c40\u8bbe\u7f6e",children:"\u5168\u5c40\u8bbe\u7f6e"}),"\n",(0,t.jsx)(n.h2,{id:"\u5168\u5c40\u6837\u5f0f",children:"\u5168\u5c40\u6837\u5f0f"}),"\n",(0,t.jsxs)(n.p,{children:["\u5bf9 Touying \u800c\u8a00\uff0c\u5168\u5c40\u6837\u5f0f\u5373\u4e3a\u9700\u8981\u5e94\u7528\u5230\u6240\u6709\u5730\u65b9\u7684 set rules \u6216 show rules\uff0c\u4f8b\u5982 ",(0,t.jsx)(n.code,{children:"#set text(size: 20pt)"}),"\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d\uff0cTouying \u7684\u4e3b\u9898\u4f1a\u5c01\u88c5\u4e00\u4e9b\u81ea\u5df1\u7684\u5168\u5c40\u6837\u5f0f\uff0c\u4ed6\u4eec\u4f1a\u88ab\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: init"})," \u4e2d\uff0c\u4f8b\u5982 university \u4e3b\u9898\u5c31\u5c01\u88c5\u4e86"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"self.methods.init = (self: none, body) => {\n set text(size: 25pt)\n show footnote.entry: set text(size: .6em)\n body\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u5e76\u975e\u4e00\u4e2a\u4e3b\u9898\u5236\u4f5c\u8005\uff0c\u800c\u53ea\u662f\u60f3\u7ed9\u4f60\u7684 slides \u6dfb\u52a0\u4e00\u4e9b\u81ea\u5df1\u7684\u5168\u5c40\u6837\u5f0f\uff0c\u4f60\u53ef\u4ee5\u7b80\u5355\u5730\u5c06\u5b83\u4eec\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: init"})," \u4e4b\u540e\uff0c\u4ee5\u53ca ",(0,t.jsx)(n.code,{children:"#show: slides"})," \u4e4b\u524d\uff0c\u4f8b\u5982 metropolis \u4e3b\u9898\u5c31\u63a8\u8350\u4f60\u81ea\u884c\u52a0\u5165\u4ee5\u4e0b\u5168\u5c40\u6837\u5f0f\uff1a"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n// global styles\n#set text(font: "Fira Sans", weight: "light", size: 20pt)\n#show math.equation: set text(font: "Fira Math")\n#set strong(delta: 100)\n#set par(justify: true)\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,t.jsxs)(n.p,{children:["\u4f46\u662f\u6ce8\u610f\uff0c\u4f60\u4e0d\u5e94\u8be5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"#set page(..)"}),"\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,t.jsx)(n.code,{children:"s.page-args"})," \u548c ",(0,t.jsx)(n.code,{children:"s.padding"}),"\uff0c\u4f8b\u5982"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 0em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n#(s.padding += (x: 4em, y: 0em))\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u5168\u5c40\u4fe1\u606f",children:"\u5168\u5c40\u4fe1\u606f"}),"\n",(0,t.jsx)(n.p,{children:"\u5c31\u50cf Beamer \u4e00\u6837\uff0cTouying \u901a\u8fc7 OOP \u98ce\u683c\u7684\u7edf\u4e00 API \u8bbe\u8ba1\uff0c\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7ef4\u62a4\u5168\u5c40\u4fe1\u606f\uff0c\u8ba9\u60a8\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u5207\u6362\uff0c\u5168\u5c40\u4fe1\u606f\u5c31\u662f\u4e00\u4e2a\u5f88\u5178\u578b\u7684\u4f8b\u5b50\u3002"}),"\n",(0,t.jsx)(n.p,{children:"\u4f60\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.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,t.jsxs)(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\u5728\u540e\u7eed\uff0c\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 ",(0,t.jsx)(n.code,{children:"s.info"})," \u6216 ",(0,t.jsx)(n.code,{children:"self.info"})," \u8fd9\u6837\u7684\u65b9\u5f0f\u8bbf\u95ee\u5b83\u4eec\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u8fd9\u4e9b\u4fe1\u606f\u4e00\u822c\u4f1a\u5728\u4e3b\u9898\u7684 ",(0,t.jsx)(n.code,{children:"title-slide"}),"\u3001",(0,t.jsx)(n.code,{children:"header"})," \u548c ",(0,t.jsx)(n.code,{children:"footer"})," \u88ab\u4f7f\u7528\u5230\uff0c\u4f8b\u5982 ",(0,t.jsx)(n.code,{children:'#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)'}),"\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,t.jsx)(n.code,{children:"date"})," \u53ef\u4ee5\u63a5\u6536 ",(0,t.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u548c ",(0,t.jsx)(n.code,{children:"content"})," \u683c\u5f0f\uff0c\u5e76\u4e14 ",(0,t.jsx)(n.code,{children:"datetime"})," \u683c\u5f0f\u7684\u65e5\u671f\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.datetime-format)(self: s, "[year]-[month]-[day]")\n'})}),"\n",(0,t.jsx)(n.p,{children:"\u7684\u65b9\u5f0f\u66f4\u6539\u3002"}),"\n",(0,t.jsxs)(n.admonition,{title:"\u539f\u7406",type:"tip",children:[(0,t.jsx)(n.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f1a\u7a0d\u5fae\u5f15\u5165\u4e00\u70b9 Touying \u7684 OOP \u6982\u5ff5\u3002"}),(0,t.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,t.jsx)(n.code,{children:"state"})," \u6216 ",(0,t.jsx)(n.code,{children:"counter"}),"\uff0c\u4e5f\u9700\u8981\u4f7f\u7528 ",(0,t.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,t.jsxs)(n.p,{children:["Touying \u5e76\u6ca1\u6709\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"state"})," \u548c ",(0,t.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,t.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,t.jsx)(n.code,{children:"self"})," \u7528\u4e8e\u4f20\u5165\u5bf9\u8c61\u81ea\u8eab\uff0c\u5e76\u4e14\u65b9\u6cd5\u5747\u653e\u5728 ",(0,t.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,t.jsx)(n.code,{children:"info"})," \u7684\u65b9\u6cd5\u4e86\uff1a"]}),(0,t.jsx)(n.pre,{children:(0,t.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,t.jsxs)(n.p,{children:["\u8fd9\u6837\uff0c\u4f60\u4e5f\u80fd\u591f\u7406\u89e3 ",(0,t.jsx)(n.code,{children:"utils.methods()"})," \u51fd\u6570\u7684\u7528\u9014\u4e86\uff1a\u5c06 ",(0,t.jsx)(n.code,{children:"self"})," \u7ed1\u5b9a\u5230 ",(0,t.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,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#let (init, slides, alert) = utils.methods(s)\n"})})]}),"\n",(0,t.jsx)(n.h2,{id:"\u72b6\u6001\u521d\u59cb\u5316",children:"\u72b6\u6001\u521d\u59cb\u5316"}),"\n",(0,t.jsxs)(n.p,{children:["\u4e00\u822c\u800c\u8a00\uff0c\u4e0a\u9762\u7684\u4e24\u79cd\u65b9\u5f0f\u5c31\u5df2\u7ecf\u8db3\u591f\u7528\u4e8e\u52a0\u5165\u5168\u5c40\u8bbe\u7f6e\u4e86\uff0c\u4f46\u662f\u4ecd\u7136\u4f1a\u6709\u90e8\u5206\u60c5\u51b5\uff0c\u6211\u4eec\u9700\u8981\u521d\u59cb\u5316 counters \u6216 states\u3002\u5982\u679c\u5c06\u8fd9\u4e9b\u4ee3\u7801\u653e\u5728 ",(0,t.jsx)(n.code,{children:"#show: slides"})," \u4e4b\u524d\uff0c\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u9875\uff0c\u8fd9\u662f\u6211\u4eec\u4e0d\u60f3\u770b\u89c1\u7684\uff0c\u56e0\u6b64\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"s.methods.append-preamble"})," \u65b9\u6cd5\u3002\u4f8b\u5982\u5728\u4f7f\u7528 codly \u5305\u7684\u65f6\u5019\uff1a"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})}),"\n",(0,t.jsx)(n.p,{children:"\u53c8\u6216\u8005\u662f\u8fdb\u884c Pdfpc \u7684\u914d\u7f6e\u7684\u65f6\u5019\uff1a"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n'})})]})}function h(e={}){const{wrapper: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:()=>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 d(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/4e00a773.48847e29.js b/zh/assets/js/4e00a773.3e811cce.js similarity index 98% rename from zh/assets/js/4e00a773.48847e29.js rename to zh/assets/js/4e00a773.3e811cce.js index 2ffdf0817..4e03894a9 100644 --- a/zh/assets/js/4e00a773.48847e29.js +++ b/zh/assets/js/4e00a773.3e811cce.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3296],{2618:(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:5},d="Aqua \u4e3b\u9898",r={id:"themes/aqua",title:"Aqua \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/zh/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/university"},next:{title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",permalink:"/touying/zh/docs/next/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:"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:"aqua-\u4e3b\u9898",children:"Aqua \u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7531 ",(0,i.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"})," \u5236\u4f5c\uff0c\u5b83\u7684\u7f8e\u4e3d\u80cc\u666f\u4e3a\u4f7f\u7528 Typst \u7684\u53ef\u89c6\u5316\u529f\u80fd\u5236\u4f5c\u7684\u77e2\u91cf\u56fe\u5f62\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.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"states.slide-counter.display()"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"lang"}),": \u8bed\u8a00\u914d\u7f6e\uff0c\u76ee\u524d\u53ea\u652f\u6301 ",(0,i.jsx)(n.code,{children:'"en"'})," \u548c ",(0,i.jsx)(n.code,{children:'"zh"'}),"\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'"en"'}),","]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 Aqua \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:"Aqua \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 primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\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:"Aqua \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(..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\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u663e\u793a\u4e00\u4e2a\u5927\u7eb2\u9875\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 // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"title"})," \u9ed8\u8ba4\u4e3a\u5f53\u524d section title\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.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",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 "../lib.typ": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,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 +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3296],{2618:(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:5},d="Aqua \u4e3b\u9898",r={id:"themes/aqua",title:"Aqua \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/aqua.md",sourceDirName:"themes",slug:"/themes/aqua",permalink:"/touying/zh/docs/next/themes/aqua",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/aqua.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"University \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/university"},next:{title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",permalink:"/touying/zh/docs/next/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:"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:"aqua-\u4e3b\u9898",children:"Aqua \u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u4e3b\u9898\u7531 ",(0,i.jsx)(n.a,{href:"https://github.com/pride7",children:"@pride7"})," \u5236\u4f5c\uff0c\u5b83\u7684\u7f8e\u4e3d\u80cc\u666f\u4e3a\u4f7f\u7528 Typst \u7684\u53ef\u89c6\u5316\u529f\u80fd\u5236\u4f5c\u7684\u77e2\u91cf\u56fe\u5f62\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.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"footer"}),": \u5c55\u793a\u5728\u9875\u811a\u53f3\u4fa7\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"states.slide-counter.display()"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"lang"}),": \u8bed\u8a00\u914d\u7f6e\uff0c\u76ee\u524d\u53ea\u652f\u6301 ",(0,i.jsx)(n.code,{children:'"en"'})," \u548c ",(0,i.jsx)(n.code,{children:'"zh"'}),"\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:'"en"'}),","]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 Aqua \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:"Aqua \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 primary: rgb("#003F88"),\n primary-light: rgb("#2159A5"),\n primary-lightest: rgb("#F2F4F8"),\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:"Aqua \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(..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\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#let outline-slide(self: none, enum-args: (:), leading: 50pt)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u663e\u793a\u4e00\u4e2a\u5927\u7eb2\u9875\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 // Aqua theme\n title: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,i.jsx)(n.code,{children:"title"})," \u9ed8\u8ba4\u4e3a\u5f53\u524d section title\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.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(title)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/eea4df8d-d9fd-43ac-aaf7-bb459864a9ac",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 "../lib.typ": *\n\n#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n== Summary\n\n#align(center + horizon)[\n #set text(size: 3em, weight: "bold", s.colors.primary)\n THANKS FOR ALL\n]\n'})})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,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/5bb6c1c3.e9427874.js b/zh/assets/js/5bb6c1c3.a5d8e1de.js similarity index 97% rename from zh/assets/js/5bb6c1c3.e9427874.js rename to zh/assets/js/5bb6c1c3.a5d8e1de.js index 59e18870b..c9974b800 100644 --- a/zh/assets/js/5bb6c1c3.e9427874.js +++ b/zh/assets/js/5bb6c1c3.a5d8e1de.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3563],{998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>r});var i=s(5893),t=s(1151);const l={sidebar_position:3},c="\u8282\u4e0e\u5c0f\u8282",o={id:"sections",title:"\u8282\u4e0e\u5c0f\u8282",description:"\u7ed3\u6784",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/zh/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u5f00\u59cb",permalink:"/touying/zh/docs/next/start"},next:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/next/code-styles"}},d={},r=[{value:"\u7ed3\u6784",id:"\u7ed3\u6784",level:2},{value:"\u7f16\u53f7",id:"\u7f16\u53f7",level:2},{value:"\u76ee\u5f55",id:"\u76ee\u5f55",level:2}];function u(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:"\u8282\u4e0e\u5c0f\u8282",children:"\u8282\u4e0e\u5c0f\u8282"}),"\n",(0,i.jsx)(n.h2,{id:"\u7ed3\u6784",children:"\u7ed3\u6784"}),"\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.jsx)(n.p,{children:"\u4e00\u822c\u800c\u8a00\uff0c1 \u7ea7\u30012 \u7ea7\u548c 3 \u7ea7\u6807\u9898\u5206\u522b\u7528\u6765\u5bf9\u5e94 section\u3001subsection \u548c title\uff0c\u4f8b\u5982 dewdrop \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u4f46\u662f\u5f88\u591a\u65f6\u5019\u6211\u4eec\u5e76\u4e0d\u9700\u8981 subsection\uff0c\u56e0\u6b64\u4e5f\u4f1a\u4f7f\u7528 1 \u7ea7\u548c 2 \u7ea7\u6807\u9898\u6765\u5206\u522b\u5bf9\u5e94 section \u548c title\uff0c\u4f8b\u5982 university \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u7684 ",(0,i.jsx)(n.code,{children:"slide-level"})," \u53c2\u6570\u6765\u63a7\u5236\u8fd9\u91cc\u7684\u884c\u4e3a\u3002",(0,i.jsx)(n.code,{children:"slide-level"})," \u4ee3\u8868\u7740\u5d4c\u5957\u7ed3\u6784\u7684\u590d\u6742\u5ea6\uff0c\u4ece 0 \u5f00\u59cb\u8ba1\u7b97\u3002\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," \u7b49\u4ef7\u4e8e ",(0,i.jsx)(n.code,{children:"section"}),"\uff0c",(0,i.jsx)(n.code,{children:"subsection"})," \u548c ",(0,i.jsx)(n.code,{children:"title"})," \u7ed3\u6784\uff1b\u800c ",(0,i.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," \u7b49\u4ef7\u4e8e ",(0,i.jsx)(n.code,{children:"section"})," \u548c ",(0,i.jsx)(n.code,{children:"title"})," \u7ed3\u6784\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7f16\u53f7",children:"\u7f16\u53f7"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u7ed9\u8282\u4e0e\u5c0f\u8282\u52a0\u5165\u7f16\u53f7\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4f7f\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5373\u53ef\u8bbe\u7f6e\u9ed8\u8ba4\u7f16\u53f7\u4e3a ",(0,i.jsx)(n.code,{children:"1.1"}),"\uff0c\u4e14 section \u5bf9\u5e94\u7684\u7f16\u53f7\u4e3a ",(0,i.jsx)(n.code,{children:"1."}),"\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.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\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:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u6b63\u5982 dewdrop \u4e3b\u9898\u6240\u505a\u7684\u90a3\u6837\u3002"})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>c});var i=s(7294);const t={},l=i.createContext(t);function c(e){const n=i.useContext(l);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(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3563],{998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>r});var i=s(5893),t=s(1151);const l={sidebar_position:3},c="\u8282\u4e0e\u5c0f\u8282",o={id:"sections",title:"\u8282\u4e0e\u5c0f\u8282",description:"\u7ed3\u6784",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/sections.md",sourceDirName:".",slug:"/sections",permalink:"/touying/zh/docs/next/sections",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/sections.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\u5f00\u59cb",permalink:"/touying/zh/docs/next/start"},next:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/next/code-styles"}},d={},r=[{value:"\u7ed3\u6784",id:"\u7ed3\u6784",level:2},{value:"\u7f16\u53f7",id:"\u7f16\u53f7",level:2},{value:"\u76ee\u5f55",id:"\u76ee\u5f55",level:2}];function u(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:"\u8282\u4e0e\u5c0f\u8282",children:"\u8282\u4e0e\u5c0f\u8282"}),"\n",(0,i.jsx)(n.h2,{id:"\u7ed3\u6784",children:"\u7ed3\u6784"}),"\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.jsx)(n.p,{children:"\u4e00\u822c\u800c\u8a00\uff0c1 \u7ea7\u30012 \u7ea7\u548c 3 \u7ea7\u6807\u9898\u5206\u522b\u7528\u6765\u5bf9\u5e94 section\u3001subsection \u548c title\uff0c\u4f8b\u5982 dewdrop \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Subsection\n\n=== Title\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u4f46\u662f\u5f88\u591a\u65f6\u5019\u6211\u4eec\u5e76\u4e0d\u9700\u8981 subsection\uff0c\u56e0\u6b64\u4e5f\u4f1a\u4f7f\u7528 1 \u7ea7\u548c 2 \u7ea7\u6807\u9898\u6765\u5206\u522b\u5bf9\u5e94 section \u548c title\uff0c\u4f8b\u5982 university \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Section\n\n== Title\n\nHello, Touying!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u5b9e\u9645\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"slides"})," \u51fd\u6570\u7684 ",(0,i.jsx)(n.code,{children:"slide-level"})," \u53c2\u6570\u6765\u63a7\u5236\u8fd9\u91cc\u7684\u884c\u4e3a\u3002",(0,i.jsx)(n.code,{children:"slide-level"})," \u4ee3\u8868\u7740\u5d4c\u5957\u7ed3\u6784\u7684\u590d\u6742\u5ea6\uff0c\u4ece 0 \u5f00\u59cb\u8ba1\u7b97\u3002\u4f8b\u5982 ",(0,i.jsx)(n.code,{children:"#show: slides.with(slide-level: 2)"})," \u7b49\u4ef7\u4e8e ",(0,i.jsx)(n.code,{children:"section"}),"\uff0c",(0,i.jsx)(n.code,{children:"subsection"})," \u548c ",(0,i.jsx)(n.code,{children:"title"})," \u7ed3\u6784\uff1b\u800c ",(0,i.jsx)(n.code,{children:"#show: slides.with(slide-level: 1)"})," \u7b49\u4ef7\u4e8e ",(0,i.jsx)(n.code,{children:"section"})," \u548c ",(0,i.jsx)(n.code,{children:"title"})," \u7ed3\u6784\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7f16\u53f7",children:"\u7f16\u53f7"}),"\n",(0,i.jsx)(n.p,{children:"\u4e3a\u4e86\u7ed9\u8282\u4e0e\u5c0f\u8282\u52a0\u5165\u7f16\u53f7\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4f7f\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5373\u53ef\u8bbe\u7f6e\u9ed8\u8ba4\u7f16\u53f7\u4e3a ",(0,i.jsx)(n.code,{children:"1.1"}),"\uff0c\u4e14 section \u5bf9\u5e94\u7684\u7f16\u53f7\u4e3a ",(0,i.jsx)(n.code,{children:"1."}),"\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.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides, alert, touying-outline) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(slide-level: 2)\n\n= Section\n\n== Subsection\n\n=== Title\n\n==== Table of contents\n\n#touying-outline()\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f",alt:"image"})}),"\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:"#states.touying-final-sections(sections => ..)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u6b63\u5982 dewdrop \u4e3b\u9898\u6240\u505a\u7684\u90a3\u6837\u3002"})]})}function h(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>o,a:()=>c});var i=s(7294);const t={},l=i.createContext(t);function c(e){const n=i.useContext(l);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(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/63dd4865.198592be.js b/zh/assets/js/63dd4865.5dfda47d.js similarity index 98% rename from zh/assets/js/63dd4865.198592be.js rename to zh/assets/js/63dd4865.5dfda47d.js index 7048dd41a..015cad777 100644 --- a/zh/assets/js/63dd4865.198592be.js +++ b/zh/assets/js/63dd4865.5dfda47d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7373],{8573:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>o,default:()=>a,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var i=n(5893),l=n(1151);const t={sidebar_position:11},o="\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",r={id:"build-your-own-theme",title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",description:"\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\u662f\u4e00\u4ef6\u7565\u663e\u590d\u6742\u7684\u4e8b\u60c5\uff0c\u56e0\u4e3a\u6211\u4eec\u5f15\u5165\u4e86\u8bb8\u591a\u7684\u6982\u5ff5\u3002\u4e0d\u8fc7\u8bf7\u653e\u5fc3\uff0c\u5982\u679c\u60a8\u771f\u7684\u7528 Touying \u521b\u5efa\u4e86\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u4e5f\u8bb8\u60a8\u5c31\u53ef\u4ee5\u6df1\u5207\u5730\u611f\u53d7\u5230 Touying \u63d0\u4f9b\u7684\u4fbf\u5229\u7684\u529f\u80fd\u7684\u548c\u5f3a\u5927\u7684\u53ef\u5b9a\u5236\u6027\u3002\u60a8\u53ef\u4ee5\u53c2\u8003 \u4e3b\u9898\u7684\u6e90\u4ee3\u7801\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/zh/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/zh/docs/next/category/progress"}},d={},c=[{value:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",id:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",level:2},{value:"\u5bfc\u5165",id:"\u5bfc\u5165",level:2},{value:"register \u51fd\u6570\u548c init \u65b9\u6cd5",id:"register-\u51fd\u6570\u548c-init-\u65b9\u6cd5",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"\u5b9e\u6218\uff1a\u81ea\u5b9a\u4e49 Alert \u65b9\u6cd5",id:"\u5b9e\u6218\u81ea\u5b9a\u4e49-alert-\u65b9\u6cd5",level:2},{value:"\u81ea\u5b9a\u4e49 Header \u548c Footer",id:"\u81ea\u5b9a\u4e49-header-\u548c-footer",level:2},{value:"\u81ea\u5b9a\u4e49\u7279\u6b8a Slide",id:"\u81ea\u5b9a\u4e49\u7279\u6b8a-slide",level:2},{value:"\u603b\u7ed3",id:"\u603b\u7ed3",level:2}];function h(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",children:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898"}),"\n",(0,i.jsxs)(s.p,{children:["\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\u662f\u4e00\u4ef6\u7565\u663e\u590d\u6742\u7684\u4e8b\u60c5\uff0c\u56e0\u4e3a\u6211\u4eec\u5f15\u5165\u4e86\u8bb8\u591a\u7684\u6982\u5ff5\u3002\u4e0d\u8fc7\u8bf7\u653e\u5fc3\uff0c\u5982\u679c\u60a8\u771f\u7684\u7528 Touying \u521b\u5efa\u4e86\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u4e5f\u8bb8\u60a8\u5c31\u53ef\u4ee5\u6df1\u5207\u5730\u611f\u53d7\u5230 Touying \u63d0\u4f9b\u7684\u4fbf\u5229\u7684\u529f\u80fd\u7684\u548c\u5f3a\u5927\u7684\u53ef\u5b9a\u5236\u6027\u3002\u60a8\u53ef\u4ee5\u53c2\u8003 ",(0,i.jsx)(s.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"\u4e3b\u9898\u7684\u6e90\u4ee3\u7801"}),"\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\uff0c\u521d\u59cb\u5316\u5168\u5c40\u5355\u4f8b ",(0,i.jsx)(s.code,{children:"s"}),"\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"init"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49\u989c\u8272\u4e3b\u9898\uff0c\u5373\u4fee\u6539 ",(0,i.jsx)(s.code,{children:"self.colors"})," \u6210\u5458\u53d8\u91cf\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"alert"})," \u65b9\u6cd5\uff0c\u53ef\u9009\uff1b"]}),"\n",(0,i.jsx)(s.li,{children:"\u81ea\u5b9a\u4e49 header\uff1b"}),"\n",(0,i.jsx)(s.li,{children:"\u81ea\u5b9a\u4e49 footer\uff1b"}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slide"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49\u7279\u6b8a slide \u65b9\u6cd5\uff0c\u5982 ",(0,i.jsx)(s.code,{children:"title-slide"})," \u548c ",(0,i.jsx)(s.code,{children:"focus-slide"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slides"})," \u65b9\u6cd5\uff0c\u53ef\u9009\uff1b"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u6211\u4eec\u4e0d\u59a8\u6765\u4e00\u6b65\u4e00\u6b65\u5730\u521b\u5efa\u4e00\u4e2a\u7b80\u6d01\u7f8e\u89c2\u7684 Bamboo \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",children:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898"}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u4f60\u60f3\u5728\u672c\u5730\u4fee\u6539\u4e00\u4e2a Touying \u5185\u90e8\u7684 themes\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u4ece\u96f6\u5f00\u59cb\u521b\u5efa\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u901a\u8fc7\u4e0b\u9762\u7684\u65b9\u5f0f\u5b9e\u73b0\uff1a"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"themes"})," \u76ee\u5f55\u4e0b\u7684 ",(0,i.jsx)(s.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"\u4e3b\u9898\u4ee3\u7801"})," \u590d\u5236\u5230\u672c\u5730\uff0c\u4f8b\u5982\u5c06 ",(0,i.jsx)(s.code,{children:"themes/university.typ"})," \u590d\u5236\u5230\u672c\u5730 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u4e2d\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u6587\u4ef6\u9876\u90e8\u7684 ",(0,i.jsx)(s.code,{children:'#import "../xxx.typ"'})," \u547d\u4ee4\u5168\u90e8\u79fb\u9664\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5411 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u6587\u4ef6\u9876\u90e8\u4e2d\u52a0\u5165 ",(0,i.jsx)(s.code,{children:'#import "@preview/touying:0.4.0": *'})," \u6765\u5bfc\u5165\u6240\u6709\u6a21\u5757\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u4e2d\u7684 ",(0,i.jsx)(s.code,{children:"self: s"})," \u66ff\u6362\u6210 ",(0,i.jsx)(s.code,{children:"self: themes.default.register()"})," ",(0,i.jsx)(s.strong,{children:"(\u91cd\u8981)"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"\u7136\u540e\u5c31\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(s.p,{children:"\u7684\u65b9\u5f0f\u5bfc\u5165\u548c\u4f7f\u7528\u4e3b\u9898\u4e86\u3002"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e00\u4e2a\u5177\u4f53\u7684\u793a\u4f8b\uff1a",(0,i.jsx)(s.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,i.jsx)(s.h2,{id:"\u5bfc\u5165",children:"\u5bfc\u5165"}),"\n",(0,i.jsx)(s.p,{children:"\u53d6\u51b3\u4e8e\u8fd9\u4e2a\u4e3b\u9898\u662f\u4f60\u81ea\u5df1\u7684\uff0c\u8fd8\u662f Touying \u7684\u4e00\u90e8\u5206\uff0c\u4f60\u53ef\u4ee5\u7528\u4e24\u79cd\u65b9\u5f0f\u5bfc\u5165\uff1a"}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u53ea\u662f\u4f60\u81ea\u5df1\u4f7f\u7528\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165 Touying\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u4f60\u5e0c\u671b\u8fd9\u4e2a\u4e3b\u9898\u4f5c\u4e3a Touying \u7684\u4e00\u90e8\u5206\uff0c\u653e\u7f6e\u5728 Touying ",(0,i.jsx)(s.code,{children:"themes"})," \u76ee\u5f55\u4e0b\uff0c\u90a3\u4f60\u5e94\u8be5\u5c06\u4e0a\u9762\u7684\u5bfc\u5165\u8bed\u53e5\u6539\u4e3a"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u8981\u5728 Touying \u7684 ",(0,i.jsx)(s.code,{children:"themes/themes.typ"})," \u91cc\u52a0\u4e0a"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,i.jsx)(s.h2,{id:"register-\u51fd\u6570\u548c-init-\u65b9\u6cd5",children:"register \u51fd\u6570\u548c init \u65b9\u6cd5"}),"\n",(0,i.jsxs)(s.p,{children:["\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f1a\u533a\u5206 ",(0,i.jsx)(s.code,{children:"bamboo.typ"})," \u6a21\u677f\u6587\u4ef6\u548c ",(0,i.jsx)(s.code,{children:"main.typ"})," \u6587\u4ef6\uff0c\u540e\u8005\u6709\u65f6\u4f1a\u88ab\u7701\u7565\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u4e00\u822c\u800c\u8a00\uff0c\u6211\u4eec\u5236\u4f5c slides \u7684\u7b2c\u4e00\u6b65\uff0c\u5c31\u662f\u786e\u5b9a\u597d\u5b57\u4f53\u5927\u5c0f\u548c\u9875\u9762\u957f\u5bbd\u6bd4\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u6ce8\u518c\u4e00\u4e2a\u521d\u59cb\u5316\u65b9\u6cd5\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u60a8\u6240\u89c1\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\uff0c\u5e76\u4f20\u5165\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"aspect-ratio"})," \u53c2\u6570\u6765\u8bbe\u5b9a\u9875\u9762\u957f\u5bbd\u6bd4\u3002\u6211\u4eec\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self: themes.default.register()"})," \u7684\u65b9\u5f0f\uff0c\u83b7\u5f97\u4e86\u7f3a\u7701\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\u3002\u7136\u540e\u6211\u4eec\u5c31\u9700\u8981\u8bbe\u7f6e\u9875\u9762\u53c2\u6570\u4e86\u3002\u60a8\u5e94\u8be5\u5df2\u7ecf\u77e5\u9053\u4e86\uff0c\u5728 Touying \u4e2d\uff0c\u6211\u4eec\u4e0d\u5e94\u8be5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"set page(..)"})," \u6765\u8bbe\u7f6e\u9875\u9762\u53c2\u6570\uff0c\u800c\u662f\u5e94\u8be5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:" self.page-args += (..)"})," \u8fd9\u79cd\u8bed\u6cd5\u6765\u8bbe\u7f6e\uff0c\u5177\u4f53\u5185\u5bb9\u53ef\u4ee5\u53c2\u8003\u9875\u9762\u5e03\u5c40\u7ae0\u8282\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u6ce8\u518c\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self.methods.init"})," \u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u8fdb\u884c\u4e00\u4e9b\u5168\u5c40\u7684\u6837\u5f0f\u8bbe\u7f6e\uff0c\u4f8b\u5982\u5728\u6b64\u5904\uff0c\u6211\u4eec\u52a0\u4e0a\u4e86 ",(0,i.jsx)(s.code,{children:"set text(size: 20pt)"})," \u6765\u8bbe\u7f6e\u6587\u5b57\u5927\u5c0f\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728\u8fd9\u91cc\u653e\u7f6e\u4e00\u4e9b\u989d\u5916\u7684\u5168\u5c40\u6837\u5f0f\u8bbe\u7f6e\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"set par(justify: true)"})," \u7b49\u3002\u7531\u4e8e ",(0,i.jsx)(s.code,{children:"init"})," \u51fd\u6570\u88ab\u653e\u7f6e\u5230\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods"})," \u91cc\uff0c\u662f\u4e00\u4e2a\u65b9\u6cd5\uff0c\u800c\u975e\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u52a0\u4e0a ",(0,i.jsx)(s.code,{children:"self: none"})," \u53c2\u6570\u624d\u80fd\u6b63\u5e38\u4f7f\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u60a8\u6240\u89c1\uff0c\u540e\u7eed\u5728 ",(0,i.jsx)(s.code,{children:"main.typ"})," \u4e2d\uff0c\u6211\u4eec\u4f1a\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#show: init"})," \u6765\u5e94\u7528 ",(0,i.jsx)(s.code,{children:"init"})," \u65b9\u6cd5\u91cc\u9762\u7684\u5168\u5c40\u6837\u5f0f\u8bbe\u7f6e\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"init"})," \u51fd\u6570\u662f\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"utils.methods(s)"})," \u7ed1\u5b9a\u5e76\u89e3\u5305\u800c\u6765\u7684\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u60a8\u591a\u52a0\u6ce8\u610f\uff0c\u60a8\u4f1a\u53d1\u73b0 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u6700\u540e\u6709\u4e00\u884c\u72ec\u7acb\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\uff0c\u8fd9\u5176\u5b9e\u662f\u4ee3\u8868\u4e86\u5c06\u4fee\u6539\u540e\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u4f5c\u4e3a\u8fd4\u56de\u503c\u8fd4\u56de\uff0c\u540e\u7eed\u4f1a\u88ab\u4fdd\u5b58\u5728 ",(0,i.jsx)(s.code,{children:"#let s = .."})," \u4e2d\uff0c\u56e0\u6b64\u8fd9\u4e00\u884c\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e3a\u60a8\u7684 slides \u6311\u9009\u4e00\u4e2a\u7f8e\u89c2\u7684\u989c\u8272\u4e3b\u9898\uff0c\u662f\u505a\u597d\u4e00\u4e2a slides \u7684\u5173\u952e\u6240\u5728\u3002Touying \u63d0\u4f9b\u4e86\u5185\u7f6e\u7684\u989c\u8272\u4e3b\u9898\u652f\u6301\uff0c\u4ee5\u5c3d\u91cf\u62b9\u5e73\u4e0d\u540c\u4e3b\u9898\u4e4b\u95f4\u7684 API \u5dee\u5f02\u3002Touying \u63d0\u4f9b\u4e86\u4e24\u4e2a\u7ef4\u5ea6\u7684\u989c\u8272\u9009\u62e9\uff0c\u7b2c\u4e00\u4e2a\u7ef4\u5ea6\u662f ",(0,i.jsx)(s.code,{children:"neutral"}),"\u3001",(0,i.jsx)(s.code,{children:"primary"}),"\u3001",(0,i.jsx)(s.code,{children:"secondary"})," \u548c ",(0,i.jsx)(s.code,{children:"tertiary"}),"\uff0c\u7528\u4e8e\u533a\u5206\u8272\u8c03\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f ",(0,i.jsx)(s.code,{children:"primary"})," \u4e3b\u9898\u8272\uff1b\u7b2c\u4e8c\u4e2a\u7ef4\u5ea6\u662f ",(0,i.jsx)(s.code,{children:"default"}),"\u3001",(0,i.jsx)(s.code,{children:"light"}),"\u3001",(0,i.jsx)(s.code,{children:"lighter"}),"\u3001",(0,i.jsx)(s.code,{children:"lightest"}),"\u3001",(0,i.jsx)(s.code,{children:"dark"}),"\u3001",(0,i.jsx)(s.code,{children:"darker"}),"\u3001",(0,i.jsx)(s.code,{children:"darkest"}),"\uff0c\u7528\u4e8e\u533a\u5206\u660e\u5ea6\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u7531\u4e8e\u6211\u4eec\u662f Bamboo \u4e3b\u9898\uff0c\u56e0\u6b64\u8fd9\u91cc\u7684\u4e3b\u9898\u8272 ",(0,i.jsx)(s.code,{children:"primary"})," \u6211\u4eec\u6311\u9009\u4e86\u4e00\u4e2a\u4e0e\u7af9\u5b50\u76f8\u8fd1\u7684\u989c\u8272 ",(0,i.jsx)(s.code,{children:'rgb("#5E8B65")'}),"\uff0c\u5e76\u52a0\u5165\u4e86\u4e2d\u6027\u8272 ",(0,i.jsx)(s.code,{children:"neutral-lightest"}),"\uff0c",(0,i.jsx)(s.code,{children:"neutral-darkest"}),"\uff0c\u5206\u522b\u4f5c\u4e3a\u80cc\u666f\u8272\u548c\u5b57\u4f53\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6b63\u5982\u4e0b\u9762\u7684\u4ee3\u7801\u6240\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self = (self.methods.colors)(self: self, ..)"})," \u65b9\u6cd5\u4fee\u6539\u989c\u8272\u4e3b\u9898\u3002\u5176\u672c\u8d28\u5c31\u662f ",(0,i.jsx)(s.code,{children:"self.colors += (..)"})," \u7684\u4e00\u4e2a\u5305\u88c5\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u50cf\u8fd9\u6837\u6dfb\u52a0\u4e86\u989c\u8272\u4e3b\u9898\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"self.colors.primary"})," \u8fd9\u6837\u7684\u65b9\u5f0f\u83b7\u53d6\u5230\u8fd9\u4e2a\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u6709\u4e00\u70b9\u503c\u5f97\u6ce8\u610f\uff0c\u7528\u6237\u53ef\u4ee5\u968f\u65f6\u5728 ",(0,i.jsx)(s.code,{children:"main.typ"})," \u91cc\u901a\u8fc7"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u6837\u7684\u65b9\u5f0f\u4fee\u6539\u4e3b\u9898\u8272\uff0c\u5176\u4e2d\u8fd9\u53e5\u8bed\u53e5\u9700\u8981\u653e\u5728 ",(0,i.jsx)(s.code,{children:"register()"})," \u4e4b\u540e\uff0c\u4ee5\u53ca ",(0,i.jsx)(s.code,{children:"utils.methods(s)"})," \u4e4b\u524d\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u79cd\u968f\u65f6\u66f4\u6362\u989c\u8272\u4e3b\u9898\u7684\u5185\u5bb9\uff0c\u6b63\u662f Touying \u5f3a\u5927\u53ef\u5b9a\u5236\u6027\u7684\u4f53\u73b0\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u5b9e\u6218\u81ea\u5b9a\u4e49-alert-\u65b9\u6cd5",children:"\u5b9e\u6218\uff1a\u81ea\u5b9a\u4e49 Alert \u65b9\u6cd5"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e00\u822c\u800c\u8a00\uff0c\u6211\u4eec\u90fd\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"#alert[..]"})," \u51fd\u6570\u7ed9\u7528\u6237\u4f7f\u7528\uff0c\u5176\u7528\u9014\u4e0e ",(0,i.jsx)(s.code,{children:"#strong[..]"})," \u7c7b\u4f3c\uff0c\u90fd\u662f\u7528\u4e8e\u5f3a\u8c03\u5f53\u524d\u6587\u672c\u3002\u4e00\u822c ",(0,i.jsx)(s.code,{children:"#alert[..]"})," \u4f1a\u5c06\u6587\u672c\u989c\u8272\u4fee\u6539\u4e3a\u4e3b\u9898\u8272\uff0c\u8fd9\u6837\u770b\u8d77\u6765\u4f1a\u66f4\u7f8e\u89c2\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u63a5\u4e0b\u6765\u8981\u5b9e\u73b0\u7684\u76ee\u6807\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6211\u4eec\u5728 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u91cc\u52a0\u4e0a\u4e00\u53e5"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u53e5\u4ee3\u7801\u7684\u610f\u601d\u5c31\u662f\u5c06\u6587\u672c\u989c\u8272\u4fee\u6539\u4e3a ",(0,i.jsx)(s.code,{children:"self.colors.primary"}),"\uff0c\u800c\u8fd9\u91cc\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u6b63\u662f\u901a\u8fc7\u53c2\u6570 ",(0,i.jsx)(s.code,{children:"self: none"})," \u4f20\u8fdb\u6765\u7684\uff0c\u8fd9\u6837\u6211\u4eec\u624d\u80fd\u5b9e\u65f6\u5730\u83b7\u53d6\u5230 ",(0,i.jsx)(s.code,{children:"primary"})," \u4e3b\u9898\u8272\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u81ea\u5b9a\u4e49-header-\u548c-footer",children:"\u81ea\u5b9a\u4e49 Header \u548c Footer"}),"\n",(0,i.jsx)(s.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u8ba4\u4e3a\u60a8\u5df2\u7ecf\u9605\u8bfb\u8fc7\u9875\u9762\u5e03\u5c40\u7ae0\u8282\u4e86\uff0c\u56e0\u6b64\u6211\u4eec\u77e5\u9053\u5e94\u8be5\u7ed9 slides \u52a0\u4e0a header \u548c footer\u3002"}),"\n",(0,i.jsxs)(s.p,{children:["\u9996\u5148\uff0c\u6211\u4eec\u5148\u52a0\u5165 ",(0,i.jsx)(s.code,{children:"self.bamboo-title = []"}),"\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u5c06\u5f53\u524d slide \u7684\u6807\u9898\u4f5c\u4e3a\u4e00\u4e2a\u6210\u5458\u53d8\u91cf ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\uff0c\u4fdd\u5b58\u5728 ",(0,i.jsx)(s.code,{children:"self"})," \u91cc\u9762\uff0c\u8fd9\u6837\u65b9\u4fbf\u6211\u4eec\u5728 header \u91cc\u4f7f\u7528\uff0c\u4ee5\u53ca\u540e\u7eed\u4fee\u6539\u3002\u540c\u7406\uff0c\u6211\u4eec\u8fd8\u521b\u5efa\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self.bamboo-footer"}),"\uff0c\u5e76\u5c06 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u7684 ",(0,i.jsx)(s.code,{children:"footer: []"})," \u53c2\u6570\u4fdd\u5b58\u8d77\u6765\uff0c\u7528\u4f5c\u5de6\u4e0b\u89d2\u7684 footer \u5c55\u793a\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u7136\u540e\u503c\u5f97\u6ce8\u610f\u7684\u5c31\u662f\uff0c\u6211\u4eec\u7684 header \u5176\u5b9e\u662f\u4e00\u4e2a\u5f62\u5982 ",(0,i.jsx)(s.code,{children:"let header(self) = { .. }"})," \u7684\u53c2\u6570\u4e3a ",(0,i.jsx)(s.code,{children:"self"})," \u7684 content \u51fd\u6570\uff0c\u800c\u4e0d\u662f\u4e00\u4e2a\u5355\u7eaf\u7684 content\uff0c\u8fd9\u6837\u6211\u4eec\u624d\u80fd\u4ece\u6700\u65b0\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u5185\u90e8\u83b7\u53d6\u5230\u6211\u4eec\u9700\u8981\u7684\u4fe1\u606f\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\u3002\u800c footer \u4e5f\u662f\u540c\u7406\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u91cc\u9762\u4f7f\u7528\u5230\u7684 ",(0,i.jsx)(s.code,{children:"components.cell"})," \u5176\u5b9e\u5c31\u662f ",(0,i.jsx)(s.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),"\uff0c\u800c ",(0,i.jsx)(s.code,{children:"show: components.cell"})," \u4e5f\u5c31\u662f ",(0,i.jsx)(s.code,{children:"components.cell(body)"})," \u7684\u7b80\u5199\uff0cfooter \u7684 ",(0,i.jsx)(s.code,{children:"show: pad.with(.4em)"})," \u4e5f\u662f\u540c\u7406\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u53e6\u4e00\u70b9\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c",(0,i.jsx)(s.code,{children:"states"})," \u6a21\u5757\u91cc\u653e\u7f6e\u4e86\u5f88\u591a\u548c\u8ba1\u6570\u5668\u3001\u72b6\u6001\u6709\u5173\u7684\u5185\u5bb9\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"states.current-section-title"})," \u7528\u4e8e\u663e\u793a\u5f53\u524d\u7684 ",(0,i.jsx)(s.code,{children:"section"}),"\uff0c\u800c ",(0,i.jsx)(s.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," \u7528\u4e8e\u663e\u793a\u5f53\u524d\u9875\u6570\u548c\u603b\u9875\u6570\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca\u6211\u4eec\u53d1\u73b0\u6211\u4eec\u4f1a\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," \u8fd9\u6837\u7684\u8bed\u6cd5\u6765\u663e\u793a ",(0,i.jsx)(s.code,{children:"self.bamboo-footer"}),"\uff0c\u8fd9\u662f\u7528\u4e8e\u5e94\u4ed8 ",(0,i.jsx)(s.code,{children:"self.bamboo-footer = (self) => {..}"})," \u8fd9\u79cd\u60c5\u51b5\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u80fd\u7edf\u4e00 content \u51fd\u6570\u548c content \u7684\u663e\u793a\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4e3a\u4e86\u8ba9 header \u548c footer \u6b63\u786e\u663e\u793a\uff0c\u5e76\u4e14\u4e0e\u6b63\u6587\u6709\u8db3\u591f\u7684\u95f4\u9694\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6e margin\uff0c\u5982 ",(0,i.jsx)(s.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u800c\u6211\u4eec\u8fd8\u9700\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"slide"})," \u65b9\u6cd5\uff0c\u5176\u4e2d\u63a5\u6536 ",(0,i.jsx)(s.code,{children:"slide(self: none, title: auto, ..args)"}),"\uff0c\u7b2c\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self: none"})," \u662f\u4e00\u4e2a\u65b9\u6cd5\u6240\u5fc5\u987b\u7684\u53c2\u6570\uff0c\u7528\u4e8e\u83b7\u53d6\u6700\u65b0\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\uff1b\u800c\u7b2c\u4e8c\u4e2a ",(0,i.jsx)(s.code,{children:"title"})," \u5219\u662f\u7528\u4e8e\u66f4\u65b0 ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\uff0c\u4ee5\u4fbf\u5728 header \u4e2d\u663e\u793a\u51fa\u6765\uff1b\u7b2c\u4e09\u4e2a ",(0,i.jsx)(s.code,{children:"..args"})," \u662f\u7528\u4e8e\u6536\u96c6\u5269\u4f59\u7684\u53c2\u6570\uff0c\u5e76\u4f20\u5230 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, ..args)"})," \u91cc\uff0c\u8fd9\u4e5f\u662f\u8ba9 Touying ",(0,i.jsx)(s.code,{children:"slide"})," \u529f\u80fd\u6b63\u5e38\u751f\u6548\u6240\u5fc5\u987b\u7684\u3002\u5e76\u4e14\uff0c\u6211\u4eec\u9700\u8981\u5728 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u91cc\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self.methods.slide = slide"})," \u6ce8\u518c\u8fd9\u4e2a\u65b9\u6cd5\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,i.jsx)(s.h2,{id:"\u81ea\u5b9a\u4e49\u7279\u6b8a-slide",children:"\u81ea\u5b9a\u4e49\u7279\u6b8a Slide"}),"\n",(0,i.jsxs)(s.p,{children:["\u6211\u4eec\u5728\u4e0a\u9762\u7684\u57fa\u7840 slide \u7684\u57fa\u7840\u4e0a\uff0c\u8fdb\u4e00\u6b65\u52a0\u5165\u4e00\u4e9b\u7279\u6b8a\u7684 slide \u51fd\u6570\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"title-slide"}),"\uff0c",(0,i.jsx)(s.code,{children:"focus-slide"})," \u4ee5\u53ca\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slides"})," \u65b9\u6cd5\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"title-slide"})," \u65b9\u6cd5\uff0c\u9996\u5148\uff0c\u6211\u4eec\u8c03\u7528\u4e86 ",(0,i.jsx)(s.code,{children:"self = utils.empty-page(self)"}),"\uff0c\u8fd9\u4e2a\u51fd\u6570\u53ef\u4ee5\u6e05\u9664 ",(0,i.jsx)(s.code,{children:"self.page-args.header"})," \u548c ",(0,i.jsx)(s.code,{children:"self.page-args.footer"}),"\uff0c\u4ee5\u53ca\u5c06 ",(0,i.jsx)(s.code,{children:"margin"})," \u8bbe\u4e3a ",(0,i.jsx)(s.code,{children:"0em"}),"\uff0c\u5f97\u5230\u4e00\u4e2a\u7a7a\u767d\u9875\u7684\u6548\u679c\u3002\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"let info = self.info + args.named()"})," \u83b7\u53d6\u5230 ",(0,i.jsx)(s.code,{children:"self.info"})," \u91cc\u4fdd\u5b58\u7684\u4fe1\u606f\uff0c\u4e5f\u53ef\u4ee5\u7528\u51fd\u6570\u53c2\u6570\u91cc\u4f20\u5165\u7684 ",(0,i.jsx)(s.code,{children:"args.named()"})," \u6765\u66f4\u65b0\u4fe1\u606f\uff0c\u4fbf\u4e8e\u540e\u7eed\u4ee5 ",(0,i.jsx)(s.code,{children:"info.title"})," \u7684\u65b9\u5f0f\u4f7f\u7528\u3002\u5177\u4f53\u7684\u9875\u9762\u5185\u5bb9 ",(0,i.jsx)(s.code,{children:"body"}),"\uff0c\u6bcf\u4e2a theme \u90fd\u4f1a\u6709\u6240\u4e0d\u540c\uff0c\u8fd9\u91cc\u5c31\u4e0d\u518d\u8fc7\u591a\u8d58\u8ff0\u3002\u800c\u5728\u6700\u540e\uff0c\u6211\u4eec\u8c03\u7528\u4e86 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, body)"}),"\uff0c\u5176\u4e2d\u7684 ",(0,i.jsx)(s.code,{children:"repeat: none"})," \u8868\u9762\u8fd9\u4e2a\u9875\u9762\u4e0d\u9700\u8981\u52a8\u753b\u6548\u679c\uff0c\u800c\u4f20\u5165 ",(0,i.jsx)(s.code,{children:"body"})," \u53c2\u6570\u4f1a\u5c06 ",(0,i.jsx)(s.code,{children:"body"})," \u7684\u5185\u5bb9\u663e\u793a\u51fa\u6765\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u65b9\u6cd5\uff0c\u4e5f\u662f\u540c\u7406\uff0c\u4e0d\u8fc7\u552f\u4e00\u8981\u6ce8\u610f\u7684\u662f\u6211\u4eec\u5728 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"})," \u7684\u53c2\u6570\u91cc\u9762\u591a\u4f20\u5165\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"section: section"}),"\uff0c\u8fd9\u662f\u7528\u6765\u58f0\u660e\u65b0\u5efa\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"section"})," \u7684\u3002\u53e6\u4e00\u70b9\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u9664\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods.new-section-slide = new-section-slide"}),"\uff0c\u8fd8\u6ce8\u518c\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),"\uff0c\u8fd9\u6837 ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u5c31\u4f1a\u5728\u78b0\u5230\u4e00\u7ea7\u6807\u9898\u65f6\u81ea\u52a8\u88ab\u8c03\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"focus-slide"})," \u65b9\u6cd5\uff0c\u5927\u90e8\u5206\u5185\u5bb9\u4e5f\u57fa\u672c\u4e00\u81f4\uff0c\u4e0d\u8fc7\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"self.page-args += (..)"})," \u66f4\u65b0\u4e86\u9875\u9762\u7684\u80cc\u666f\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6700\u540e\uff0c\u6211\u4eec\u8fd8\u66f4\u65b0\u4e86 ",(0,i.jsx)(s.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," \u65b9\u6cd5\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"title-slide"})," \u4e3a ",(0,i.jsx)(s.code,{children:"true"})," \u65f6\uff0c\u5728\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u540e\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"title-slide"}),"\uff1b\u800c ",(0,i.jsx)(s.code,{children:"slide-level: 1"})," \u6307\u660e\u4e86\u4e00\u7ea7\u6807\u9898\u548c\u4e8c\u7ea7\u6807\u9898\u5206\u522b\u5bf9\u5e94 ",(0,i.jsx)(s.code,{children:"section"})," \u548c ",(0,i.jsx)(s.code,{children:"title"}),"\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.0": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.0": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,i.jsx)(s.h2,{id:"\u603b\u7ed3",children:"\u603b\u7ed3"}),"\n",(0,i.jsx)(s.p,{children:"\u81f3\u6b64\uff0c\u6211\u4eec\u5c31\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2a\u7b80\u6d01\u53c8\u7f8e\u89c2\u7684\u4e3b\u9898\u4e86\u3002\u4e5f\u8bb8\u4f60\u4f1a\u89c9\u5f97\uff0cTouying \u5f15\u5165\u7684\u6982\u5ff5\u8fc7\u4e8e\u4e30\u5bcc\u4e86\uff0c\u4ee5\u81f3\u4e8e\u8ba9\u4eba\u4e00\u65f6\u5f88\u96be\u8f7b\u6613\u63a5\u53d7\u3002\u8fd9\u662f\u6b63\u5e38\u7684\uff0c\u5728\u5f3a\u5927\u7684\u529f\u80fd\u4e0e\u7b80\u6d01\u7684\u6982\u5ff5\u4e4b\u95f4\uff0cTouying \u9009\u62e9\u4e86\u524d\u8005\u3002\u4f46\u662f\u4e5f\u6b63\u662f\u5f97\u76ca\u4e8e Touying \u8fd9\u79cd\u5927\u800c\u5168\u7684\u7edf\u4e00\u7406\u5ff5\uff0c\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u62bd\u79bb\u51fa\u5171\u901a\u4e4b\u5904\uff0c\u5e76\u5c06\u4f60\u5b66\u5230\u7684\u6982\u5ff5\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u4e3b\u9898\u4e0a\u3002\u4ea6\u6216\u8005\uff0c\u4f60\u53ef\u4ee5\u5f88\u8f7b\u6613\u5730\u4fdd\u5b58\u5168\u5c40\u53d8\u91cf\uff0c\u6216\u8005\u66f4\u6539\u5df2\u6709\u7684\u4e3b\u9898\uff0c\u4f8b\u5982\u5168\u5c40\u4fdd\u5b58\u4e3b\u9898\u989c\u8272\uff0c\u66ff\u6362\u6389 slides \u7684 header\uff0c\u6216\u8005\u6dfb\u52a0\u4e00\u4e24\u4e2a Logo \u7b49\uff0c\u8fd9\u4e5f\u6b63\u662f Touying \u89e3\u8026\u4e0e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u5e26\u6765\u7684\u597d\u5904\u3002"})]})}function a(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>r,a:()=>o});var i=n(7294);const l={},t=i.createContext(l);function o(e){const s=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),i.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7373],{8573:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>o,default:()=>a,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var i=n(5893),l=n(1151);const t={sidebar_position:11},o="\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",r={id:"build-your-own-theme",title:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",description:"\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\u662f\u4e00\u4ef6\u7565\u663e\u590d\u6742\u7684\u4e8b\u60c5\uff0c\u56e0\u4e3a\u6211\u4eec\u5f15\u5165\u4e86\u8bb8\u591a\u7684\u6982\u5ff5\u3002\u4e0d\u8fc7\u8bf7\u653e\u5fc3\uff0c\u5982\u679c\u60a8\u771f\u7684\u7528 Touying \u521b\u5efa\u4e86\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u4e5f\u8bb8\u60a8\u5c31\u53ef\u4ee5\u6df1\u5207\u5730\u611f\u53d7\u5230 Touying \u63d0\u4f9b\u7684\u4fbf\u5229\u7684\u529f\u80fd\u7684\u548c\u5f3a\u5927\u7684\u53ef\u5b9a\u5236\u6027\u3002\u60a8\u53ef\u4ee5\u53c2\u8003 \u4e3b\u9898\u7684\u6e90\u4ee3\u7801\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/build-your-own-theme.md",sourceDirName:".",slug:"/build-your-own-theme",permalink:"/touying/zh/docs/next/build-your-own-theme",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/build-your-own-theme.md",tags:[],version:"current",sidebarPosition:11,frontMatter:{sidebar_position:11},sidebar:"tutorialSidebar",previous:{title:"Aqua \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/aqua"},next:{title:"Progress",permalink:"/touying/zh/docs/next/category/progress"}},d={},c=[{value:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",id:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",level:2},{value:"\u5bfc\u5165",id:"\u5bfc\u5165",level:2},{value:"register \u51fd\u6570\u548c init \u65b9\u6cd5",id:"register-\u51fd\u6570\u548c-init-\u65b9\u6cd5",level:2},{value:"\u989c\u8272\u4e3b\u9898",id:"\u989c\u8272\u4e3b\u9898",level:2},{value:"\u5b9e\u6218\uff1a\u81ea\u5b9a\u4e49 Alert \u65b9\u6cd5",id:"\u5b9e\u6218\u81ea\u5b9a\u4e49-alert-\u65b9\u6cd5",level:2},{value:"\u81ea\u5b9a\u4e49 Header \u548c Footer",id:"\u81ea\u5b9a\u4e49-header-\u548c-footer",level:2},{value:"\u81ea\u5b9a\u4e49\u7279\u6b8a Slide",id:"\u81ea\u5b9a\u4e49\u7279\u6b8a-slide",level:2},{value:"\u603b\u7ed3",id:"\u603b\u7ed3",level:2}];function h(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898",children:"\u521b\u5efa\u81ea\u5df1\u7684\u4e3b\u9898"}),"\n",(0,i.jsxs)(s.p,{children:["\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\u662f\u4e00\u4ef6\u7565\u663e\u590d\u6742\u7684\u4e8b\u60c5\uff0c\u56e0\u4e3a\u6211\u4eec\u5f15\u5165\u4e86\u8bb8\u591a\u7684\u6982\u5ff5\u3002\u4e0d\u8fc7\u8bf7\u653e\u5fc3\uff0c\u5982\u679c\u60a8\u771f\u7684\u7528 Touying \u521b\u5efa\u4e86\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u4e5f\u8bb8\u60a8\u5c31\u53ef\u4ee5\u6df1\u5207\u5730\u611f\u53d7\u5230 Touying \u63d0\u4f9b\u7684\u4fbf\u5229\u7684\u529f\u80fd\u7684\u548c\u5f3a\u5927\u7684\u53ef\u5b9a\u5236\u6027\u3002\u60a8\u53ef\u4ee5\u53c2\u8003 ",(0,i.jsx)(s.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"\u4e3b\u9898\u7684\u6e90\u4ee3\u7801"}),"\uff0c\u4e3b\u8981\u9700\u8981\u5b9e\u73b0\u7684\u5c31\u662f\uff1a"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\uff0c\u521d\u59cb\u5316\u5168\u5c40\u5355\u4f8b ",(0,i.jsx)(s.code,{children:"s"}),"\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"init"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49\u989c\u8272\u4e3b\u9898\uff0c\u5373\u4fee\u6539 ",(0,i.jsx)(s.code,{children:"self.colors"})," \u6210\u5458\u53d8\u91cf\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"alert"})," \u65b9\u6cd5\uff0c\u53ef\u9009\uff1b"]}),"\n",(0,i.jsx)(s.li,{children:"\u81ea\u5b9a\u4e49 header\uff1b"}),"\n",(0,i.jsx)(s.li,{children:"\u81ea\u5b9a\u4e49 footer\uff1b"}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slide"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49\u7279\u6b8a slide \u65b9\u6cd5\uff0c\u5982 ",(0,i.jsx)(s.code,{children:"title-slide"})," \u548c ",(0,i.jsx)(s.code,{children:"focus-slide"})," \u65b9\u6cd5\uff1b"]}),"\n",(0,i.jsxs)(s.li,{children:["\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slides"})," \u65b9\u6cd5\uff0c\u53ef\u9009\uff1b"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u4f7f\u7528 Touying \u521b\u5efa\u4e00\u4e2a\u81ea\u5df1\u7684\u4e3b\u9898\uff0c\u6211\u4eec\u4e0d\u59a8\u6765\u4e00\u6b65\u4e00\u6b65\u5730\u521b\u5efa\u4e00\u4e2a\u7b80\u6d01\u7f8e\u89c2\u7684 Bamboo \u4e3b\u9898\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898",children:"\u4fee\u6539\u5df2\u6709\u4e3b\u9898"}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u4f60\u60f3\u5728\u672c\u5730\u4fee\u6539\u4e00\u4e2a Touying \u5185\u90e8\u7684 themes\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u4ece\u96f6\u5f00\u59cb\u521b\u5efa\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u901a\u8fc7\u4e0b\u9762\u7684\u65b9\u5f0f\u5b9e\u73b0\uff1a"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"themes"})," \u76ee\u5f55\u4e0b\u7684 ",(0,i.jsx)(s.a,{href:"https://github.com/touying-typ/touying/tree/main/themes",children:"\u4e3b\u9898\u4ee3\u7801"})," \u590d\u5236\u5230\u672c\u5730\uff0c\u4f8b\u5982\u5c06 ",(0,i.jsx)(s.code,{children:"themes/university.typ"})," \u590d\u5236\u5230\u672c\u5730 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u4e2d\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u6587\u4ef6\u9876\u90e8\u7684 ",(0,i.jsx)(s.code,{children:'#import "../xxx.typ"'})," \u547d\u4ee4\u5168\u90e8\u79fb\u9664\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5411 ",(0,i.jsx)(s.code,{children:"university.typ"})," \u6587\u4ef6\u9876\u90e8\u4e2d\u52a0\u5165 ",(0,i.jsx)(s.code,{children:'#import "@preview/touying:0.4.1": *'})," \u6765\u5bfc\u5165\u6240\u6709\u6a21\u5757\u3002"]}),"\n",(0,i.jsxs)(s.li,{children:["\u5c06 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u4e2d\u7684 ",(0,i.jsx)(s.code,{children:"self: s"})," \u66ff\u6362\u6210 ",(0,i.jsx)(s.code,{children:"self: themes.default.register()"})," ",(0,i.jsx)(s.strong,{children:"(\u91cd\u8981)"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"\u7136\u540e\u5c31\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "university.typ"\n\n#let s = university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(s.p,{children:"\u7684\u65b9\u5f0f\u5bfc\u5165\u548c\u4f7f\u7528\u4e3b\u9898\u4e86\u3002"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e00\u4e2a\u5177\u4f53\u7684\u793a\u4f8b\uff1a",(0,i.jsx)(s.a,{href:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA",children:"https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA"})]}),"\n",(0,i.jsx)(s.h2,{id:"\u5bfc\u5165",children:"\u5bfc\u5165"}),"\n",(0,i.jsx)(s.p,{children:"\u53d6\u51b3\u4e8e\u8fd9\u4e2a\u4e3b\u9898\u662f\u4f60\u81ea\u5df1\u7684\uff0c\u8fd8\u662f Touying \u7684\u4e00\u90e8\u5206\uff0c\u4f60\u53ef\u4ee5\u7528\u4e24\u79cd\u65b9\u5f0f\u5bfc\u5165\uff1a"}),"\n",(0,i.jsx)(s.p,{children:"\u5982\u679c\u53ea\u662f\u4f60\u81ea\u5df1\u4f7f\u7528\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165 Touying\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u4f60\u5e0c\u671b\u8fd9\u4e2a\u4e3b\u9898\u4f5c\u4e3a Touying \u7684\u4e00\u90e8\u5206\uff0c\u653e\u7f6e\u5728 Touying ",(0,i.jsx)(s.code,{children:"themes"})," \u76ee\u5f55\u4e0b\uff0c\u90a3\u4f60\u5e94\u8be5\u5c06\u4e0a\u9762\u7684\u5bfc\u5165\u8bed\u53e5\u6539\u4e3a"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "../utils/utils.typ"\n#import "../utils/states.typ"\n#import "../utils/components.typ"\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u8981\u5728 Touying \u7684 ",(0,i.jsx)(s.code,{children:"themes/themes.typ"})," \u91cc\u52a0\u4e0a"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'#import "bamboo.typ"\n'})}),"\n",(0,i.jsx)(s.h2,{id:"register-\u51fd\u6570\u548c-init-\u65b9\u6cd5",children:"register \u51fd\u6570\u548c init \u65b9\u6cd5"}),"\n",(0,i.jsxs)(s.p,{children:["\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f1a\u533a\u5206 ",(0,i.jsx)(s.code,{children:"bamboo.typ"})," \u6a21\u677f\u6587\u4ef6\u548c ",(0,i.jsx)(s.code,{children:"main.typ"})," \u6587\u4ef6\uff0c\u540e\u8005\u6709\u65f6\u4f1a\u88ab\u7701\u7565\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u4e00\u822c\u800c\u8a00\uff0c\u6211\u4eec\u5236\u4f5c slides \u7684\u7b2c\u4e00\u6b65\uff0c\u5c31\u662f\u786e\u5b9a\u597d\u5b57\u4f53\u5927\u5c0f\u548c\u9875\u9762\u957f\u5bbd\u6bd4\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u6ce8\u518c\u4e00\u4e2a\u521d\u59cb\u5316\u65b9\u6cd5\uff1a"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9")\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u60a8\u6240\u89c1\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\uff0c\u5e76\u4f20\u5165\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"aspect-ratio"})," \u53c2\u6570\u6765\u8bbe\u5b9a\u9875\u9762\u957f\u5bbd\u6bd4\u3002\u6211\u4eec\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self: themes.default.register()"})," \u7684\u65b9\u5f0f\uff0c\u83b7\u5f97\u4e86\u7f3a\u7701\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\u3002\u7136\u540e\u6211\u4eec\u5c31\u9700\u8981\u8bbe\u7f6e\u9875\u9762\u53c2\u6570\u4e86\u3002\u60a8\u5e94\u8be5\u5df2\u7ecf\u77e5\u9053\u4e86\uff0c\u5728 Touying \u4e2d\uff0c\u6211\u4eec\u4e0d\u5e94\u8be5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"set page(..)"})," \u6765\u8bbe\u7f6e\u9875\u9762\u53c2\u6570\uff0c\u800c\u662f\u5e94\u8be5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:" self.page-args += (..)"})," \u8fd9\u79cd\u8bed\u6cd5\u6765\u8bbe\u7f6e\uff0c\u5177\u4f53\u5185\u5bb9\u53ef\u4ee5\u53c2\u8003\u9875\u9762\u5e03\u5c40\u7ae0\u8282\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u6ce8\u518c\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self.methods.init"})," \u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u8fdb\u884c\u4e00\u4e9b\u5168\u5c40\u7684\u6837\u5f0f\u8bbe\u7f6e\uff0c\u4f8b\u5982\u5728\u6b64\u5904\uff0c\u6211\u4eec\u52a0\u4e0a\u4e86 ",(0,i.jsx)(s.code,{children:"set text(size: 20pt)"})," \u6765\u8bbe\u7f6e\u6587\u5b57\u5927\u5c0f\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728\u8fd9\u91cc\u653e\u7f6e\u4e00\u4e9b\u989d\u5916\u7684\u5168\u5c40\u6837\u5f0f\u8bbe\u7f6e\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"set par(justify: true)"})," \u7b49\u3002\u7531\u4e8e ",(0,i.jsx)(s.code,{children:"init"})," \u51fd\u6570\u88ab\u653e\u7f6e\u5230\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods"})," \u91cc\uff0c\u662f\u4e00\u4e2a\u65b9\u6cd5\uff0c\u800c\u975e\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u52a0\u4e0a ",(0,i.jsx)(s.code,{children:"self: none"})," \u53c2\u6570\u624d\u80fd\u6b63\u5e38\u4f7f\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u60a8\u6240\u89c1\uff0c\u540e\u7eed\u5728 ",(0,i.jsx)(s.code,{children:"main.typ"})," \u4e2d\uff0c\u6211\u4eec\u4f1a\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#show: init"})," \u6765\u5e94\u7528 ",(0,i.jsx)(s.code,{children:"init"})," \u65b9\u6cd5\u91cc\u9762\u7684\u5168\u5c40\u6837\u5f0f\u8bbe\u7f6e\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"init"})," \u51fd\u6570\u662f\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"utils.methods(s)"})," \u7ed1\u5b9a\u5e76\u89e3\u5305\u800c\u6765\u7684\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5982\u679c\u60a8\u591a\u52a0\u6ce8\u610f\uff0c\u60a8\u4f1a\u53d1\u73b0 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u6700\u540e\u6709\u4e00\u884c\u72ec\u7acb\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\uff0c\u8fd9\u5176\u5b9e\u662f\u4ee3\u8868\u4e86\u5c06\u4fee\u6539\u540e\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u4f5c\u4e3a\u8fd4\u56de\u503c\u8fd4\u56de\uff0c\u540e\u7eed\u4f1a\u88ab\u4fdd\u5b58\u5728 ",(0,i.jsx)(s.code,{children:"#let s = .."})," \u4e2d\uff0c\u56e0\u6b64\u8fd9\u4e00\u884c\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u989c\u8272\u4e3b\u9898",children:"\u989c\u8272\u4e3b\u9898"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e3a\u60a8\u7684 slides \u6311\u9009\u4e00\u4e2a\u7f8e\u89c2\u7684\u989c\u8272\u4e3b\u9898\uff0c\u662f\u505a\u597d\u4e00\u4e2a slides \u7684\u5173\u952e\u6240\u5728\u3002Touying \u63d0\u4f9b\u4e86\u5185\u7f6e\u7684\u989c\u8272\u4e3b\u9898\u652f\u6301\uff0c\u4ee5\u5c3d\u91cf\u62b9\u5e73\u4e0d\u540c\u4e3b\u9898\u4e4b\u95f4\u7684 API \u5dee\u5f02\u3002Touying \u63d0\u4f9b\u4e86\u4e24\u4e2a\u7ef4\u5ea6\u7684\u989c\u8272\u9009\u62e9\uff0c\u7b2c\u4e00\u4e2a\u7ef4\u5ea6\u662f ",(0,i.jsx)(s.code,{children:"neutral"}),"\u3001",(0,i.jsx)(s.code,{children:"primary"}),"\u3001",(0,i.jsx)(s.code,{children:"secondary"})," \u548c ",(0,i.jsx)(s.code,{children:"tertiary"}),"\uff0c\u7528\u4e8e\u533a\u5206\u8272\u8c03\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f ",(0,i.jsx)(s.code,{children:"primary"})," \u4e3b\u9898\u8272\uff1b\u7b2c\u4e8c\u4e2a\u7ef4\u5ea6\u662f ",(0,i.jsx)(s.code,{children:"default"}),"\u3001",(0,i.jsx)(s.code,{children:"light"}),"\u3001",(0,i.jsx)(s.code,{children:"lighter"}),"\u3001",(0,i.jsx)(s.code,{children:"lightest"}),"\u3001",(0,i.jsx)(s.code,{children:"dark"}),"\u3001",(0,i.jsx)(s.code,{children:"darker"}),"\u3001",(0,i.jsx)(s.code,{children:"darkest"}),"\uff0c\u7528\u4e8e\u533a\u5206\u660e\u5ea6\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u7531\u4e8e\u6211\u4eec\u662f Bamboo \u4e3b\u9898\uff0c\u56e0\u6b64\u8fd9\u91cc\u7684\u4e3b\u9898\u8272 ",(0,i.jsx)(s.code,{children:"primary"})," \u6211\u4eec\u6311\u9009\u4e86\u4e00\u4e2a\u4e0e\u7af9\u5b50\u76f8\u8fd1\u7684\u989c\u8272 ",(0,i.jsx)(s.code,{children:'rgb("#5E8B65")'}),"\uff0c\u5e76\u52a0\u5165\u4e86\u4e2d\u6027\u8272 ",(0,i.jsx)(s.code,{children:"neutral-lightest"}),"\uff0c",(0,i.jsx)(s.code,{children:"neutral-darkest"}),"\uff0c\u5206\u522b\u4f5c\u4e3a\u80cc\u666f\u8272\u548c\u5b57\u4f53\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6b63\u5982\u4e0b\u9762\u7684\u4ee3\u7801\u6240\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self = (self.methods.colors)(self: self, ..)"})," \u65b9\u6cd5\u4fee\u6539\u989c\u8272\u4e3b\u9898\u3002\u5176\u672c\u8d28\u5c31\u662f ",(0,i.jsx)(s.code,{children:"self.colors += (..)"})," \u7684\u4e00\u4e2a\u5305\u88c5\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n )\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u50cf\u8fd9\u6837\u6dfb\u52a0\u4e86\u989c\u8272\u4e3b\u9898\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"self.colors.primary"})," \u8fd9\u6837\u7684\u65b9\u5f0f\u83b7\u53d6\u5230\u8fd9\u4e2a\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5e76\u4e14\u6709\u4e00\u70b9\u503c\u5f97\u6ce8\u610f\uff0c\u7528\u6237\u53ef\u4ee5\u968f\u65f6\u5728 ",(0,i.jsx)(s.code,{children:"main.typ"})," \u91cc\u901a\u8fc7"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#let s = (s.methods.colors)(self: s, primary: rgb("#3578B9"))\n'})}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u6837\u7684\u65b9\u5f0f\u4fee\u6539\u4e3b\u9898\u8272\uff0c\u5176\u4e2d\u8fd9\u53e5\u8bed\u53e5\u9700\u8981\u653e\u5728 ",(0,i.jsx)(s.code,{children:"register()"})," \u4e4b\u540e\uff0c\u4ee5\u53ca ",(0,i.jsx)(s.code,{children:"utils.methods(s)"})," \u4e4b\u524d\u3002"]}),"\n",(0,i.jsx)(s.p,{children:"\u8fd9\u79cd\u968f\u65f6\u66f4\u6362\u989c\u8272\u4e3b\u9898\u7684\u5185\u5bb9\uff0c\u6b63\u662f Touying \u5f3a\u5927\u53ef\u5b9a\u5236\u6027\u7684\u4f53\u73b0\u3002"}),"\n",(0,i.jsx)(s.h2,{id:"\u5b9e\u6218\u81ea\u5b9a\u4e49-alert-\u65b9\u6cd5",children:"\u5b9e\u6218\uff1a\u81ea\u5b9a\u4e49 Alert \u65b9\u6cd5"}),"\n",(0,i.jsxs)(s.p,{children:["\u4e00\u822c\u800c\u8a00\uff0c\u6211\u4eec\u90fd\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"#alert[..]"})," \u51fd\u6570\u7ed9\u7528\u6237\u4f7f\u7528\uff0c\u5176\u7528\u9014\u4e0e ",(0,i.jsx)(s.code,{children:"#strong[..]"})," \u7c7b\u4f3c\uff0c\u90fd\u662f\u7528\u4e8e\u5f3a\u8c03\u5f53\u524d\u6587\u672c\u3002\u4e00\u822c ",(0,i.jsx)(s.code,{children:"#alert[..]"})," \u4f1a\u5c06\u6587\u672c\u989c\u8272\u4fee\u6539\u4e3a\u4e3b\u9898\u8272\uff0c\u8fd9\u6837\u770b\u8d77\u6765\u4f1a\u66f4\u7f8e\u89c2\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u63a5\u4e0b\u6765\u8981\u5b9e\u73b0\u7684\u76ee\u6807\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6211\u4eec\u5728 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u91cc\u52a0\u4e0a\u4e00\u53e5"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:"self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n"})}),"\n",(0,i.jsxs)(s.p,{children:["\u8fd9\u53e5\u4ee3\u7801\u7684\u610f\u601d\u5c31\u662f\u5c06\u6587\u672c\u989c\u8272\u4fee\u6539\u4e3a ",(0,i.jsx)(s.code,{children:"self.colors.primary"}),"\uff0c\u800c\u8fd9\u91cc\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u6b63\u662f\u901a\u8fc7\u53c2\u6570 ",(0,i.jsx)(s.code,{children:"self: none"})," \u4f20\u8fdb\u6765\u7684\uff0c\u8fd9\u6837\u6211\u4eec\u624d\u80fd\u5b9e\u65f6\u5730\u83b7\u53d6\u5230 ",(0,i.jsx)(s.code,{children:"primary"})," \u4e3b\u9898\u8272\u3002"]}),"\n",(0,i.jsx)(s.h2,{id:"\u81ea\u5b9a\u4e49-header-\u548c-footer",children:"\u81ea\u5b9a\u4e49 Header \u548c Footer"}),"\n",(0,i.jsx)(s.p,{children:"\u5728\u8fd9\u91cc\uff0c\u6211\u8ba4\u4e3a\u60a8\u5df2\u7ecf\u9605\u8bfb\u8fc7\u9875\u9762\u5e03\u5c40\u7ae0\u8282\u4e86\uff0c\u56e0\u6b64\u6211\u4eec\u77e5\u9053\u5e94\u8be5\u7ed9 slides \u52a0\u4e0a header \u548c footer\u3002"}),"\n",(0,i.jsxs)(s.p,{children:["\u9996\u5148\uff0c\u6211\u4eec\u5148\u52a0\u5165 ",(0,i.jsx)(s.code,{children:"self.bamboo-title = []"}),"\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u5c06\u5f53\u524d slide \u7684\u6807\u9898\u4f5c\u4e3a\u4e00\u4e2a\u6210\u5458\u53d8\u91cf ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\uff0c\u4fdd\u5b58\u5728 ",(0,i.jsx)(s.code,{children:"self"})," \u91cc\u9762\uff0c\u8fd9\u6837\u65b9\u4fbf\u6211\u4eec\u5728 header \u91cc\u4f7f\u7528\uff0c\u4ee5\u53ca\u540e\u7eed\u4fee\u6539\u3002\u540c\u7406\uff0c\u6211\u4eec\u8fd8\u521b\u5efa\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self.bamboo-footer"}),"\uff0c\u5e76\u5c06 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u7684 ",(0,i.jsx)(s.code,{children:"footer: []"})," \u53c2\u6570\u4fdd\u5b58\u8d77\u6765\uff0c\u7528\u4f5c\u5de6\u4e0b\u89d2\u7684 footer \u5c55\u793a\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u7136\u540e\u503c\u5f97\u6ce8\u610f\u7684\u5c31\u662f\uff0c\u6211\u4eec\u7684 header \u5176\u5b9e\u662f\u4e00\u4e2a\u5f62\u5982 ",(0,i.jsx)(s.code,{children:"let header(self) = { .. }"})," \u7684\u53c2\u6570\u4e3a ",(0,i.jsx)(s.code,{children:"self"})," \u7684 content \u51fd\u6570\uff0c\u800c\u4e0d\u662f\u4e00\u4e2a\u5355\u7eaf\u7684 content\uff0c\u8fd9\u6837\u6211\u4eec\u624d\u80fd\u4ece\u6700\u65b0\u7684 ",(0,i.jsx)(s.code,{children:"self"})," \u5185\u90e8\u83b7\u53d6\u5230\u6211\u4eec\u9700\u8981\u7684\u4fe1\u606f\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\u3002\u800c footer \u4e5f\u662f\u540c\u7406\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u91cc\u9762\u4f7f\u7528\u5230\u7684 ",(0,i.jsx)(s.code,{children:"components.cell"})," \u5176\u5b9e\u5c31\u662f ",(0,i.jsx)(s.code,{children:"#let cell = block.with(width: 100%, height: 100%, above: 0pt, below: 0pt, breakable: false)"}),"\uff0c\u800c ",(0,i.jsx)(s.code,{children:"show: components.cell"})," \u4e5f\u5c31\u662f ",(0,i.jsx)(s.code,{children:"components.cell(body)"})," \u7684\u7b80\u5199\uff0cfooter \u7684 ",(0,i.jsx)(s.code,{children:"show: pad.with(.4em)"})," \u4e5f\u662f\u540c\u7406\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u53e6\u4e00\u70b9\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c",(0,i.jsx)(s.code,{children:"states"})," \u6a21\u5757\u91cc\u653e\u7f6e\u4e86\u5f88\u591a\u548c\u8ba1\u6570\u5668\u3001\u72b6\u6001\u6709\u5173\u7684\u5185\u5bb9\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"states.current-section-title"})," \u7528\u4e8e\u663e\u793a\u5f53\u524d\u7684 ",(0,i.jsx)(s.code,{children:"section"}),"\uff0c\u800c ",(0,i.jsx)(s.code,{children:'states.slide-counter.display() + " / " + states.last-slide-number'})," \u7528\u4e8e\u663e\u793a\u5f53\u524d\u9875\u6570\u548c\u603b\u9875\u6570\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca\u6211\u4eec\u53d1\u73b0\u6211\u4eec\u4f1a\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"utils.call-or-display(self, self.bamboo-footer)"})," \u8fd9\u6837\u7684\u8bed\u6cd5\u6765\u663e\u793a ",(0,i.jsx)(s.code,{children:"self.bamboo-footer"}),"\uff0c\u8fd9\u662f\u7528\u4e8e\u5e94\u4ed8 ",(0,i.jsx)(s.code,{children:"self.bamboo-footer = (self) => {..}"})," \u8fd9\u79cd\u60c5\u51b5\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u80fd\u7edf\u4e00 content \u51fd\u6570\u548c content \u7684\u663e\u793a\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4e3a\u4e86\u8ba9 header \u548c footer \u6b63\u786e\u663e\u793a\uff0c\u5e76\u4e14\u4e0e\u6b63\u6587\u6709\u8db3\u591f\u7684\u95f4\u9694\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6e margin\uff0c\u5982 ",(0,i.jsx)(s.code,{children:"self.page-args += (margin: (top: 4em, bottom: 1.5em, x: 2em))"}),"\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u800c\u6211\u4eec\u8fd8\u9700\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"slide"})," \u65b9\u6cd5\uff0c\u5176\u4e2d\u63a5\u6536 ",(0,i.jsx)(s.code,{children:"slide(self: none, title: auto, ..args)"}),"\uff0c\u7b2c\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"self: none"})," \u662f\u4e00\u4e2a\u65b9\u6cd5\u6240\u5fc5\u987b\u7684\u53c2\u6570\uff0c\u7528\u4e8e\u83b7\u53d6\u6700\u65b0\u7684 ",(0,i.jsx)(s.code,{children:"self"}),"\uff1b\u800c\u7b2c\u4e8c\u4e2a ",(0,i.jsx)(s.code,{children:"title"})," \u5219\u662f\u7528\u4e8e\u66f4\u65b0 ",(0,i.jsx)(s.code,{children:"self.bamboo-title"}),"\uff0c\u4ee5\u4fbf\u5728 header \u4e2d\u663e\u793a\u51fa\u6765\uff1b\u7b2c\u4e09\u4e2a ",(0,i.jsx)(s.code,{children:"..args"})," \u662f\u7528\u4e8e\u6536\u96c6\u5269\u4f59\u7684\u53c2\u6570\uff0c\u5e76\u4f20\u5230 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, ..args)"})," \u91cc\uff0c\u8fd9\u4e5f\u662f\u8ba9 Touying ",(0,i.jsx)(s.code,{children:"slide"})," \u529f\u80fd\u6b63\u5e38\u751f\u6548\u6240\u5fc5\u987b\u7684\u3002\u5e76\u4e14\uff0c\u6211\u4eec\u9700\u8981\u5728 ",(0,i.jsx)(s.code,{children:"register"})," \u51fd\u6570\u91cc\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"self.methods.slide = slide"})," \u6ce8\u518c\u8fd9\u4e2a\u65b9\u6cd5\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d33bcda7-c032-4b11-b392-5b939d9a0a47",alt:"image"})}),"\n",(0,i.jsx)(s.h2,{id:"\u81ea\u5b9a\u4e49\u7279\u6b8a-slide",children:"\u81ea\u5b9a\u4e49\u7279\u6b8a Slide"}),"\n",(0,i.jsxs)(s.p,{children:["\u6211\u4eec\u5728\u4e0a\u9762\u7684\u57fa\u7840 slide \u7684\u57fa\u7840\u4e0a\uff0c\u8fdb\u4e00\u6b65\u52a0\u5165\u4e00\u4e9b\u7279\u6b8a\u7684 slide \u51fd\u6570\uff0c\u4f8b\u5982 ",(0,i.jsx)(s.code,{children:"title-slide"}),"\uff0c",(0,i.jsx)(s.code,{children:"focus-slide"})," \u4ee5\u53ca\u81ea\u5b9a\u4e49 ",(0,i.jsx)(s.code,{children:"slides"})," \u65b9\u6cd5\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"title-slide"})," \u65b9\u6cd5\uff0c\u9996\u5148\uff0c\u6211\u4eec\u8c03\u7528\u4e86 ",(0,i.jsx)(s.code,{children:"self = utils.empty-page(self)"}),"\uff0c\u8fd9\u4e2a\u51fd\u6570\u53ef\u4ee5\u6e05\u9664 ",(0,i.jsx)(s.code,{children:"self.page-args.header"})," \u548c ",(0,i.jsx)(s.code,{children:"self.page-args.footer"}),"\uff0c\u4ee5\u53ca\u5c06 ",(0,i.jsx)(s.code,{children:"margin"})," \u8bbe\u4e3a ",(0,i.jsx)(s.code,{children:"0em"}),"\uff0c\u5f97\u5230\u4e00\u4e2a\u7a7a\u767d\u9875\u7684\u6548\u679c\u3002\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"let info = self.info + args.named()"})," \u83b7\u53d6\u5230 ",(0,i.jsx)(s.code,{children:"self.info"})," \u91cc\u4fdd\u5b58\u7684\u4fe1\u606f\uff0c\u4e5f\u53ef\u4ee5\u7528\u51fd\u6570\u53c2\u6570\u91cc\u4f20\u5165\u7684 ",(0,i.jsx)(s.code,{children:"args.named()"})," \u6765\u66f4\u65b0\u4fe1\u606f\uff0c\u4fbf\u4e8e\u540e\u7eed\u4ee5 ",(0,i.jsx)(s.code,{children:"info.title"})," \u7684\u65b9\u5f0f\u4f7f\u7528\u3002\u5177\u4f53\u7684\u9875\u9762\u5185\u5bb9 ",(0,i.jsx)(s.code,{children:"body"}),"\uff0c\u6bcf\u4e2a theme \u90fd\u4f1a\u6709\u6240\u4e0d\u540c\uff0c\u8fd9\u91cc\u5c31\u4e0d\u518d\u8fc7\u591a\u8d58\u8ff0\u3002\u800c\u5728\u6700\u540e\uff0c\u6211\u4eec\u8c03\u7528\u4e86 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, body)"}),"\uff0c\u5176\u4e2d\u7684 ",(0,i.jsx)(s.code,{children:"repeat: none"})," \u8868\u9762\u8fd9\u4e2a\u9875\u9762\u4e0d\u9700\u8981\u52a8\u753b\u6548\u679c\uff0c\u800c\u4f20\u5165 ",(0,i.jsx)(s.code,{children:"body"})," \u53c2\u6570\u4f1a\u5c06 ",(0,i.jsx)(s.code,{children:"body"})," \u7684\u5185\u5bb9\u663e\u793a\u51fa\u6765\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u65b9\u6cd5\uff0c\u4e5f\u662f\u540c\u7406\uff0c\u4e0d\u8fc7\u552f\u4e00\u8981\u6ce8\u610f\u7684\u662f\u6211\u4eec\u5728 ",(0,i.jsx)(s.code,{children:"(self.methods.touying-slide)(self: self, repeat: none, section: section, body)"})," \u7684\u53c2\u6570\u91cc\u9762\u591a\u4f20\u5165\u4e86\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"section: section"}),"\uff0c\u8fd9\u662f\u7528\u6765\u58f0\u660e\u65b0\u5efa\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"section"})," \u7684\u3002\u53e6\u4e00\u70b9\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u9664\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods.new-section-slide = new-section-slide"}),"\uff0c\u8fd8\u6ce8\u518c\u4e86 ",(0,i.jsx)(s.code,{children:"self.methods.touying-new-section-slide = new-section-slide"}),"\uff0c\u8fd9\u6837 ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u5c31\u4f1a\u5728\u78b0\u5230\u4e00\u7ea7\u6807\u9898\u65f6\u81ea\u52a8\u88ab\u8c03\u7528\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u5bf9\u4e8e ",(0,i.jsx)(s.code,{children:"focus-slide"})," \u65b9\u6cd5\uff0c\u5927\u90e8\u5206\u5185\u5bb9\u4e5f\u57fa\u672c\u4e00\u81f4\uff0c\u4e0d\u8fc7\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"self.page-args += (..)"})," \u66f4\u65b0\u4e86\u9875\u9762\u7684\u80cc\u666f\u989c\u8272\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u6700\u540e\uff0c\u6211\u4eec\u8fd8\u66f4\u65b0\u4e86 ",(0,i.jsx)(s.code,{children:"slides(self: none, title-slide: true, slide-level: 1, ..args)"})," \u65b9\u6cd5\uff0c\u5176\u4e2d ",(0,i.jsx)(s.code,{children:"title-slide"})," \u4e3a ",(0,i.jsx)(s.code,{children:"true"})," \u65f6\uff0c\u5728\u4f7f\u7528 ",(0,i.jsx)(s.code,{children:"#show: slides"})," \u540e\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a ",(0,i.jsx)(s.code,{children:"title-slide"}),"\uff1b\u800c ",(0,i.jsx)(s.code,{children:"slide-level: 1"})," \u6307\u660e\u4e86\u4e00\u7ea7\u6807\u9898\u548c\u4e8c\u7ea7\u6807\u9898\u5206\u522b\u5bf9\u5e94 ",(0,i.jsx)(s.code,{children:"section"})," \u548c ",(0,i.jsx)(s.code,{children:"title"}),"\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'// bamboo.typ\n#import "@preview/touying:0.4.1": *\n\n#let slide(self: none, title: auto, ..args) = {\n if title != auto {\n self.bamboo-title = title\n }\n (self.methods.touying-slide)(self: self, ..args)\n}\n\n#let title-slide(self: none, ..args) = {\n self = utils.empty-page(self)\n let info = self.info + args.named()\n let body = {\n set align(center + horizon)\n block(\n fill: self.colors.primary,\n width: 80%,\n inset: (y: 1em),\n radius: 1em,\n text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)\n )\n set text(fill: self.colors.neutral-darkest)\n if info.author != none {\n block(info.author)\n }\n if info.date != none {\n block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })\n }\n }\n (self.methods.touying-slide)(self: self, repeat: none, body)\n}\n\n#let new-section-slide(self: none, section) = {\n self = utils.empty-page(self)\n let body = {\n set align(center + horizon)\n set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")\n section\n }\n (self.methods.touying-slide)(self: self, repeat: none, section: section, body)\n}\n\n#let focus-slide(self: none, body) = {\n self = utils.empty-page(self)\n self.page-args += (\n fill: self.colors.primary,\n margin: 2em,\n )\n set text(fill: self.colors.neutral-lightest, size: 2em)\n (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))\n}\n\n#let slides(self: none, title-slide: true, slide-level: 1, ..args) = {\n if title-slide {\n (self.methods.title-slide)(self: self)\n }\n (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)\n}\n\n#let register(\n self: themes.default.register(),\n aspect-ratio: "16-9",\n footer: [],\n) = {\n // color theme\n self = (self.methods.colors)(\n self: self,\n primary: rgb("#5E8B65"),\n neutral-lightest: rgb("#ffffff"),\n neutral-darkest: rgb("#000000"),\n )\n // variables for later use\n self.bamboo-title = []\n self.bamboo-footer = footer\n // set page\n let header(self) = {\n set align(top)\n show: components.cell.with(fill: self.colors.primary, inset: 1em)\n set align(horizon)\n set text(fill: self.colors.neutral-lightest, size: .7em)\n states.current-section-title\n linebreak()\n set text(size: 1.5em)\n utils.call-or-display(self, self.bamboo-title)\n }\n let footer(self) = {\n set align(bottom)\n show: pad.with(.4em)\n set text(fill: self.colors.neutral-darkest, size: .8em)\n utils.call-or-display(self, self.bamboo-footer)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n }\n self.page-args += (\n paper: "presentation-" + aspect-ratio,\n header: header,\n footer: footer,\n margin: (top: 4em, bottom: 1.5em, x: 2em),\n )\n // register methods\n self.methods.slide = slide\n self.methods.title-slide = title-slide\n self.methods.new-section-slide = new-section-slide\n self.methods.touying-new-section-slide = new-section-slide\n self.methods.focus-slide = focus-slide\n self.methods.slides = slides\n self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)\n self.methods.init = (self: none, body) => {\n set text(size: 20pt)\n body\n }\n self\n}\n\n\n// main.typ\n#import "@preview/touying:0.4.1": *\n#import "bamboo.typ"\n\n#let s = bamboo.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= First Section\n\n== First Slide\n\n#slide[\n A slide with a title and an *important* information.\n]\n\n#focus-slide[\n Focus on it!\n]\n'})}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/03c5ad02-8ff4-4068-9664-d9cfad79baaf",alt:"image"})}),"\n",(0,i.jsx)(s.h2,{id:"\u603b\u7ed3",children:"\u603b\u7ed3"}),"\n",(0,i.jsx)(s.p,{children:"\u81f3\u6b64\uff0c\u6211\u4eec\u5c31\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2a\u7b80\u6d01\u53c8\u7f8e\u89c2\u7684\u4e3b\u9898\u4e86\u3002\u4e5f\u8bb8\u4f60\u4f1a\u89c9\u5f97\uff0cTouying \u5f15\u5165\u7684\u6982\u5ff5\u8fc7\u4e8e\u4e30\u5bcc\u4e86\uff0c\u4ee5\u81f3\u4e8e\u8ba9\u4eba\u4e00\u65f6\u5f88\u96be\u8f7b\u6613\u63a5\u53d7\u3002\u8fd9\u662f\u6b63\u5e38\u7684\uff0c\u5728\u5f3a\u5927\u7684\u529f\u80fd\u4e0e\u7b80\u6d01\u7684\u6982\u5ff5\u4e4b\u95f4\uff0cTouying \u9009\u62e9\u4e86\u524d\u8005\u3002\u4f46\u662f\u4e5f\u6b63\u662f\u5f97\u76ca\u4e8e Touying \u8fd9\u79cd\u5927\u800c\u5168\u7684\u7edf\u4e00\u7406\u5ff5\uff0c\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5728\u4e0d\u540c\u7684\u4e3b\u9898\u4e4b\u95f4\u62bd\u79bb\u51fa\u5171\u901a\u4e4b\u5904\uff0c\u5e76\u5c06\u4f60\u5b66\u5230\u7684\u6982\u5ff5\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u4e3b\u9898\u4e0a\u3002\u4ea6\u6216\u8005\uff0c\u4f60\u53ef\u4ee5\u5f88\u8f7b\u6613\u5730\u4fdd\u5b58\u5168\u5c40\u53d8\u91cf\uff0c\u6216\u8005\u66f4\u6539\u5df2\u6709\u7684\u4e3b\u9898\uff0c\u4f8b\u5982\u5168\u5c40\u4fdd\u5b58\u4e3b\u9898\u989c\u8272\uff0c\u66ff\u6362\u6389 slides \u7684 header\uff0c\u6216\u8005\u6dfb\u52a0\u4e00\u4e24\u4e2a Logo \u7b49\uff0c\u8fd9\u4e5f\u6b63\u662f Touying \u89e3\u8026\u4e0e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u5e26\u6765\u7684\u597d\u5904\u3002"})]})}function a(e={}){const{wrapper:s}={...(0,l.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>r,a:()=>o});var i=n(7294);const l={},t=i.createContext(l);function o(e){const s=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),i.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/69a95a34.7e93bac1.js b/zh/assets/js/69a95a34.21772d20.js similarity index 98% rename from zh/assets/js/69a95a34.7e93bac1.js rename to zh/assets/js/69a95a34.21772d20.js index cf1e22700..ab51e6015 100644 --- a/zh/assets/js/69a95a34.7e93bac1.js +++ b/zh/assets/js/69a95a34.21772d20.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5166],{9557:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var i=t(5893),r=t(1151);const s={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying \u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/zh/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/zh/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/zh/docs/next/integration/fletcher"}},l={},d=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"only \u4e0e uncover",id:"only-\u4e0e-uncover",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-\u4e0e-uncover",children:"only \u4e0e uncover"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 cetz \u5185\u90e8\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"only"})," \u548c ",(0,i.jsx)(n.code,{children:"uncover"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5166],{9557:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var i=t(5893),r=t(1151);const s={sidebar_position:3},o="CeTZ",c={id:"integration/cetz",title:"CeTZ",description:"Touying \u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md",sourceDirName:"integration",slug:"/integration/cetz",permalink:"/touying/zh/docs/next/integration/cetz",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/cetz.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"MiTeX",permalink:"/touying/zh/docs/next/integration/mitex"},next:{title:"Fletcher",permalink:"/touying/zh/docs/next/integration/fletcher"}},l={},d=[{value:"\u7b80\u5355\u52a8\u753b",id:"\u7b80\u5355\u52a8\u753b",level:2},{value:"only \u4e0e uncover",id:"only-\u4e0e-uncover",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cetz",children:"CeTZ"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a cetz \u4e0e fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"\u7b80\u5355\u52a8\u753b",children:"\u7b80\u5355\u52a8\u753b"}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})}),"\n",(0,i.jsx)(n.h2,{id:"only-\u4e0e-uncover",children:"only \u4e0e uncover"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 cetz \u5185\u90e8\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:"only"})," \u548c ",(0,i.jsx)(n.code,{children:"uncover"}),"\uff0c\u53ea\u662f\u9700\u8981\u4e00\u70b9\u6280\u5de7\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#slide(repeat: 3, self => [\n #let (uncover, only) = utils.methods(self)\n\n Cetz in Touying in subslide #self.subslide:\n\n #cetz.canvas({\n import cetz.draw: *\n let self = (self.methods.update-cover)(self: self, hide.with(bounds: true))\n let (uncover,) = utils.methods(self)\n \n rect((0,0), (5,5))\n\n uncover("2-3", {\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n })\n\n only(3, line((0,0), (2.5, 2.5), name: "line"))\n })\n])\n'})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/6a503890.a8a90c97.js b/zh/assets/js/6a503890.006bba1f.js similarity index 98% rename from zh/assets/js/6a503890.a8a90c97.js rename to zh/assets/js/6a503890.006bba1f.js index da93f70c6..465799d0f 100644 --- a/zh/assets/js/6a503890.a8a90c97.js +++ b/zh/assets/js/6a503890.006bba1f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2810],{9887:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress is a PDF presentation tool designed for dual-screen setups such as presentations and public talks. Highly configurable, fully-featured, and portable",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/zh/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"pdfpc",permalink:"/touying/zh/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/zh/docs/next/external/typst-preview"}},p={},l=[{value:"Speaker Notes",id:"speaker-notes",level:2}];function c(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," is a PDF presentation tool designed for dual-screen setups such as presentations and public talks. Highly configurable, fully-featured, and portable"]}),"\n",(0,t.jsx)(s.h2,{id:"speaker-notes",children:"Speaker Notes"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"Then we can use the pympress to show it."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2810],{9887:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>p,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var t=n(5893),i=n(1151);const o={sidebar_position:2},r="Pympress",a={id:"external/pympress",title:"Pympress",description:"Pympress is a PDF presentation tool designed for dual-screen setups such as presentations and public talks. Highly configurable, fully-featured, and portable",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/external/pympress.md",sourceDirName:"external",slug:"/external/pympress",permalink:"/touying/zh/docs/next/external/pympress",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/external/pympress.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"pdfpc",permalink:"/touying/zh/docs/next/external/pdfpc"},next:{title:"Typst Preview",permalink:"/touying/zh/docs/next/external/typst-preview"}},p={},l=[{value:"Speaker Notes",id:"speaker-notes",level:2}];function c(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"pympress",children:"Pympress"}),"\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/Cimbali/pympress",children:"Pympress"})," is a PDF presentation tool designed for dual-screen setups such as presentations and public talks. Highly configurable, fully-featured, and portable"]}),"\n",(0,t.jsx)(s.h2,{id:"speaker-notes",children:"Speaker Notes"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the speaker notes configuration, you can show it by pympress\n#let s = (s.methods.show-notes-on-second-screen)(self: s, right)\n\n#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n#speaker-note[\n + This is a speaker note.\n + You won\'t see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`\n]\n'})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b43c7f99-c5f9-4084-aa70-c1561e8aafee",alt:"image"})}),"\n",(0,t.jsx)(s.p,{children:"Then we can use the pympress to show it."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{src:"https://github.com/touying-typ/touying/assets/34951714/afbe17cb-46d4-4507-90e8-959c53de95d5",alt:"image"})})]})}function u(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>a,a:()=>r});var t=n(7294);const i={},o=t.createContext(i);function r(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/af355bab.d5c4fd47.js b/zh/assets/js/af355bab.66334ddd.js similarity index 98% rename from zh/assets/js/af355bab.d5c4fd47.js rename to zh/assets/js/af355bab.66334ddd.js index de2ce1be7..ad4bbc35e 100644 --- a/zh/assets/js/af355bab.d5c4fd47.js +++ b/zh/assets/js/af355bab.66334ddd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9931],{873:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>m});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying \u80fd\u591f\u4e0e ctheorems \u5305\u4e00\u8d77\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 ctheorems \u5305\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/zh/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/zh/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/zh/docs/next/category/themes"}},c={},m=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsx)(n.p,{children:"Touying \u80fd\u591f\u4e0e ctheorems \u5305\u4e00\u8d77\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 ctheorems \u5305\u3002"}),"\n",(0,o.jsxs)(n.p,{children:["\u5176\u4e2d\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," \u4e3a sections \u548c subsections \u8bbe\u7f6e numbering\u3002"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9931],{873:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>m});var o=t(5893),i=t(1151);const r={sidebar_position:6},s="Ctheorems",a={id:"integration/ctheorems",title:"Ctheorems",description:"Touying \u80fd\u591f\u4e0e ctheorems \u5305\u4e00\u8d77\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 ctheorems \u5305\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/ctheorems.md",sourceDirName:"integration",slug:"/integration/ctheorems",permalink:"/touying/zh/docs/next/integration/ctheorems",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/ctheorems.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/touying/zh/docs/next/integration/codly"},next:{title:"Themes",permalink:"/touying/zh/docs/next/category/themes"}},c={},m=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"ctheorems",children:"Ctheorems"}),"\n",(0,o.jsx)(n.p,{children:"Touying \u80fd\u591f\u4e0e ctheorems \u5305\u4e00\u8d77\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 ctheorems \u5305\u3002"}),"\n",(0,o.jsxs)(n.p,{children:["\u5176\u4e2d\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 ",(0,o.jsx)(n.code,{children:'#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")'})," \u4e3a sections \u548c subsections \u8bbe\u7f6e numbering\u3002"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/ctheorems:1.1.2": *\n\n// Register university theme\n#let s = themes.simple.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc",alt:"image"})})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var o=t(7294);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/c1d231e7.f8986a62.js b/zh/assets/js/c1d231e7.bf9f8f1d.js similarity index 99% rename from zh/assets/js/c1d231e7.f8986a62.js rename to zh/assets/js/c1d231e7.bf9f8f1d.js index 509b9ec50..9caddd1db 100644 --- a/zh/assets/js/c1d231e7.f8986a62.js +++ b/zh/assets/js/c1d231e7.bf9f8f1d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2875],{5804:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>d,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var s=t(5893),i=t(1151);const o={sidebar_position:7},l="\u591a\u6587\u4ef6\u67b6\u6784",c={id:"multi-file",title:"\u591a\u6587\u4ef6\u67b6\u6784",description:"Touying \u6709\u7740\u5982\u540c\u539f\u751f Typst \u6587\u6863\u4e00\u822c\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u4ee5\u53ca\u7e41\u591a\u7684\u53ef\u81ea\u5b9a\u4e49\u914d\u7f6e\u9879\uff0c\u5374\u4e5f\u4ecd\u80fd\u591f\u7ef4\u6301\u7740\u5b9e\u65f6\u7684\u589e\u91cf\u7f16\u8bd1\u6027\u80fd\uff0c\u56e0\u6b64\u5f88\u9002\u5408\u7528\u6765\u7f16\u5199\u5927\u578b slides\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/zh/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\u5168\u5c40\u8bbe\u7f6e",permalink:"/touying/zh/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/zh/docs/next/category/dynamic-slides"}},d={},r=[{value:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",id:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",level:2},{value:"\u591a\u7ae0\u8282",id:"\u591a\u7ae0\u8282",level:2}];function a(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h1,{id:"\u591a\u6587\u4ef6\u67b6\u6784",children:"\u591a\u6587\u4ef6\u67b6\u6784"}),"\n",(0,s.jsx)(e.p,{children:"Touying \u6709\u7740\u5982\u540c\u539f\u751f Typst \u6587\u6863\u4e00\u822c\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u4ee5\u53ca\u7e41\u591a\u7684\u53ef\u81ea\u5b9a\u4e49\u914d\u7f6e\u9879\uff0c\u5374\u4e5f\u4ecd\u80fd\u591f\u7ef4\u6301\u7740\u5b9e\u65f6\u7684\u589e\u91cf\u7f16\u8bd1\u6027\u80fd\uff0c\u56e0\u6b64\u5f88\u9002\u5408\u7528\u6765\u7f16\u5199\u5927\u578b slides\u3002"}),"\n",(0,s.jsx)(e.p,{children:"\u5982\u679c\u4f60\u9700\u8981\u5199\u4e00\u4e2a\u8f83\u5927\u7684 slides\uff0c\u4f8b\u5982\u4e00\u4e2a\u51e0\u5341\u9875\u51e0\u767e\u9875\u7684\u8bfe\u7a0b\u8bb2\u4e49\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b Touying \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"}),"\n",(0,s.jsx)(e.h2,{id:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",children:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb"}),"\n",(0,s.jsxs)(e.p,{children:["\u4e00\u4e2a\u6700\u7b80\u5355\u7684 Touying \u591a\u6587\u4ef6\u67b6\u6784\u5305\u62ec\u4e09\u4e2a\u6587\u4ef6\uff1a\u5168\u5c40\u914d\u7f6e\u6587\u4ef6 ",(0,s.jsx)(e.code,{children:"globals.typ"}),"\u3001\u4e3b\u5165\u53e3\u6587\u4ef6 ",(0,s.jsx)(e.code,{children:"main.typ"})," \u548c\u5b58\u653e\u5185\u5bb9\u7684 ",(0,s.jsx)(e.code,{children:"content.typ"})," \u6587\u4ef6\u3002"]}),"\n",(0,s.jsxs)(e.p,{children:["\u5206\u6210\u4e09\u4e2a\u6587\u4ef6\u662f\u7531\u4e8e\u8981\u8ba9 ",(0,s.jsx)(e.code,{children:"main.typ"})," \u548c ",(0,s.jsx)(e.code,{children:"content.typ"})," \u5747\u53ef\u4ee5\u5f15\u5165 ",(0,s.jsx)(e.code,{children:"globals.typ"}),"\uff0c\u4ece\u800c\u907f\u514d\u5faa\u73af\u5f15\u7528\u3002"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"globals.typ"})," \u53ef\u4ee5\u7528\u4e8e\u5b58\u653e\u4e00\u4e9b\u5168\u5c40\u7684\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u4ee5\u53ca\u5bf9 Touying \u4e3b\u9898\u8fdb\u884c\u521d\u59cb\u5316\uff1a"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"main.typ"})," \u4f5c\u4e3a\u9879\u76ee\u7684\u4e3b\u5165\u53e3\uff0c\u901a\u8fc7\u5bfc\u5165 ",(0,s.jsx)(e.code,{children:"globals.typ"})," \u5e94\u7528 show rules\uff0c\u4ee5\u53ca\u901a\u8fc7 ",(0,s.jsx)(e.code,{children:"#include"})," \u7f6e\u5165 ",(0,s.jsx)(e.code,{children:"content.typ"}),"\u3002"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"content.typ"})," \u4fbf\u662f\u7528\u4e8e\u4e66\u5199\u5177\u4f53\u5185\u5bb9\u7684\u6587\u4ef6\u4e86\u3002"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,s.jsx)(e.h2,{id:"\u591a\u7ae0\u8282",children:"\u591a\u7ae0\u8282"}),"\n",(0,s.jsxs)(e.p,{children:["\u8981\u5b9e\u73b0\u591a\u7ae0\u8282\u4e5f\u5341\u5206\u7b80\u5355\uff0c\u53ea\u9700\u8981\u65b0\u5efa\u4e00\u4e2a ",(0,s.jsx)(e.code,{children:"sections"})," \u76ee\u5f55\uff0c\u5e76\u5c06\u4e0a\u9762\u7684 ",(0,s.jsx)(e.code,{children:"content.typ"})," \u6587\u4ef6\u79fb\u52a8\u81f3 ",(0,s.jsx)(e.code,{children:"sections.typ"})," \u76ee\u5f55\u5373\u53ef\uff0c\u4f8b\u5982"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,s.jsx)(e.p,{children:"\u548c"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,s.jsx)(e.p,{children:"\u8fd9\u6837\uff0c\u60a8\u5c31\u638c\u63e1\u4e86\u5982\u4f55\u4f7f\u7528 Touying \u5b9e\u73b0\u5927\u578b slides \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"})]})}function u(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(a,{...n})}):a(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>c,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 c(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 +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2875],{5804:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>d,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>r});var s=t(5893),i=t(1151);const o={sidebar_position:7},l="\u591a\u6587\u4ef6\u67b6\u6784",c={id:"multi-file",title:"\u591a\u6587\u4ef6\u67b6\u6784",description:"Touying \u6709\u7740\u5982\u540c\u539f\u751f Typst \u6587\u6863\u4e00\u822c\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u4ee5\u53ca\u7e41\u591a\u7684\u53ef\u81ea\u5b9a\u4e49\u914d\u7f6e\u9879\uff0c\u5374\u4e5f\u4ecd\u80fd\u591f\u7ef4\u6301\u7740\u5b9e\u65f6\u7684\u589e\u91cf\u7f16\u8bd1\u6027\u80fd\uff0c\u56e0\u6b64\u5f88\u9002\u5408\u7528\u6765\u7f16\u5199\u5927\u578b slides\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/multi-file.md",sourceDirName:".",slug:"/multi-file",permalink:"/touying/zh/docs/next/multi-file",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/multi-file.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\u5168\u5c40\u8bbe\u7f6e",permalink:"/touying/zh/docs/next/global-settings"},next:{title:"Dynamic Slides",permalink:"/touying/zh/docs/next/category/dynamic-slides"}},d={},r=[{value:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",id:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",level:2},{value:"\u591a\u7ae0\u8282",id:"\u591a\u7ae0\u8282",level:2}];function a(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h1,{id:"\u591a\u6587\u4ef6\u67b6\u6784",children:"\u591a\u6587\u4ef6\u67b6\u6784"}),"\n",(0,s.jsx)(e.p,{children:"Touying \u6709\u7740\u5982\u540c\u539f\u751f Typst \u6587\u6863\u4e00\u822c\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u4ee5\u53ca\u7e41\u591a\u7684\u53ef\u81ea\u5b9a\u4e49\u914d\u7f6e\u9879\uff0c\u5374\u4e5f\u4ecd\u80fd\u591f\u7ef4\u6301\u7740\u5b9e\u65f6\u7684\u589e\u91cf\u7f16\u8bd1\u6027\u80fd\uff0c\u56e0\u6b64\u5f88\u9002\u5408\u7528\u6765\u7f16\u5199\u5927\u578b slides\u3002"}),"\n",(0,s.jsx)(e.p,{children:"\u5982\u679c\u4f60\u9700\u8981\u5199\u4e00\u4e2a\u8f83\u5927\u7684 slides\uff0c\u4f8b\u5982\u4e00\u4e2a\u51e0\u5341\u9875\u51e0\u767e\u9875\u7684\u8bfe\u7a0b\u8bb2\u4e49\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b Touying \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"}),"\n",(0,s.jsx)(e.h2,{id:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb",children:"\u914d\u7f6e\u548c\u5185\u5bb9\u5206\u79bb"}),"\n",(0,s.jsxs)(e.p,{children:["\u4e00\u4e2a\u6700\u7b80\u5355\u7684 Touying \u591a\u6587\u4ef6\u67b6\u6784\u5305\u62ec\u4e09\u4e2a\u6587\u4ef6\uff1a\u5168\u5c40\u914d\u7f6e\u6587\u4ef6 ",(0,s.jsx)(e.code,{children:"globals.typ"}),"\u3001\u4e3b\u5165\u53e3\u6587\u4ef6 ",(0,s.jsx)(e.code,{children:"main.typ"})," \u548c\u5b58\u653e\u5185\u5bb9\u7684 ",(0,s.jsx)(e.code,{children:"content.typ"})," \u6587\u4ef6\u3002"]}),"\n",(0,s.jsxs)(e.p,{children:["\u5206\u6210\u4e09\u4e2a\u6587\u4ef6\u662f\u7531\u4e8e\u8981\u8ba9 ",(0,s.jsx)(e.code,{children:"main.typ"})," \u548c ",(0,s.jsx)(e.code,{children:"content.typ"})," \u5747\u53ef\u4ee5\u5f15\u5165 ",(0,s.jsx)(e.code,{children:"globals.typ"}),"\uff0c\u4ece\u800c\u907f\u514d\u5faa\u73af\u5f15\u7528\u3002"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"globals.typ"})," \u53ef\u4ee5\u7528\u4e8e\u5b58\u653e\u4e00\u4e9b\u5168\u5c40\u7684\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u4ee5\u53ca\u5bf9 Touying \u4e3b\u9898\u8fdb\u884c\u521d\u59cb\u5316\uff1a"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// globals.typ\n#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n\n// as well as some utility functions\n'})}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"main.typ"})," \u4f5c\u4e3a\u9879\u76ee\u7684\u4e3b\u5165\u53e3\uff0c\u901a\u8fc7\u5bfc\u5165 ",(0,s.jsx)(e.code,{children:"globals.typ"})," \u5e94\u7528 show rules\uff0c\u4ee5\u53ca\u901a\u8fc7 ",(0,s.jsx)(e.code,{children:"#include"})," \u7f6e\u5165 ",(0,s.jsx)(e.code,{children:"content.typ"}),"\u3002"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "content.typ"\n'})}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"content.typ"})," \u4fbf\u662f\u7528\u4e8e\u4e66\u5199\u5177\u4f53\u5185\u5bb9\u7684\u6587\u4ef6\u4e86\u3002"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,s.jsx)(e.h2,{id:"\u591a\u7ae0\u8282",children:"\u591a\u7ae0\u8282"}),"\n",(0,s.jsxs)(e.p,{children:["\u8981\u5b9e\u73b0\u591a\u7ae0\u8282\u4e5f\u5341\u5206\u7b80\u5355\uff0c\u53ea\u9700\u8981\u65b0\u5efa\u4e00\u4e2a ",(0,s.jsx)(e.code,{children:"sections"})," \u76ee\u5f55\uff0c\u5e76\u5c06\u4e0a\u9762\u7684 ",(0,s.jsx)(e.code,{children:"content.typ"})," \u6587\u4ef6\u79fb\u52a8\u81f3 ",(0,s.jsx)(e.code,{children:"sections.typ"})," \u76ee\u5f55\u5373\u53ef\uff0c\u4f8b\u5982"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// main.typ\n#import "/globals.typ": *\n\n#show: init\n#show strong: alert\n#show: slides\n\n#include "sections/content.typ"\n// #include "sections/another-section.typ"\n'})}),"\n",(0,s.jsx)(e.p,{children:"\u548c"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-typst",children:'// sections/content.typ\n#import "/globals.typ": *\n\n= The Section\n\n== Slide Title\n\nHello, Touying!\n\n#focus-slide[\n Focus on me.\n]\n'})}),"\n",(0,s.jsx)(e.p,{children:"\u8fd9\u6837\uff0c\u60a8\u5c31\u638c\u63e1\u4e86\u5982\u4f55\u4f7f\u7528 Touying \u5b9e\u73b0\u5927\u578b slides \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"})]})}function u(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(a,{...n})}):a(n)}},1151:(n,e,t)=>{t.d(e,{Z:()=>c,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 c(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/cad84648.b55e6b76.js b/zh/assets/js/cad84648.b13c687b.js similarity index 98% rename from zh/assets/js/cad84648.b55e6b76.js rename to zh/assets/js/cad84648.b13c687b.js index b643d783a..9665a8c9f 100644 --- a/zh/assets/js/cad84648.b55e6b76.js +++ b/zh/assets/js/cad84648.b13c687b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4413],{9860:(n,t,e)=>{e.r(t),e.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>r,toc:()=>l});var i=e(5893),s=e(1151);const o={sidebar_position:1},a="Pinit",r={id:"integration/pinit",title:"Pinit",description:"Pinit \u5305\u5176\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8e\u9875\u9762\u7edd\u5bf9\u5b9a\u4f4d\u4e0e\u57fa\u4e8e\u300c\u56fe\u9489\u300dpins \u76f8\u5bf9\u5b9a\u4f4d\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a slides \u5b9e\u73b0\u7bad\u5934\u6307\u793a\u4e0e\u89e3\u91ca\u8bf4\u660e\u7684\u6548\u679c\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/zh/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/zh/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/zh/docs/next/integration/mitex"}},p={},l=[{value:"\u7b80\u5355\u793a\u4f8b",id:"\u7b80\u5355\u793a\u4f8b",level:2},{value:"\u590d\u6742\u793a\u4f8b",id:"\u590d\u6742\u793a\u4f8b",level:2}];function c(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"})," \u5305\u5176\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8e\u9875\u9762\u7edd\u5bf9\u5b9a\u4f4d\u4e0e\u57fa\u4e8e\u300c\u56fe\u9489\u300dpins \u76f8\u5bf9\u5b9a\u4f4d\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a slides \u5b9e\u73b0\u7bad\u5934\u6307\u793a\u4e0e\u89e3\u91ca\u8bf4\u660e\u7684\u6548\u679c\u3002"]}),"\n",(0,i.jsx)(t.h2,{id:"\u7b80\u5355\u793a\u4f8b",children:"\u7b80\u5355\u793a\u4f8b"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(t.p,{children:["\u53e6\u4e00\u4e2a ",(0,i.jsx)(t.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"\u793a\u4f8b"}),"\uff1a"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(t.h2,{id:"\u590d\u6742\u793a\u4f8b",children:"\u590d\u6742\u793a\u4f8b"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(t.p,{children:"\u4e00\u4e2a\u4e0e Touying \u5171\u540c\u4f7f\u7528\u7684\u793a\u4f8b\uff1a"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:t}={...(0,s.a)(),...n.components};return t?(0,i.jsx)(t,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,t,e)=>{e.d(t,{Z:()=>r,a:()=>a});var i=e(7294);const s={},o=i.createContext(s);function a(n){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof n?n(t):{...t,...n}}),[t,n])}function r(n){let t;return t=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:a(n.components),i.createElement(o.Provider,{value:t},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4413],{9860:(n,t,e)=>{e.r(t),e.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>r,toc:()=>l});var i=e(5893),s=e(1151);const o={sidebar_position:1},a="Pinit",r={id:"integration/pinit",title:"Pinit",description:"Pinit \u5305\u5176\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8e\u9875\u9762\u7edd\u5bf9\u5b9a\u4f4d\u4e0e\u57fa\u4e8e\u300c\u56fe\u9489\u300dpins \u76f8\u5bf9\u5b9a\u4f4d\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a slides \u5b9e\u73b0\u7bad\u5934\u6307\u793a\u4e0e\u89e3\u91ca\u8bf4\u660e\u7684\u6548\u679c\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/touying/zh/docs/next/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/touying/zh/docs/next/category/package-integration"},next:{title:"MiTeX",permalink:"/touying/zh/docs/next/integration/mitex"}},p={},l=[{value:"\u7b80\u5355\u793a\u4f8b",id:"\u7b80\u5355\u793a\u4f8b",level:2},{value:"\u590d\u6742\u793a\u4f8b",id:"\u590d\u6742\u793a\u4f8b",level:2}];function c(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"})," \u5305\u5176\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57fa\u4e8e\u9875\u9762\u7edd\u5bf9\u5b9a\u4f4d\u4e0e\u57fa\u4e8e\u300c\u56fe\u9489\u300dpins \u76f8\u5bf9\u5b9a\u4f4d\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a slides \u5b9e\u73b0\u7bad\u5934\u6307\u793a\u4e0e\u89e3\u91ca\u8bf4\u660e\u7684\u6548\u679c\u3002"]}),"\n",(0,i.jsx)(t.h2,{id:"\u7b80\u5355\u793a\u4f8b",children:"\u7b80\u5355\u793a\u4f8b"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/pinit:0.1.3": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/b17f9b80-5a8b-4943-a222-bcb0eb38611d",alt:"image"})}),"\n",(0,i.jsxs)(t.p,{children:["\u53e6\u4e00\u4e2a ",(0,i.jsx)(t.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"\u793a\u4f8b"}),"\uff1a"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(t.h2,{id:"\u590d\u6742\u793a\u4f8b",children:"\u590d\u6742\u793a\u4f8b"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/7fb0095a-fd86-49ec-af95-15bc81a341c2",alt:"image"})}),"\n",(0,i.jsx)(t.p,{children:"\u4e00\u4e2a\u4e0e Touying \u5171\u540c\u4f7f\u7528\u7684\u793a\u4f8b\uff1a"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/pinit:0.1.3": *\n\n#(s.page-args.paper = "presentation-4-3")\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n// Main body\n#slide(self => [\n #let (uncover, only) = utils.methods(self)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))\n #only("8-", pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ])\n])\n'})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f36a026f-491c-4290-90d5-0aa3c2086567",alt:"image"})})]})}function d(n={}){const{wrapper:t}={...(0,s.a)(),...n.components};return t?(0,i.jsx)(t,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},1151:(n,t,e)=>{e.d(t,{Z:()=>r,a:()=>a});var i=e(7294);const s={},o=i.createContext(s);function a(n){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof n?n(t):{...t,...n}}),[t,n])}function r(n){let t;return t=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:a(n.components),i.createElement(o.Provider,{value:t},n.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/ce05be13.d146487d.js b/zh/assets/js/ce05be13.0aaa020d.js similarity index 98% rename from zh/assets/js/ce05be13.d146487d.js rename to zh/assets/js/ce05be13.0aaa020d.js index 3fec4fa75..6008f97ee 100644 --- a/zh/assets/js/ce05be13.d146487d.js +++ b/zh/assets/js/ce05be13.0aaa020d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7838],{8349:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>a,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/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/metropolis"},next:{title:"University \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/university"}},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 h(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/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",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.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,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.4.0": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function 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:()=>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 +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7838],{8349:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>a,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/next/themes/dewdrop",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/dewdrop.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/metropolis"},next:{title:"University \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/university"}},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 h(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/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba",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.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: "sidebar",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"2"}),"\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.jsxs)(n.p,{children:["PS: \u5176\u4e2d outline title \u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.outline-title = [Outline])"})," \u7684\u65b9\u5f0f\u4fee\u6539\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,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.4.1": *\n\n#let s = themes.dewdrop.register(\n aspect-ratio: "16-9",\n footer: [Dewdrop],\n navigation: "mini-slides",\n // navigation: none,\n)\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Section A\n\n== Subsection A.1\n\n#slide[\n A slide with equation:\n\n $ x_(n+1) = (x_n + a/x_n) / 2 $\n]\n\n== Subsection A.2\n\n#slide[\n A slide without a title but with *important* infos\n]\n\n= Section B\n\n== Subsection B.1\n\n#slide[\n #lorem(80)\n]\n\n#focus-slide[\n Wake up!\n]\n\n== Subsection B.2\n\n#slide[\n We can use `#pause` to #pause display something later.\n\n #pause\n \n Just like this.\n\n #meanwhile\n \n Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n]\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n= Appendix\n\n=== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})})]})}function 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:()=>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/cf8983c6.1aa64ff4.js b/zh/assets/js/cf8983c6.c3daa6dd.js similarity index 98% rename from zh/assets/js/cf8983c6.1aa64ff4.js rename to zh/assets/js/cf8983c6.c3daa6dd.js index 2908d0ac9..592315288 100644 --- a/zh/assets/js/cf8983c6.1aa64ff4.js +++ b/zh/assets/js/cf8983c6.c3daa6dd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1182],{2293:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying \u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/zh/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/zh/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/zh/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1182],{2293:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var i=t(5893),r=t(1151);const o={sidebar_position:4},s="Fletcher",c={id:"integration/fletcher",title:"Fletcher",description:"Touying \u63d0\u4f9b\u4e86 touying-reducer\uff0c\u5b83\u80fd\u4e3a fletcher \u52a0\u5165 pause \u548c meanwhile \u52a8\u753b\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md",sourceDirName:"integration",slug:"/integration/fletcher",permalink:"/touying/zh/docs/next/integration/fletcher",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/fletcher.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"CeTZ",permalink:"/touying/zh/docs/next/integration/cetz"},next:{title:"Codly",permalink:"/touying/zh/docs/next/integration/codly"}},d={},a=[];function l(e){const n={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"fletcher",children:"Fletcher"}),"\n",(0,i.jsxs)(n.p,{children:["Touying \u63d0\u4f9b\u4e86 ",(0,i.jsx)(n.code,{children:"touying-reducer"}),"\uff0c\u5b83\u80fd\u4e3a fletcher \u52a0\u5165 ",(0,i.jsx)(n.code,{children:"pause"})," \u548c ",(0,i.jsx)(n.code,{children:"meanwhile"})," \u52a8\u753b\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u4e00\u4e2a\u4f8b\u5b50\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides.with(title-slide: false, outline-slide: false)\n\n// cetz animation\n#slide[\n Cetz in Touying:\n\n #cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n })\n]\n\n// fletcher animation\n#slide[\n Fletcher in Touying:\n\n #fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n )\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9ba71f54-2a5d-4144-996c-4a42833cc5cc",alt:"image"})})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/d21a173f.cc1ad8e5.js b/zh/assets/js/d21a173f.7cd6da87.js similarity index 98% rename from zh/assets/js/d21a173f.cc1ad8e5.js rename to zh/assets/js/d21a173f.7cd6da87.js index b94d72bb1..1718e834b 100644 --- a/zh/assets/js/d21a173f.cc1ad8e5.js +++ b/zh/assets/js/d21a173f.7cd6da87.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5658],{5086:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const r={sidebar_position:2},o="\u5f00\u59cb",a={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 Tinymist 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/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Touying \u4ecb\u7ecd",permalink:"/touying/zh/docs/next/intro"},next:{title:"\u8282\u4e0e\u5c0f\u8282",permalink:"/touying/zh/docs/next/sections"}},l={},d=[{value:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u5f00\u59cb",children:"\u5f00\u59cb"}),"\n",(0,i.jsxs)(n.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,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," \u6216 VS Code \u7684 ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," \u548c ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," \u63d2\u4ef6\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u8981\u4f7f\u7528 Touying\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u91cc\u52a0\u5165"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u5f88\u7b80\u5355\uff0c\u60a8\u521b\u5efa\u4e86\u60a8\u7684\u7b2c\u4e00\u4e2a Touying slides\uff0c\u606d\u559c\uff01\ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"\u63d0\u793a:"})," \u4f60\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," \u6216 ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," \u7b49 Typst \u8bed\u6cd5\u6765\u5b9e\u73b0 Touying \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"\u8b66\u544a:"})," ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u91cc\u7684\u9017\u53f7\u5bf9\u4e8e\u89e3\u5305\u8bed\u6cd5\u6765\u8bf4\u662f\u5fc5\u8981\u7684\uff01"]}),"\n",(0,i.jsx)(n.h2,{id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",children:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0cTouying \u63d0\u4f9b\u4e86\u591a\u79cd slides \u7f16\u5199\u98ce\u683c\uff0c\u5b9e\u9645\u4e0a\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.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,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying \u63d0\u4f9b\u4e86\u5f88\u591a\u5185\u7f6e\u7684\u4e3b\u9898\uff0c\u80fd\u591f\u7b80\u5355\u5730\u7f16\u5199\u7cbe\u7f8e\u7684 slides\uff0c\u4f8b\u5982\u6b64\u5904\u7684"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u53ef\u4ee5\u4f7f\u7528 university \u4e3b\u9898\u3002\u5173\u4e8e\u4e3b\u9898\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\uff0c\u60a8\u53ef\u4ee5\u53c2\u9605\u540e\u9762\u7684\u7ae0\u8282\u3002"})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5658],{5086:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const r={sidebar_position:2},o="\u5f00\u59cb",a={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 Tinymist 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/next/start",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/start.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Touying \u4ecb\u7ecd",permalink:"/touying/zh/docs/next/intro"},next:{title:"\u8282\u4e0e\u5c0f\u8282",permalink:"/touying/zh/docs/next/sections"}},l={},d=[{value:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"\u5f00\u59cb",children:"\u5f00\u59cb"}),"\n",(0,i.jsxs)(n.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,i.jsx)(n.a,{href:"https://typst.app/",children:"Web App"})," \u6216 VS Code \u7684 ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist",children:"Tinymist LSP"})," \u548c ",(0,i.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview",children:"Typst Preview"})," \u63d2\u4ef6\u3002"]}),"\n",(0,i.jsx)(n.p,{children:"\u8981\u4f7f\u7528 Touying\uff0c\u60a8\u53ea\u9700\u8981\u5728\u6587\u6863\u91cc\u52a0\u5165"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register()\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"\u8fd9\u5f88\u7b80\u5355\uff0c\u60a8\u521b\u5efa\u4e86\u60a8\u7684\u7b2c\u4e00\u4e2a Touying slides\uff0c\u606d\u559c\uff01\ud83c\udf89"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"\u63d0\u793a:"})," \u4f60\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.code,{children:'#import "config.typ": *'})," \u6216 ",(0,i.jsx)(n.code,{children:'#include "content.typ"'})," \u7b49 Typst \u8bed\u6cd5\u6765\u5b9e\u73b0 Touying \u7684\u591a\u6587\u4ef6\u67b6\u6784\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"\u8b66\u544a:"})," ",(0,i.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u91cc\u7684\u9017\u53f7\u5bf9\u4e8e\u89e3\u5305\u8bed\u6cd5\u6765\u8bf4\u662f\u5fc5\u8981\u7684\uff01"]}),"\n",(0,i.jsx)(n.h2,{id:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50",children:"\u66f4\u590d\u6742\u7684\u4f8b\u5b50"}),"\n",(0,i.jsxs)(n.p,{children:["\u4e8b\u5b9e\u4e0a\uff0cTouying \u63d0\u4f9b\u4e86\u591a\u79cd slides \u7f16\u5199\u98ce\u683c\uff0c\u5b9e\u9645\u4e0a\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528 ",(0,i.jsx)(n.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,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/cetz:0.2.2"\n#import "@preview/fletcher:0.4.4" as fletcher: node, edge\n#import "@preview/ctheorems:1.1.2": *\n\n// cetz and fletcher bindings for touying\n#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))\n#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)\n\n// Register university theme\n// You can replace it with other themes and it can still work normally\n#let s = themes.university.register(aspect-ratio: "16-9")\n\n// Set the numbering of section and subsection\n#let s = (s.methods.numbering)(self: s, section: "1.", "1.1")\n\n// Global information configuration\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n\n// Pdfpc configuration\n// typst query --root . ./example.typ --field value --one "" > ./example.pdfpc\n#let s = (s.methods.append-preamble)(self: s, pdfpc.config(\n duration-minutes: 30,\n start-time: datetime(hour: 14, minute: 10, second: 0),\n end-time: datetime(hour: 14, minute: 40, second: 0),\n last-minutes: 5,\n note-font-size: 12,\n disable-markdown: false,\n default-transition: (\n type: "push",\n duration-seconds: 2,\n angle: ltr,\n alignment: "vertical",\n direction: "inward",\n ),\n))\n\n// Theroems configuration by ctheorems\n#show: thmrules.with(qed-symbol: $square$)\n#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))\n#let corollary = thmplain(\n "corollary",\n "Corollary",\n base: "theorem",\n titlefmt: strong\n)\n#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))\n#let example = thmplain("example", "Example").with(numbering: none)\n#let proof = thmproof("proof", "Proof")\n\n// Extract methods\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n// Extract slide functions\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n= Animation\n\n== Simple Animation\n\nWe can use `#pause` to #pause display something later.\n\n#pause\n\nJust like this.\n\n#meanwhile\n\nMeanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.\n\n\n== Complex Animation\n\n#slide(repeat: 3, self => [\n #let (uncover, only, alternatives) = utils.methods(self)\n\n At subslide #self.subslide, we can\n\n use #uncover("2-")[`#uncover` function] for reserving space,\n\n use #only("2-")[`#only` function] for not reserving space,\n\n #alternatives[call `#only` multiple times \\u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.\n])\n\n\n== Math Equation Animation\n\nTouying equation with `pause`:\n\n#touying-equation(`\n f(x) &= pause x^2 + 2x + 1 \\\n &= pause (x + 1)^2 \\\n`)\n\n#meanwhile\n\nHere, #pause we have the expression of $f(x)$.\n\n#pause\n\nBy factorizing, we can obtain this result.\n\n\n== CeTZ Animation\n\nCeTZ Animation in Touying:\n\n#cetz-canvas({\n import cetz.draw: *\n \n rect((0,0), (5,5))\n\n (pause,)\n\n rect((0,0), (1,1))\n rect((1,1), (2,2))\n rect((2,2), (3,3))\n\n (pause,)\n\n line((0,0), (2.5, 2.5), name: "line")\n})\n\n\n== Fletcher Animation\n\nFletcher Animation in Touying:\n\n#fletcher-diagram(\n node-stroke: .1em,\n node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),\n spacing: 4em,\n edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),\n node((0,0), `reading`, radius: 2em),\n edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),\n pause,\n edge(`read()`, "-|>"),\n node((1,0), `eof`, radius: 2em),\n pause,\n edge(`close()`, "-|>"),\n node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),\n edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),\n)\n\n\n= Theroems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#theorem("Euclid")[\n There are infinitely many primes.\n]\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] \n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere\n $\n]\n\n\n= Others\n\n== Side-by-side\n\n#slide(composer: (1fr, 1fr))[\n First column.\n][\n Second column.\n]\n\n\n== Multiple Pages\n\n#lorem(200)\n\n\n// appendix by freezing last-slide-number\n#let s = (s.methods.appendix)(self: s)\n#let (slide, empty-slide) = utils.slides(s)\n\n== Appendix\n\n#slide[\n Please pay attention to the current slide number.\n]\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694",alt:"image"})}),"\n",(0,i.jsx)(n.p,{children:"Touying \u63d0\u4f9b\u4e86\u5f88\u591a\u5185\u7f6e\u7684\u4e3b\u9898\uff0c\u80fd\u591f\u7b80\u5355\u5730\u7f16\u5199\u7cbe\u7f8e\u7684 slides\uff0c\u4f8b\u5982\u6b64\u5904\u7684"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'#let s = themes.university.register(aspect-ratio: "16-9")\n'})}),"\n",(0,i.jsx)(n.p,{children:"\u53ef\u4ee5\u4f7f\u7528 university \u4e3b\u9898\u3002\u5173\u4e8e\u4e3b\u9898\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\uff0c\u60a8\u53ef\u4ee5\u53c2\u9605\u540e\u9762\u7684\u7ae0\u8282\u3002"})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/d5c687ae.f3c48789.js b/zh/assets/js/d5c687ae.ed5869dd.js similarity index 97% rename from zh/assets/js/d5c687ae.f3c48789.js rename to zh/assets/js/d5c687ae.ed5869dd.js index 7bbf4a643..823d18ed5 100644 --- a/zh/assets/js/d5c687ae.f3c48789.js +++ b/zh/assets/js/d5c687ae.ed5869dd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5455],{5489:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=n(5893),s=n(1151);const i={sidebar_position:5},r="Codly",c={id:"integration/codly",title:"Codly",description:"\u5728\u4f7f\u7528 codly \u7684\u65f6\u5019\uff0c\u6211\u4eec\u5e94\u8be5\u4f7f\u7528 s.methods.append-preamble \u65b9\u6cd5\u8fdb\u884c\u521d\u59cb\u5316\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/zh/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/zh/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/zh/docs/next/integration/ctheorems"}},l={},d=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,o.jsxs)(t.p,{children:["\u5728\u4f7f\u7528 codly \u7684\u65f6\u5019\uff0c\u6211\u4eec\u5e94\u8be5\u4f7f\u7528 ",(0,o.jsx)(t.code,{children:"s.methods.append-preamble"})," \u65b9\u6cd5\u8fdb\u884c\u521d\u59cb\u5316\u3002"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>c,a:()=>r});var o=n(7294);const s={},i=o.createContext(s);function r(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5455],{5489:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=n(5893),s=n(1151);const i={sidebar_position:5},r="Codly",c={id:"integration/codly",title:"Codly",description:"\u5728\u4f7f\u7528 codly \u7684\u65f6\u5019\uff0c\u6211\u4eec\u5e94\u8be5\u4f7f\u7528 s.methods.append-preamble \u65b9\u6cd5\u8fdb\u884c\u521d\u59cb\u5316\u3002",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/integration/codly.md",sourceDirName:"integration",slug:"/integration/codly",permalink:"/touying/zh/docs/next/integration/codly",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/integration/codly.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Fletcher",permalink:"/touying/zh/docs/next/integration/fletcher"},next:{title:"Ctheorems",permalink:"/touying/zh/docs/next/integration/ctheorems"}},l={},d=[];function a(e){const t={code:"code",h1:"h1",img:"img",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"codly",children:"Codly"}),"\n",(0,o.jsxs)(t.p,{children:["\u5728\u4f7f\u7528 codly \u7684\u65f6\u5019\uff0c\u6211\u4eec\u5e94\u8be5\u4f7f\u7528 ",(0,o.jsx)(t.code,{children:"s.methods.append-preamble"})," \u65b9\u6cd5\u8fdb\u884c\u521d\u59cb\u5316\u3002"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/codly:0.2.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9")\n#let s = (s.methods.append-preamble)(self: s)[\n #codly(languages: (\n rust: (name: "Rust", icon: "\\u{fa53}", color: rgb("#CE412B")),\n ))\n]\n#let (init, slides) = utils.methods(s)\n#show heading.where(level: 2): set block(below: 1em)\n#show: init\n#show: codly-init.with()\n\n#let (slide, empty-slide) = utils.slides(s)\n#show: slides\n\n#slide[\n == First slide\n\n #raw(lang: "rust", block: true,\n`pub fn main() {\n println!("Hello, world!");\n}`.text)\n]\n'})}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{src:"https://github.com/touying-typ/touying/assets/34951714/0be2fbaf-cc03-4776-932f-259503d5e23a",alt:"image"})})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>c,a:()=>r});var o=n(7294);const s={},i=o.createContext(s);function r(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/df8eaafd.cabf2352.js b/zh/assets/js/df8eaafd.ae76ca45.js similarity index 98% rename from zh/assets/js/df8eaafd.cabf2352.js rename to zh/assets/js/df8eaafd.ae76ca45.js index b4d93634b..3f7e2d514 100644 --- a/zh/assets/js/df8eaafd.cabf2352.js +++ b/zh/assets/js/df8eaafd.ae76ca45.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7146],{3484:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>a,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:4},r="University \u4e3b\u9898",d={id:"themes/university",title:"University \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/zh/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/dewdrop"},next:{title:"Aqua \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/aqua"}},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:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function h(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:"university-\u4e3b\u9898",children:"University \u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u7f8e\u89c2\u7684\u4e3b\u9898\u6765\u81ea ",(0,i.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"\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.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"progress-bar"}),": \u662f\u5426\u663e\u793a slide \u9876\u90e8\u7684\u8fdb\u5ea6\u6761\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"display-current-section"}),": \u662f\u5426\u663e\u793a\u5f53\u524d\u8282\u6807\u9898\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-columns"}),": \u5e95\u90e8\u4e09\u680f Footer \u7684\u5bbd\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-a"}),": \u7b2c\u4e00\u680f\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-b"}),": \u7b2c\u4e8c\u680f\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-c"}),": \u7b2c\u4e09\u680f\uff0c\u9ed8\u8ba4\u4e3a"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 University \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:"University \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 primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\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:"University \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(logo: none, authors: 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:"logo"})," \u53c2\u6570\u548c array \u7c7b\u578b\u7684 ",(0,i.jsx)(n.code,{children:"authors"})," \u53c2\u6570\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 // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,i.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,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u9ed8\u8ba4\u80cc\u666f\u8272\u4e3a ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),"\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u53ef\u4ee5\u53c2\u8003 ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"\u6587\u6863"}),"\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",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.4.0": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function 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:()=>d,a:()=>r});var i=s(7294);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7146],{3484:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>a,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=s(5893),t=s(1151);const l={sidebar_position:4},r="University \u4e3b\u9898",d={id:"themes/university",title:"University \u4e3b\u9898",description:"image",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/themes/university.md",sourceDirName:"themes",slug:"/themes/university",permalink:"/touying/zh/docs/next/themes/university",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/university.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Dewdrop \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/dewdrop"},next:{title:"Aqua \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/aqua"}},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:"slides \u51fd\u6570",id:"slides-\u51fd\u6570",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function h(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:"university-\u4e3b\u9898",children:"University \u4e3b\u9898"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c",alt:"image"})}),"\n",(0,i.jsxs)(n.p,{children:["\u8fd9\u4e2a\u7f8e\u89c2\u7684\u4e3b\u9898\u6765\u81ea ",(0,i.jsx)(n.a,{href:"https://github.com/drupol",children:"Pol Dellaiera"}),"\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.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,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:"progress-bar"}),": \u662f\u5426\u663e\u793a slide \u9876\u90e8\u7684\u8fdb\u5ea6\u6761\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"true"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"display-current-section"}),": \u662f\u5426\u663e\u793a\u5f53\u524d\u8282\u6807\u9898\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-columns"}),": \u5e95\u90e8\u4e09\u680f Footer \u7684\u5bbd\u5ea6\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"(25%, 1fr, 25%)"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-a"}),": \u7b2c\u4e00\u680f\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"self => self.info.author"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-b"}),": \u7b2c\u4e8c\u680f\uff0c\u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }"}),"\u3002"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"footer-c"}),": \u7b2c\u4e09\u680f\uff0c\u9ed8\u8ba4\u4e3a"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'self => {\n h(1fr)\n utils.info-date(self)\n h(1fr)\n states.slide-counter.display() + " / " + states.last-slide-number\n h(1fr)\n}\n'})}),"\n",(0,i.jsxs)(n.p,{children:["\u5e76\u4e14 University \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:"University \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 primary: rgb("#04364A"),\n secondary: rgb("#176B87"),\n tertiary: rgb("#448C95"),\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:"University \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(logo: none, authors: 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:"logo"})," \u53c2\u6570\u548c array \u7c7b\u578b\u7684 ",(0,i.jsx)(n.code,{children:"authors"})," \u53c2\u6570\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 // university theme\n title: none,\n subtitle: none,\n header: none,\n footer: auto,\n)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u9ed8\u8ba4\u62e5\u6709\u6807\u9898\u548c\u9875\u811a\u7684\u666e\u901a slide \u51fd\u6570\uff0c\u5176\u4e2d ",(0,i.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,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#focus-slide(background-img: ..., background-color: ...)[\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u7528\u4e8e\u5f15\u8d77\u89c2\u4f17\u7684\u6ce8\u610f\u529b\u3002\u9ed8\u8ba4\u80cc\u666f\u8272\u4e3a ",(0,i.jsx)(n.code,{children:"self.colors.primary"}),"\u3002"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#new-section-slide(short-title: auto, title)\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u7528\u7ed9\u5b9a\u6807\u9898\u5f00\u542f\u4e00\u4e2a\u65b0\u7684 section\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:"#matrix-slide(columns: ..., rows: ...)[\n ...\n][\n ...\n]\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\u53ef\u4ee5\u53c2\u8003 ",(0,i.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/university.html",children:"\u6587\u6863"}),"\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:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(n.code,{children:"1"}),"\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.jsxs)(n.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(n.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(n.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/58971045-0b0d-46cb-acc2-caf766c2432d",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.4.1": *\n\n#let s = themes.university.register(aspect-ratio: "16-9")\n#let s = (s.methods.info)(\n self: s,\n title: [Title],\n subtitle: [Subtitle],\n author: [Authors],\n date: datetime.today(),\n institution: [Institution],\n)\n#let (init, slides, touying-outline, alert) = utils.methods(s)\n#show: init\n\n#show strong: alert\n\n#let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)\n#show: slides.with(title-slide: false)\n\n#title-slide(authors: ([Author A], [Author B]))\n\n= The Section\n\n== Slide Title\n\n#slide[\n #lorem(40)\n]\n\n#slide(subtitle: emph[What is the problem?])[\n #lorem(40)\n]\n\n#focus-slide[\n Another variant with primary color in background...\n]\n\n#matrix-slide[\n left\n][\n middle\n][\n right\n]\n\n#matrix-slide(columns: 1)[\n top\n][\n bottom\n]\n\n#matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)\n'})})]})}function 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:()=>d,a:()=>r});var i=s(7294);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/eb154561.3748b647.js b/zh/assets/js/eb154561.c8a2a8cd.js similarity index 97% rename from zh/assets/js/eb154561.3748b647.js rename to zh/assets/js/eb154561.c8a2a8cd.js index 3226a203b..d89f59d2f 100644 --- a/zh/assets/js/eb154561.3748b647.js +++ b/zh/assets/js/eb154561.c8a2a8cd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7059],{1873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>d,default:()=>a,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=n(5893),t=n(1151);const l={sidebar_position:1},d="Simple \u4e3b\u9898",o={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/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/zh/docs/next/category/themes"},next:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/metropolis"}},r={},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 h(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.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(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.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"1"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(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.4.0": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function a(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>o,a:()=>d});var i=n(7294);const t={},l=i.createContext(t);function d(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:d(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7059],{1873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>d,default:()=>a,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=n(5893),t=n(1151);const l={sidebar_position:1},d="Simple \u4e3b\u9898",o={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/next/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/touying/zh/docs/next/category/themes"},next:{title:"Metropolis \u4e3b\u9898",permalink:"/touying/zh/docs/next/themes/metropolis"}},r={},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 h(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.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n'})}),"\n",(0,i.jsxs)(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.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"slides"})," \u51fd\u6570\u62e5\u6709\u53c2\u6570"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"slide-level"}),": \u9ed8\u8ba4\u4e3a ",(0,i.jsx)(s.code,{children:"1"}),"\u3002"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#show: slides.with(..)"})," \u7684\u65b9\u5f0f\u8bbe\u7f6e\u3002"]}),"\n",(0,i.jsxs)(s.p,{children:["\u4ee5\u53ca\u53ef\u4ee5\u901a\u8fc7 ",(0,i.jsx)(s.code,{children:"#(s.methods.touying-new-section-slide = none)"})," \u7684\u65b9\u5f0f\u5173\u95ed\u81ea\u52a8\u52a0\u5165 ",(0,i.jsx)(s.code,{children:"new-section-slide"})," \u7684\u529f\u80fd\u3002"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let s = (s.methods.enable-transparent-cover)(self: s)\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n= Title\n\n== First Slide\n\nHello, Touying!\n\n#pause\n\nHello, Typst!\n'})}),"\n",(0,i.jsx)(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.4.1": *\n\n#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])\n#let (init, slides) = utils.methods(s)\n#show: init\n\n#let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)\n#show: slides\n\n#title-slide[\n = Keep it simple!\n #v(2em)\n\n Alpha #footnote[Uni Augsburg] #h(1em)\n Bravo #footnote[Uni Bayreuth] #h(1em)\n Charlie #footnote[Uni Chemnitz] #h(1em)\n\n July 23\n]\n\n== First slide\n\n#slide[\n #lorem(20)\n]\n\n#focus-slide[\n _Focus!_\n\n This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\n#slide[\n Did you know that...\n\n #pause\n\n ...you can see the current section at the top of the slide?\n]\n'})})]})}function a(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},1151:(e,s,n)=>{n.d(s,{Z:()=>o,a:()=>d});var i=n(7294);const t={},l=i.createContext(t);function d(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:d(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/f6262a69.3858054e.js b/zh/assets/js/f6262a69.761f978e.js similarity index 99% rename from zh/assets/js/f6262a69.3858054e.js rename to zh/assets/js/f6262a69.761f978e.js index b53c47b31..6183a4469 100644 --- a/zh/assets/js/f6262a69.3858054e.js +++ b/zh/assets/js/f6262a69.761f978e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1934],{3282:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>c});var s=t(5893),i=t(1151);const o={sidebar_position:5},r="\u9875\u9762\u5e03\u5c40",d={id:"layout",title:"\u9875\u9762\u5e03\u5c40",description:"\u57fa\u7840\u6982\u5ff5",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/zh/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/next/code-styles"},next:{title:"\u5168\u5c40\u8bbe\u7f6e",permalink:"/touying/zh/docs/next/global-settings"}},a={},c=[{value:"\u57fa\u7840\u6982\u5ff5",id:"\u57fa\u7840\u6982\u5ff5",level:2},{value:"\u9875\u9762\u7ba1\u7406",id:"\u9875\u9762\u7ba1\u7406",level:2},{value:"\u5e94\u7528\uff1a\u6dfb\u52a0 Logo",id:"\u5e94\u7528\u6dfb\u52a0-logo",level:2},{value:"\u9875\u9762\u5206\u680f",id:"\u9875\u9762\u5206\u680f",level:2}];function l(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"\u9875\u9762\u5e03\u5c40",children:"\u9875\u9762\u5e03\u5c40"}),"\n",(0,s.jsx)(n.h2,{id:"\u57fa\u7840\u6982\u5ff5",children:"\u57fa\u7840\u6982\u5ff5"}),"\n",(0,s.jsx)(n.p,{children:"\u8981\u60f3\u4f7f\u7528 Typst \u5236\u4f5c\u4e00\u4e2a\u6837\u5f0f\u7f8e\u89c2\u7684 slides\uff0c\u6b63\u786e\u7406\u89e3 Typst \u7684\u9875\u9762\u6a21\u578b\u662f\u5fc5\u987b\u7684\uff0c\u5982\u679c\u4f60\u4e0d\u5173\u5fc3\u81ea\u5b9a\u4e49\u9875\u9762\u6837\u5f0f\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u8df3\u8fc7\u8fd9\u90e8\u5206\uff0c\u5426\u5219\u8fd8\u662f\u63a8\u8350\u770b\u4e00\u904d\u8fd9\u90e8\u5206\u3002"}),"\n",(0,s.jsx)(n.p,{children:"\u4e0b\u9762\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u6765\u8bf4\u660e Typst \u7684\u9ed8\u8ba4\u9875\u9762\u6a21\u578b\u3002"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"\u6211\u4eec\u9700\u8981\u533a\u5206\u4ee5\u4e0b\u6982\u5ff5\uff1a"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Model:"})," Typst \u62e5\u6709\u4e0e CSS Box Model \u7c7b\u4f3c\u7684\u6a21\u578b\uff0c\u5206\u4e3a Margin\u3001Padding \u548c Content\uff0c\u4f46\u5176\u4e2d padding \u5e76\u975e ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u7684\u5c5e\u6027\uff0c\u800c\u662f\u6211\u4eec\u624b\u52a8\u6dfb\u52a0 ",(0,s.jsx)(n.code,{children:"#pad(..)"})," \u5f97\u5230\u7684\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Margin:"})," \u9875\u8fb9\u8ddd\uff0c\u5206\u4e3a\u4e0a\u4e0b\u5de6\u53f3\u56db\u4e2a\u65b9\u5411\uff0c\u662f Typst \u9875\u9762\u6a21\u578b\u7684\u6838\u5fc3\uff0c\u5176\u4ed6\u5c5e\u6027\u90fd\u4f1a\u53d7\u5230\u9875\u8fb9\u8ddd\u7684\u5f71\u54cd\uff0c\u5c24\u5176\u662f Header \u548c Footer\u3002Header \u548c Footer \u5b9e\u9645\u4e0a\u662f\u4f4d\u4e8e Margin \u5185\u90e8\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Header:"})," Header \u662f\u9875\u9762\u9876\u90e8\u7684\u5185\u5bb9\uff0c\u53c8\u5206\u4e3a container \u548c innerbox\u3002\u6211\u4eec\u53ef\u4ee5\u6ce8\u610f\u5230 header container \u548c padding \u7684\u8fb9\u7f18\u5e76\u4e0d\u8d34\u5408\uff0c\u800c\u662f\u4e5f\u6709\u4e00\u5b9a\u7684\u7a7a\u9699\uff0c\u8fd9\u4e2a\u7a7a\u9699\u5b9e\u9645\u4e0a\u5c31\u662f ",(0,s.jsx)(n.code,{children:"header-ascent: 30%"}),"\uff0c\u800c\u8fd9\u91cc\u7684\u767e\u5206\u6bd4\u662f\u76f8\u5bf9\u4e8e margin-top \u800c\u8a00\u7684\u3002\u5e76\u4e14\uff0c\u6211\u4eec\u6ce8\u610f\u5230 header innerbox \u5b9e\u9645\u4e0a\u4f4d\u4e8e header container \u5de6\u4e0b\u89d2\uff0c\u4e5f\u5373 innerbox \u5b9e\u9645\u4e0a\u9ed8\u8ba4\u6709\u5c5e\u6027 ",(0,s.jsx)(n.code,{children:"#set align(left + bottom)"}),"\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Footer:"})," Footer \u662f\u9875\u9762\u5e95\u90e8\u7684\u5185\u5bb9\uff0c\u4e0e Header \u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u65b9\u5411\u76f8\u53cd\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Place:"})," ",(0,s.jsx)(n.code,{children:"place"})," \u51fd\u6570\u53ef\u4ee5\u5b9e\u73b0\u7edd\u5bf9\u5b9a\u4f4d\uff0c\u5728\u4e0d\u5f71\u54cd\u7236\u5bb9\u5668\u5185\u5176\u4ed6\u5143\u7d20\u7684\u60c5\u51b5\u4e0b\uff0c\u76f8\u5bf9\u4e8e\u7236\u5bb9\u5668\u6765\u5b9a\u4f4d\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f20\u5165 ",(0,s.jsx)(n.code,{children:"alignment"}),"\u3001",(0,s.jsx)(n.code,{children:"dx"})," \u548c ",(0,s.jsx)(n.code,{children:"dy"}),"\uff0c\u5f88\u9002\u5408\u7528\u6765\u653e\u7f6e\u4e00\u4e9b\u4fee\u9970\u5143\u7d20\uff0c\u4f8b\u5982 Logo \u4e4b\u7c7b\u7684\u56fe\u7247\u3002"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"\u56e0\u6b64\uff0c\u8981\u5c06 Typst \u5e94\u7528\u5230\u5236\u4f5c slides \u4e0a\uff0c\u6211\u4eec\u53ea\u9700\u8981\u8bbe\u7f6e"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"\u5373\u53ef\u3002\u4f46\u662f\u6211\u4eec\u8fd8\u9700\u8981\u89e3\u51b3 header \u5982\u4f55\u5360\u636e\u6574\u4e2a\u9875\u9762\u5bbd\u5ea6\u7684\u95ee\u9898\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528 negative padding \u5b9e\u73b0\uff0c\u4f8b\u5982\u6211\u4eec\u6709"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"\u9875\u9762\u7ba1\u7406",children:"\u9875\u9762\u7ba1\u7406"}),"\n",(0,s.jsxs)(n.p,{children:["\u7531\u4e8e Typst \u4e2d\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\u6765\u4fee\u6539\u9875\u9762\u53c2\u6570\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\u7ef4\u62a4\u4e00\u4e2a ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u548c\u4e00\u4e2a ",(0,s.jsx)(n.code,{children:"s.padding"})," \u6210\u5458\u53d8\u91cf\uff0c\u53ea\u5728 Touying \u81ea\u5df1\u521b\u5efa\u65b0 slide \u65f6\u624d\u4f1a\u81ea\u5df1\u5e94\u7528\u8fd9\u4e9b\u53c2\u6570\uff0c\u56e0\u6b64\u7528\u6237\u53ea\u9700\u8981\u5173\u6ce8 ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u548c ",(0,s.jsx)(n.code,{children:"s.padding"})," \u5373\u53ef\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u4f8b\u5b50\u5c31\u53ef\u4ee5\u6539\u6210"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Touying \u4f1a\u81ea\u52a8\u68c0\u6d4b ",(0,s.jsx)(n.code,{children:"margin.x"})," \u7684\u503c\uff0c\u5e76\u4e14\u5224\u65ad\u5982\u679c ",(0,s.jsx)(n.code,{children:"self.full-header == true"}),"\uff0c\u5c31\u4f1a\u81ea\u52a8\u4e3a header \u52a0\u5165\u8d1f\u586b\u5145\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u540c\u7406\uff0c\u5982\u679c\u4f60\u5bf9\u67d0\u4e2a\u4e3b\u9898\u7684 header \u6216 footer \u6837\u5f0f\u4e0d\u6ee1\u610f\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,s.jsxs)(n.p,{children:["\u8fd9\u6837\u65b9\u5f0f\u8fdb\u884c\u66f4\u6362\u3002\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u8fd9\u6837\u66f4\u6362\u4e86\u9875\u9762\u53c2\u6570\uff0c\u4f60\u9700\u8981\u5c06\u5176\u653e\u5728 ",(0,s.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u4e4b\u524d\uff0c\u5426\u5219\u5c31\u9700\u8981\u91cd\u65b0\u8c03\u7528 ",(0,s.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),"\u3002"]}),"\n",(0,s.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,s.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u4f60\u4e0d\u5e94\u8be5\u81ea\u5df1\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,s.jsx)(n.code,{children:"s"})," \u5185\u90e8\u7684 ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u3002"]})}),"\n",(0,s.jsxs)(n.p,{children:["\u501f\u52a9\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",(0,s.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,s.jsx)(n.code,{children:"transparent-cover"}),"\u3002\u8fd9\u91cc\u5c31\u90e8\u5206\u7b49\u4ef7\u4e8e context get rule\uff0c\u800c\u4e14\u5b9e\u9645\u4e0a\u7528\u8d77\u6765\u4f1a\u66f4\u65b9\u4fbf\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u5e94\u7528\u6dfb\u52a0-logo",children:"\u5e94\u7528\uff1a\u6dfb\u52a0 Logo"}),"\n",(0,s.jsxs)(n.p,{children:["\u4e3a slides \u6dfb\u52a0\u4e00\u4e2a Logo \u662f\u53ca\u5176\u666e\u904d\uff0c\u4f46\u662f\u53c8\u53ca\u5176\u591a\u53d8\u7684\u4e00\u4e2a\u9700\u6c42\u3002\u5176\u4e2d\u7684\u96be\u70b9\u5728\u4e8e\uff0c\u6240\u9700\u8981\u7684 Logo \u5927\u5c0f\u548c\u4f4d\u7f6e\u5f80\u5f80\u56e0\u4eba\u800c\u5f02\u3002\u56e0\u6b64\uff0cTouying \u7684\u4e3b\u9898\u5927\u90e8\u5206\u90fd\u4e0d\u5305\u542b Logo \u7684\u914d\u7f6e\u9009\u9879\u3002\u4f46\u501f\u52a9\u672c\u7ae0\u8282\u63d0\u5230\u7684\u9875\u9762\u5e03\u5c40\u7684\u6982\u5ff5\uff0c\u6211\u4eec\u77e5\u9053\u53ef\u4ee5\u5728 header \u6216 footer \u4e2d\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"place"})," \u51fd\u6570\u6765\u653e\u7f6e Logo \u56fe\u7247\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u4f8b\u5982\uff0c\u6211\u4eec\u51b3\u5b9a\u7ed9 metropolis \u4e3b\u9898\u52a0\u5165 GitHub \u7684\u56fe\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u5b9e\u73b0\uff1a"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.0": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo to top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,s.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," \u53ef\u4ee5\u7528\u4e8e\u663e\u793a ",(0,s.jsx)(n.code,{children:"body"})," \u4e3a content \u6216 ",(0,s.jsx)(n.code,{children:"body"})," \u4e3a\u5f62\u5982 ",(0,s.jsx)(n.code,{children:"self => content"})," \u5f62\u5f0f\u7684\u56de\u8c03\u51fd\u6570\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u9875\u9762\u5206\u680f",children:"\u9875\u9762\u5206\u680f"}),"\n",(0,s.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,s.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u9ed8\u8ba4\u63d0\u4f9b\u7684 ",(0,s.jsx)(n.code,{children:"compose"})," \u529f\u80fd\uff0c\u6700\u7b80\u5355\u7684\u793a\u4f8b\u5982\u4e0b\uff1a"]}),"\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:["\u5982\u679c\u4f60\u9700\u8981\u66f4\u6539\u5206\u680f\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539 ",(0,s.jsx)(n.code,{children:"slide"})," \u7684 ",(0,s.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5176\u4e2d\u9ed8\u8ba4\u7684\u53c2\u6570\u662f ",(0,s.jsx)(n.code,{children:"utils.side-by-side.with(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,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\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)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var s=t(7294);const i={},o=s.createContext(i);function r(e){const n=s.useContext(o);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(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1934],{3282:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>c});var s=t(5893),i=t(1151);const o={sidebar_position:5},r="\u9875\u9762\u5e03\u5c40",d={id:"layout",title:"\u9875\u9762\u5e03\u5c40",description:"\u57fa\u7840\u6982\u5ff5",source:"@site/i18n/zh/docusaurus-plugin-content-docs/current/layout.md",sourceDirName:".",slug:"/layout",permalink:"/touying/zh/docs/next/layout",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/docs/layout.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\u4ee3\u7801\u98ce\u683c",permalink:"/touying/zh/docs/next/code-styles"},next:{title:"\u5168\u5c40\u8bbe\u7f6e",permalink:"/touying/zh/docs/next/global-settings"}},a={},c=[{value:"\u57fa\u7840\u6982\u5ff5",id:"\u57fa\u7840\u6982\u5ff5",level:2},{value:"\u9875\u9762\u7ba1\u7406",id:"\u9875\u9762\u7ba1\u7406",level:2},{value:"\u5e94\u7528\uff1a\u6dfb\u52a0 Logo",id:"\u5e94\u7528\u6dfb\u52a0-logo",level:2},{value:"\u9875\u9762\u5206\u680f",id:"\u9875\u9762\u5206\u680f",level:2}];function l(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"\u9875\u9762\u5e03\u5c40",children:"\u9875\u9762\u5e03\u5c40"}),"\n",(0,s.jsx)(n.h2,{id:"\u57fa\u7840\u6982\u5ff5",children:"\u57fa\u7840\u6982\u5ff5"}),"\n",(0,s.jsx)(n.p,{children:"\u8981\u60f3\u4f7f\u7528 Typst \u5236\u4f5c\u4e00\u4e2a\u6837\u5f0f\u7f8e\u89c2\u7684 slides\uff0c\u6b63\u786e\u7406\u89e3 Typst \u7684\u9875\u9762\u6a21\u578b\u662f\u5fc5\u987b\u7684\uff0c\u5982\u679c\u4f60\u4e0d\u5173\u5fc3\u81ea\u5b9a\u4e49\u9875\u9762\u6837\u5f0f\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u8df3\u8fc7\u8fd9\u90e8\u5206\uff0c\u5426\u5219\u8fd8\u662f\u63a8\u8350\u770b\u4e00\u904d\u8fd9\u90e8\u5206\u3002"}),"\n",(0,s.jsx)(n.p,{children:"\u4e0b\u9762\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u6765\u8bf4\u660e Typst \u7684\u9ed8\u8ba4\u9875\u9762\u6a21\u578b\u3002"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(stroke: (dash: "dashed"))\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n header: container[#innerbox[Header]],\n header-ascent: 30%,\n footer: container[#innerbox[Footer]],\n footer-descent: 30%,\n)\n\n#place(top + right)[Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/70d48053-c777-4253-a9ca-ada360b5a987",alt:"image"})}),"\n",(0,s.jsx)(n.p,{children:"\u6211\u4eec\u9700\u8981\u533a\u5206\u4ee5\u4e0b\u6982\u5ff5\uff1a"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Model:"})," Typst \u62e5\u6709\u4e0e CSS Box Model \u7c7b\u4f3c\u7684\u6a21\u578b\uff0c\u5206\u4e3a Margin\u3001Padding \u548c Content\uff0c\u4f46\u5176\u4e2d padding \u5e76\u975e ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u7684\u5c5e\u6027\uff0c\u800c\u662f\u6211\u4eec\u624b\u52a8\u6dfb\u52a0 ",(0,s.jsx)(n.code,{children:"#pad(..)"})," \u5f97\u5230\u7684\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Margin:"})," \u9875\u8fb9\u8ddd\uff0c\u5206\u4e3a\u4e0a\u4e0b\u5de6\u53f3\u56db\u4e2a\u65b9\u5411\uff0c\u662f Typst \u9875\u9762\u6a21\u578b\u7684\u6838\u5fc3\uff0c\u5176\u4ed6\u5c5e\u6027\u90fd\u4f1a\u53d7\u5230\u9875\u8fb9\u8ddd\u7684\u5f71\u54cd\uff0c\u5c24\u5176\u662f Header \u548c Footer\u3002Header \u548c Footer \u5b9e\u9645\u4e0a\u662f\u4f4d\u4e8e Margin \u5185\u90e8\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Header:"})," Header \u662f\u9875\u9762\u9876\u90e8\u7684\u5185\u5bb9\uff0c\u53c8\u5206\u4e3a container \u548c innerbox\u3002\u6211\u4eec\u53ef\u4ee5\u6ce8\u610f\u5230 header container \u548c padding \u7684\u8fb9\u7f18\u5e76\u4e0d\u8d34\u5408\uff0c\u800c\u662f\u4e5f\u6709\u4e00\u5b9a\u7684\u7a7a\u9699\uff0c\u8fd9\u4e2a\u7a7a\u9699\u5b9e\u9645\u4e0a\u5c31\u662f ",(0,s.jsx)(n.code,{children:"header-ascent: 30%"}),"\uff0c\u800c\u8fd9\u91cc\u7684\u767e\u5206\u6bd4\u662f\u76f8\u5bf9\u4e8e margin-top \u800c\u8a00\u7684\u3002\u5e76\u4e14\uff0c\u6211\u4eec\u6ce8\u610f\u5230 header innerbox \u5b9e\u9645\u4e0a\u4f4d\u4e8e header container \u5de6\u4e0b\u89d2\uff0c\u4e5f\u5373 innerbox \u5b9e\u9645\u4e0a\u9ed8\u8ba4\u6709\u5c5e\u6027 ",(0,s.jsx)(n.code,{children:"#set align(left + bottom)"}),"\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Footer:"})," Footer \u662f\u9875\u9762\u5e95\u90e8\u7684\u5185\u5bb9\uff0c\u4e0e Header \u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u65b9\u5411\u76f8\u53cd\u3002"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Place:"})," ",(0,s.jsx)(n.code,{children:"place"})," \u51fd\u6570\u53ef\u4ee5\u5b9e\u73b0\u7edd\u5bf9\u5b9a\u4f4d\uff0c\u5728\u4e0d\u5f71\u54cd\u7236\u5bb9\u5668\u5185\u5176\u4ed6\u5143\u7d20\u7684\u60c5\u51b5\u4e0b\uff0c\u76f8\u5bf9\u4e8e\u7236\u5bb9\u5668\u6765\u5b9a\u4f4d\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f20\u5165 ",(0,s.jsx)(n.code,{children:"alignment"}),"\u3001",(0,s.jsx)(n.code,{children:"dx"})," \u548c ",(0,s.jsx)(n.code,{children:"dy"}),"\uff0c\u5f88\u9002\u5408\u7528\u6765\u653e\u7f6e\u4e00\u4e9b\u4fee\u9970\u5143\u7d20\uff0c\u4f8b\u5982 Logo \u4e4b\u7c7b\u7684\u56fe\u7247\u3002"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"\u56e0\u6b64\uff0c\u8981\u5c06 Typst \u5e94\u7528\u5230\u5236\u4f5c slides \u4e0a\uff0c\u6211\u4eec\u53ea\u9700\u8981\u8bbe\u7f6e"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#set page(\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"\u5373\u53ef\u3002\u4f46\u662f\u6211\u4eec\u8fd8\u9700\u8981\u89e3\u51b3 header \u5982\u4f55\u5360\u636e\u6574\u4e2a\u9875\u9762\u5bbd\u5ea6\u7684\u95ee\u9898\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528 negative padding \u5b9e\u73b0\uff0c\u4f8b\u5982\u6211\u4eec\u6709"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#let container = rect.with(stroke: (dash: "dashed"), height: 100%, width: 100%, inset: 0pt)\n#let innerbox = rect.with(fill: rgb("#d0d0d0"))\n#let margin = (x: 4em, y: 2em)\n\n// negative padding for header and footer\n#let negative-padding = pad.with(x: -margin.x, y: 0em)\n\n#set text(size: 30pt)\n#set page(\n paper: "presentation-16-9",\n margin: margin,\n header: negative-padding[#container[#align(top)[#innerbox(width: 100%)[Header]]]],\n header-ascent: 0em,\n footer: negative-padding[#container[#align(bottom)[#innerbox(width: 100%)[Footer]]]],\n footer-descent: 0em,\n)\n\n#place(top + right)[\u2191Margin\u2192]\n#container[\n #container[\n #innerbox[Content]\n ]\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/d74896f4-90e7-4b36-a5a9-9c44307eb192",alt:"image"})}),"\n",(0,s.jsx)(n.h2,{id:"\u9875\u9762\u7ba1\u7406",children:"\u9875\u9762\u7ba1\u7406"}),"\n",(0,s.jsxs)(n.p,{children:["\u7531\u4e8e Typst \u4e2d\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\u6765\u4fee\u6539\u9875\u9762\u53c2\u6570\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\u7ef4\u62a4\u4e00\u4e2a ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u548c\u4e00\u4e2a ",(0,s.jsx)(n.code,{children:"s.padding"})," \u6210\u5458\u53d8\u91cf\uff0c\u53ea\u5728 Touying \u81ea\u5df1\u521b\u5efa\u65b0 slide \u65f6\u624d\u4f1a\u81ea\u5df1\u5e94\u7528\u8fd9\u4e9b\u53c2\u6570\uff0c\u56e0\u6b64\u7528\u6237\u53ea\u9700\u8981\u5173\u6ce8 ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u548c ",(0,s.jsx)(n.code,{children:"s.padding"})," \u5373\u53ef\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u4f8b\u5b50\u5c31\u53ef\u4ee5\u6539\u6210"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#(s.page-args += (\n margin: (x: 4em, y: 2em),\n header: align(top)[Header],\n footer: align(bottom)[Footer],\n header-ascent: 0em,\n footer-descent: 0em,\n))\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Touying \u4f1a\u81ea\u52a8\u68c0\u6d4b ",(0,s.jsx)(n.code,{children:"margin.x"})," \u7684\u503c\uff0c\u5e76\u4e14\u5224\u65ad\u5982\u679c ",(0,s.jsx)(n.code,{children:"self.full-header == true"}),"\uff0c\u5c31\u4f1a\u81ea\u52a8\u4e3a header \u52a0\u5165\u8d1f\u586b\u5145\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u540c\u7406\uff0c\u5982\u679c\u4f60\u5bf9\u67d0\u4e2a\u4e3b\u9898\u7684 header \u6216 footer \u6837\u5f0f\u4e0d\u6ee1\u610f\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#(s.page-args.footer = [Custom Footer])\n"})}),"\n",(0,s.jsxs)(n.p,{children:["\u8fd9\u6837\u65b9\u5f0f\u8fdb\u884c\u66f4\u6362\u3002\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u8fd9\u6837\u66f4\u6362\u4e86\u9875\u9762\u53c2\u6570\uff0c\u4f60\u9700\u8981\u5c06\u5176\u653e\u5728 ",(0,s.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"})," \u4e4b\u524d\uff0c\u5426\u5219\u5c31\u9700\u8981\u91cd\u65b0\u8c03\u7528 ",(0,s.jsx)(n.code,{children:"#let (slide, empty-slide) = utils.slides(s)"}),"\u3002"]}),"\n",(0,s.jsx)(n.admonition,{title:"\u8b66\u544a",type:"warning",children:(0,s.jsxs)(n.p,{children:["\u56e0\u6b64\uff0c\u4f60\u4e0d\u5e94\u8be5\u81ea\u5df1\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"set page(..)"})," \u547d\u4ee4\uff0c\u800c\u662f\u5e94\u8be5\u4fee\u6539 ",(0,s.jsx)(n.code,{children:"s"})," \u5185\u90e8\u7684 ",(0,s.jsx)(n.code,{children:"s.page-args"})," \u6210\u5458\u53d8\u91cf\u3002"]})}),"\n",(0,s.jsxs)(n.p,{children:["\u501f\u52a9\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",(0,s.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,s.jsx)(n.code,{children:"transparent-cover"}),"\u3002\u8fd9\u91cc\u5c31\u90e8\u5206\u7b49\u4ef7\u4e8e context get rule\uff0c\u800c\u4e14\u5b9e\u9645\u4e0a\u7528\u8d77\u6765\u4f1a\u66f4\u65b9\u4fbf\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u5e94\u7528\u6dfb\u52a0-logo",children:"\u5e94\u7528\uff1a\u6dfb\u52a0 Logo"}),"\n",(0,s.jsxs)(n.p,{children:["\u4e3a slides \u6dfb\u52a0\u4e00\u4e2a Logo \u662f\u53ca\u5176\u666e\u904d\uff0c\u4f46\u662f\u53c8\u53ca\u5176\u591a\u53d8\u7684\u4e00\u4e2a\u9700\u6c42\u3002\u5176\u4e2d\u7684\u96be\u70b9\u5728\u4e8e\uff0c\u6240\u9700\u8981\u7684 Logo \u5927\u5c0f\u548c\u4f4d\u7f6e\u5f80\u5f80\u56e0\u4eba\u800c\u5f02\u3002\u56e0\u6b64\uff0cTouying \u7684\u4e3b\u9898\u5927\u90e8\u5206\u90fd\u4e0d\u5305\u542b Logo \u7684\u914d\u7f6e\u9009\u9879\u3002\u4f46\u501f\u52a9\u672c\u7ae0\u8282\u63d0\u5230\u7684\u9875\u9762\u5e03\u5c40\u7684\u6982\u5ff5\uff0c\u6211\u4eec\u77e5\u9053\u53ef\u4ee5\u5728 header \u6216 footer \u4e2d\u4f7f\u7528 ",(0,s.jsx)(n.code,{children:"place"})," \u51fd\u6570\u6765\u653e\u7f6e Logo \u56fe\u7247\u3002"]}),"\n",(0,s.jsx)(n.p,{children:"\u4f8b\u5982\uff0c\u6211\u4eec\u51b3\u5b9a\u7ed9 metropolis \u4e3b\u9898\u52a0\u5165 GitHub \u7684\u56fe\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u5b9e\u73b0\uff1a"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.4.1": *\n#import "@preview/octique:0.1.0": *\n\n#let s = themes.metropolis.register(aspect-ratio: "16-9")\n#(s.page-args.header = self => {\n // display the original header\n utils.call-or-display(self, s.page-args.header)\n // place logo to top-right\n place(top + right, dx: -0.5em, dy: 0.3em)[\n #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)\n ]\n})\n#let (init, slide) = utils.methods(s)\n#show: init\n\n#slide(title: [Title])[\n Logo example.\n]\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://github.com/touying-typ/touying/assets/34951714/055d77e7-5087-4248-b969-d8ef9d50c54b",alt:"image"})}),"\n",(0,s.jsxs)(n.p,{children:["\u5176\u4e2d ",(0,s.jsx)(n.code,{children:"utils.call-or-display(self, body)"})," \u53ef\u4ee5\u7528\u4e8e\u663e\u793a ",(0,s.jsx)(n.code,{children:"body"})," \u4e3a content \u6216 ",(0,s.jsx)(n.code,{children:"body"})," \u4e3a\u5f62\u5982 ",(0,s.jsx)(n.code,{children:"self => content"})," \u5f62\u5f0f\u7684\u56de\u8c03\u51fd\u6570\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u9875\u9762\u5206\u680f",children:"\u9875\u9762\u5206\u680f"}),"\n",(0,s.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,s.jsx)(n.code,{children:"slide"})," \u51fd\u6570\u9ed8\u8ba4\u63d0\u4f9b\u7684 ",(0,s.jsx)(n.code,{children:"compose"})," \u529f\u80fd\uff0c\u6700\u7b80\u5355\u7684\u793a\u4f8b\u5982\u4e0b\uff1a"]}),"\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:["\u5982\u679c\u4f60\u9700\u8981\u66f4\u6539\u5206\u680f\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4fee\u6539 ",(0,s.jsx)(n.code,{children:"slide"})," \u7684 ",(0,s.jsx)(n.code,{children:"composer"})," \u53c2\u6570\uff0c\u5176\u4e2d\u9ed8\u8ba4\u7684\u53c2\u6570\u662f ",(0,s.jsx)(n.code,{children:"utils.side-by-side.with(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,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typst",children:"#slide(composer: (1fr, auto))[\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)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>r});var s=t(7294);const i={},o=s.createContext(i);function r(e){const n=s.useContext(o);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(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh/assets/js/runtime~main.48acb82a.js b/zh/assets/js/runtime~main.b12474e6.js similarity index 91% rename from zh/assets/js/runtime~main.48acb82a.js rename to zh/assets/js/runtime~main.b12474e6.js index 67bd04824..14074511c 100644 --- a/zh/assets/js/runtime~main.48acb82a.js +++ b/zh/assets/js/runtime~main.b12474e6.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,b,c,f,d={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var b=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(b.exports,b,b.exports,r),b.loaded=!0,b.exports}r.m=d,r.c=t,e=[],r.O=(a,b,c,f)=>{if(!b){var d=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](b[o])))?b.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[b,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.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 f=Object.create(null);r.r(f);var d={};a=a||[null,b({}),b([]),b(b)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=b(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,r.d(f,d),f},r.d=(e,a)=>{for(var b in a)r.o(a,b)&&!r.o(e,b)&&Object.defineProperty(e,b,{enumerable:!0,get:a[b]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,b)=>(r.f[b](e,a),a)),[])),r.u=e=>"assets/js/"+({21:"56424af8",25:"e2afdb46",53:"935f2afb",55:"abd5ed0d",71:"b08ed549",79:"5d9196ef",285:"0bee9dda",299:"6ea55157",348:"fb15e9e7",350:"466c6918",427:"901b6cf8",438:"8c4e5360",452:"86ce6de9",635:"5fe8a7d6",685:"e3f0bdb4",759:"c21d2b24",770:"6c78ff94",775:"20c179ae",851:"b0ad5fdb",877:"8891196d",913:"18caf1db",946:"9093a083",977:"b48061fd",1029:"bb8dba6b",1043:"04a36ee2",1182:"cf8983c6",1229:"a2ce0262",1242:"8f8b8c9d",1267:"128a9485",1336:"55c13872",1389:"a5ceaf45",1431:"35c994aa",1534:"561e6c7b",1571:"05c4b512",1628:"65122322",1648:"e0c6d955",1704:"5896fb71",1761:"f01ace04",1785:"31fc2e15",1798:"3760b40e",1829:"daafa18c",1869:"d9d9b422",1898:"8dbec68f",1919:"5c493c38",1934:"f6262a69",1938:"287643ec",1993:"b39d38b0",2002:"90b312ed",2013:"c984ce9d",2046:"fc90ac41",2069:"dcf6645f",2079:"06be141e",2119:"568df868",2145:"a9d8b83d",2336:"94d2f82b",2365:"b223e519",2392:"fafe762b",2528:"ae31ff46",2535:"814f3328",2608:"fdbf24e4",2697:"ed4bb18f",2701:"1aab1ab5",2803:"f49334b8",2810:"6a503890",2875:"c1d231e7",3085:"1f391b9e",3089:"a6aa9e1f",3137:"443dc191",3207:"874294bc",3263:"c6092dbc",3296:"4e00a773",3374:"f757d0c5",3426:"449c721b",3440:"2e03f7f4",3563:"5bb6c1c3",3604:"77c2c049",3608:"9e4087bc",3617:"8da45283",3712:"2c8659d9",3748:"bcac2ad4",3759:"802946da",3843:"20f452e9",3850:"2a635ef0",3881:"1c3f293b",4013:"01a85c17",4084:"71e4bc12",4102:"2845e528",4108:"cf04afb9",4110:"08c77efa",4134:"4eaaf39d",4195:"c4f5d8e4",4213:"468510f3",4238:"2edddeb1",4334:"a6759f2d",4368:"a94703ab",4407:"a876e6bc",4413:"cad84648",4439:"82582b69",4440:"8b1b2883",4557:"64a34be6",4599:"a94a4682",4879:"ae8e5624",4917:"cc496b32",4969:"836654e7",4988:"9010ec73",5022:"3b36ca8e",5036:"484b6277",5069:"4af125dc",5166:"69a95a34",5204:"1b05ed46",5315:"05e5ef8f",5329:"339ee8e1",5332:"8ded3f77",5414:"21f7ae82",5455:"d5c687ae",5609:"5035b6a4",5610:"352a2724",5635:"1cf5eacf",5658:"d21a173f",5821:"e3c92f47",5850:"4c00a561",5964:"6af3e01d",5980:"cb5ae183",6009:"aa94d6df",6032:"94e20dfd",6103:"ccc49370",6122:"78ac7022",6148:"c062b789",6244:"af73321e",6401:"530fec33",6506:"a0168dc0",6508:"f4a64ebe",6525:"c4348821",6633:"737adc8d",6639:"08114ca6",6686:"a65f34dc",6811:"acc723e6",6864:"cbce90b2",6879:"7356add0",6922:"57e40cfe",6958:"b28182d4",7059:"eb154561",7123:"57b51348",7146:"df8eaafd",7176:"cf629d26",7192:"5b5a3966",7259:"a3a5cdb3",7280:"780b1457",7291:"82a7b37c",7373:"63dd4865",7396:"b0846cea",7414:"393be207",7502:"43883141",7525:"c7f532e1",7589:"2c0f3de2",7593:"04dd6bbf",7686:"78005bf6",7696:"e8ed6e8b",7718:"c875b75b",7739:"adb750bb",7810:"2f245288",7828:"e6c80b16",7838:"ce05be13",7918:"17896441",7936:"afca79fb",7946:"d3b36941",7983:"b42b1cce",8069:"463d321d",8080:"f040d35e",8112:"9ed0691e",8240:"843949a5",8317:"44b10a21",8370:"99f237dc",8385:"8eb20e8c",8506:"27acd01e",8518:"a7bd4aaa",8598:"4f5513f7",8610:"6875c492",8631:"0dfb50c0",8656:"a50a9650",8698:"905648c2",8702:"b7686fe1",8759:"fba7183b",8777:"602d2aba",8814:"ecc6e0e3",8860:"59c77264",8993:"24f6044e",9022:"25021cc6",9074:"23f1990b",9122:"b885bf58",9183:"2d4a7f47",9306:"04de189a",9491:"e39444e4",9661:"5e95c892",9683:"5aeabefc",9716:"ec177486",9755:"c0c5477b",9758:"4bd433da",9761:"d55b4038",9769:"b723c464",9774:"a8a3d11e",9817:"14eb3368",9836:"8fdae525",9905:"20c7fb6f",9931:"af355bab",9971:"498e264e"}[e]||e)+"."+{21:"24311bab",25:"94cc3e7a",53:"584e979a",55:"22cb969e",71:"ebbf28c2",79:"a451f270",285:"39dd975f",299:"9e10939b",348:"fae2fe8f",350:"a4403505",427:"89f37d14",438:"47fc01b0",452:"d319f9ab",635:"5c258295",685:"01ec0f17",759:"51bedf47",770:"5550f363",775:"a4db236d",851:"69eee92b",877:"c0d00dd1",913:"6cc36e5d",946:"3ba9344a",977:"6dd451b8",1029:"580aee2c",1043:"8e00bb10",1182:"1aa64ff4",1229:"efc1839b",1242:"99e112cf",1267:"9d3aee10",1336:"981729e6",1389:"158c77b9",1404:"2f578d87",1431:"eed8c5ba",1534:"7466bbec",1571:"1883fc99",1628:"a38c70d4",1648:"aa886b3d",1704:"fdb8542b",1761:"46504d2e",1772:"22d645a1",1785:"bbe1529a",1798:"658754e2",1829:"aad84469",1869:"89d55153",1898:"8e5898ac",1919:"941694a6",1934:"3858054e",1938:"0594c20c",1993:"771bc039",2002:"93cd8ae6",2013:"f04fc69c",2046:"8ac7249c",2069:"359c1bb8",2079:"9e14e2dc",2119:"b46e91b5",2145:"cc4816af",2336:"c6f63ede",2365:"81c57bfe",2392:"de91d44d",2528:"5f027985",2535:"67360812",2608:"db42c702",2697:"b0682720",2701:"494ea3bd",2803:"515ed2b2",2810:"a8a90c97",2875:"f8986a62",3085:"fa8680eb",3089:"d410008f",3137:"8c6a97a6",3207:"680f4daf",3263:"2e572022",3296:"48847e29",3374:"e8d458cc",3426:"20e4f357",3440:"db446fe7",3563:"e9427874",3604:"d7b81426",3608:"8eec8b12",3617:"848b5228",3712:"ac445854",3748:"39ec2c0c",3759:"d6f39a1e",3843:"e3e69eea",3850:"f7652a6f",3881:"4bfaa04c",4013:"354f3ef2",4084:"9d164f37",4102:"b30bf730",4108:"0e7076ce",4110:"60c3eaf6",4134:"46c9128f",4195:"b82e09e8",4213:"f38b0fec",4238:"e7c8d9f7",4334:"9d4af5e6",4368:"9ecc2e7c",4407:"627d6a1a",4413:"b55e6b76",4439:"c0c7b3c0",4440:"e3a7b614",4557:"9c7aa276",4599:"44b2d2fd",4879:"bfad032a",4917:"757962f8",4969:"72f7a7e4",4988:"a052fb9a",5022:"c1ec8f85",5036:"0c36331e",5069:"53595e49",5166:"7e93bac1",5204:"05da8861",5315:"a097ace9",5329:"1ca78cd1",5332:"39e635f8",5414:"f230d8cd",5455:"f3c48789",5609:"ba29a9c9",5610:"29b897a7",5635:"f0426422",5658:"cc1ad8e5",5821:"57b047c8",5850:"5599e7c7",5964:"9b26f81f",5980:"29dc0bfa",6009:"7f883505",6032:"1913822f",6103:"d9da7455",6122:"c8bd6b21",6148:"65946548",6244:"5e4df75c",6401:"6c93aea7",6506:"020f221e",6508:"604871c5",6525:"3aeaa6d0",6633:"43afa7d5",6639:"4947aeb3",6686:"174e8c05",6811:"c64753b0",6864:"b5ea0f0e",6879:"f3487b4f",6922:"aeb576f0",6958:"7f1c5441",7059:"3748b647",7123:"13e056d4",7146:"cabf2352",7176:"49022147",7192:"bf7a28a0",7259:"d71b2c7d",7280:"a9445761",7291:"8fce7159",7373:"198592be",7396:"3b8ac3e2",7414:"e44f1810",7502:"dfaaee05",7525:"761d0d15",7589:"61bbe160",7593:"548c06af",7686:"5a790137",7696:"89315a51",7718:"5698c1ce",7739:"1ccccb00",7810:"82eed055",7828:"e34b2337",7838:"d146487d",7918:"15723699",7936:"2df84490",7946:"d84370e5",7983:"57637745",8069:"f0348105",8080:"ee0007d3",8112:"b43280c3",8240:"9e119365",8317:"1bcf04af",8370:"5a757c8a",8385:"b761dd92",8506:"219a85cf",8518:"f93b23a7",8598:"a76e5d37",8610:"686aaf2c",8631:"920789e0",8656:"f76af84a",8698:"c5739e19",8702:"e004f42c",8759:"b6a01123",8777:"bababa39",8814:"91fadc63",8860:"1ade3b69",8993:"c0a225e3",9022:"2d5f14e2",9074:"6e8b77ea",9122:"694d9c31",9183:"15768c44",9306:"959d4783",9491:"7281ba03",9661:"17c48d1d",9677:"ea822b9e",9683:"7a093544",9716:"8101c54c",9755:"570fdcda",9758:"4d7601d9",9761:"9ac720c2",9769:"4dc1509d",9774:"0b3a73d5",9817:"21d38987",9836:"bc4fccda",9905:"a97cfa18",9931:"d5c4fd47",9971:"0089f170"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="docs:",r.l=(e,a,b,d)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==b)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(b))),a)return a(b)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/zh/",r.gca=function(e){return e={17896441:"7918",43883141:"7502",65122322:"1628","56424af8":"21",e2afdb46:"25","935f2afb":"53",abd5ed0d:"55",b08ed549:"71","5d9196ef":"79","0bee9dda":"285","6ea55157":"299",fb15e9e7:"348","466c6918":"350","901b6cf8":"427","8c4e5360":"438","86ce6de9":"452","5fe8a7d6":"635",e3f0bdb4:"685",c21d2b24:"759","6c78ff94":"770","20c179ae":"775",b0ad5fdb:"851","8891196d":"877","18caf1db":"913","9093a083":"946",b48061fd:"977",bb8dba6b:"1029","04a36ee2":"1043",cf8983c6:"1182",a2ce0262:"1229","8f8b8c9d":"1242","128a9485":"1267","55c13872":"1336",a5ceaf45:"1389","35c994aa":"1431","561e6c7b":"1534","05c4b512":"1571",e0c6d955:"1648","5896fb71":"1704",f01ace04:"1761","31fc2e15":"1785","3760b40e":"1798",daafa18c:"1829",d9d9b422:"1869","8dbec68f":"1898","5c493c38":"1919",f6262a69:"1934","287643ec":"1938",b39d38b0:"1993","90b312ed":"2002",c984ce9d:"2013",fc90ac41:"2046",dcf6645f:"2069","06be141e":"2079","568df868":"2119",a9d8b83d:"2145","94d2f82b":"2336",b223e519:"2365",fafe762b:"2392",ae31ff46:"2528","814f3328":"2535",fdbf24e4:"2608",ed4bb18f:"2697","1aab1ab5":"2701",f49334b8:"2803","6a503890":"2810",c1d231e7:"2875","1f391b9e":"3085",a6aa9e1f:"3089","443dc191":"3137","874294bc":"3207",c6092dbc:"3263","4e00a773":"3296",f757d0c5:"3374","449c721b":"3426","2e03f7f4":"3440","5bb6c1c3":"3563","77c2c049":"3604","9e4087bc":"3608","8da45283":"3617","2c8659d9":"3712",bcac2ad4:"3748","802946da":"3759","20f452e9":"3843","2a635ef0":"3850","1c3f293b":"3881","01a85c17":"4013","71e4bc12":"4084","2845e528":"4102",cf04afb9:"4108","08c77efa":"4110","4eaaf39d":"4134",c4f5d8e4:"4195","468510f3":"4213","2edddeb1":"4238",a6759f2d:"4334",a94703ab:"4368",a876e6bc:"4407",cad84648:"4413","82582b69":"4439","8b1b2883":"4440","64a34be6":"4557",a94a4682:"4599",ae8e5624:"4879",cc496b32:"4917","836654e7":"4969","9010ec73":"4988","3b36ca8e":"5022","484b6277":"5036","4af125dc":"5069","69a95a34":"5166","1b05ed46":"5204","05e5ef8f":"5315","339ee8e1":"5329","8ded3f77":"5332","21f7ae82":"5414",d5c687ae:"5455","5035b6a4":"5609","352a2724":"5610","1cf5eacf":"5635",d21a173f:"5658",e3c92f47:"5821","4c00a561":"5850","6af3e01d":"5964",cb5ae183:"5980",aa94d6df:"6009","94e20dfd":"6032",ccc49370:"6103","78ac7022":"6122",c062b789:"6148",af73321e:"6244","530fec33":"6401",a0168dc0:"6506",f4a64ebe:"6508",c4348821:"6525","737adc8d":"6633","08114ca6":"6639",a65f34dc:"6686",acc723e6:"6811",cbce90b2:"6864","7356add0":"6879","57e40cfe":"6922",b28182d4:"6958",eb154561:"7059","57b51348":"7123",df8eaafd:"7146",cf629d26:"7176","5b5a3966":"7192",a3a5cdb3:"7259","780b1457":"7280","82a7b37c":"7291","63dd4865":"7373",b0846cea:"7396","393be207":"7414",c7f532e1:"7525","2c0f3de2":"7589","04dd6bbf":"7593","78005bf6":"7686",e8ed6e8b:"7696",c875b75b:"7718",adb750bb:"7739","2f245288":"7810",e6c80b16:"7828",ce05be13:"7838",afca79fb:"7936",d3b36941:"7946",b42b1cce:"7983","463d321d":"8069",f040d35e:"8080","9ed0691e":"8112","843949a5":"8240","44b10a21":"8317","99f237dc":"8370","8eb20e8c":"8385","27acd01e":"8506",a7bd4aaa:"8518","4f5513f7":"8598","6875c492":"8610","0dfb50c0":"8631",a50a9650:"8656","905648c2":"8698",b7686fe1:"8702",fba7183b:"8759","602d2aba":"8777",ecc6e0e3:"8814","59c77264":"8860","24f6044e":"8993","25021cc6":"9022","23f1990b":"9074",b885bf58:"9122","2d4a7f47":"9183","04de189a":"9306",e39444e4:"9491","5e95c892":"9661","5aeabefc":"9683",ec177486:"9716",c0c5477b:"9755","4bd433da":"9758",d55b4038:"9761",b723c464:"9769",a8a3d11e:"9774","14eb3368":"9817","8fdae525":"9836","20c7fb6f":"9905",af355bab:"9931","498e264e":"9971"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,b)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)b.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((b,f)=>c=e[a]=[b,f]));b.push(c[2]=f);var d=r.p+r.u(a),t=new Error;r.l(d,(b=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=b&&("load"===b.type?"missing":b.type),d=b&&b.target&&b.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+d+")",t.name="ChunkLoadError",t.type=f,t.request=d,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,b)=>{var c,f,d=b[0],t=b[1],o=b[2],n=0;if(d.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(b);n{"use strict";var e,a,b,c,f,d={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var b=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(b.exports,b,b.exports,r),b.loaded=!0,b.exports}r.m=d,r.c=t,e=[],r.O=(a,b,c,f)=>{if(!b){var d=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](b[o])))?b.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[b,c,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.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 f=Object.create(null);r.r(f);var d={};a=a||[null,b({}),b([]),b(b)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=b(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,r.d(f,d),f},r.d=(e,a)=>{for(var b in a)r.o(a,b)&&!r.o(e,b)&&Object.defineProperty(e,b,{enumerable:!0,get:a[b]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,b)=>(r.f[b](e,a),a)),[])),r.u=e=>"assets/js/"+({21:"56424af8",25:"e2afdb46",53:"935f2afb",55:"abd5ed0d",71:"b08ed549",79:"5d9196ef",285:"0bee9dda",299:"6ea55157",348:"fb15e9e7",350:"466c6918",427:"901b6cf8",438:"8c4e5360",452:"86ce6de9",635:"5fe8a7d6",685:"e3f0bdb4",759:"c21d2b24",770:"6c78ff94",775:"20c179ae",851:"b0ad5fdb",877:"8891196d",913:"18caf1db",946:"9093a083",977:"b48061fd",1029:"bb8dba6b",1043:"04a36ee2",1182:"cf8983c6",1229:"a2ce0262",1242:"8f8b8c9d",1267:"128a9485",1336:"55c13872",1389:"a5ceaf45",1431:"35c994aa",1534:"561e6c7b",1571:"05c4b512",1628:"65122322",1648:"e0c6d955",1704:"5896fb71",1761:"f01ace04",1785:"31fc2e15",1798:"3760b40e",1829:"daafa18c",1869:"d9d9b422",1898:"8dbec68f",1919:"5c493c38",1934:"f6262a69",1938:"287643ec",1993:"b39d38b0",2002:"90b312ed",2013:"c984ce9d",2046:"fc90ac41",2069:"dcf6645f",2079:"06be141e",2119:"568df868",2145:"a9d8b83d",2336:"94d2f82b",2365:"b223e519",2392:"fafe762b",2528:"ae31ff46",2535:"814f3328",2608:"fdbf24e4",2697:"ed4bb18f",2701:"1aab1ab5",2803:"f49334b8",2810:"6a503890",2875:"c1d231e7",3085:"1f391b9e",3089:"a6aa9e1f",3137:"443dc191",3207:"874294bc",3263:"c6092dbc",3296:"4e00a773",3374:"f757d0c5",3426:"449c721b",3440:"2e03f7f4",3563:"5bb6c1c3",3604:"77c2c049",3608:"9e4087bc",3617:"8da45283",3712:"2c8659d9",3748:"bcac2ad4",3759:"802946da",3843:"20f452e9",3850:"2a635ef0",3881:"1c3f293b",4013:"01a85c17",4084:"71e4bc12",4102:"2845e528",4108:"cf04afb9",4110:"08c77efa",4134:"4eaaf39d",4195:"c4f5d8e4",4213:"468510f3",4238:"2edddeb1",4334:"a6759f2d",4368:"a94703ab",4407:"a876e6bc",4413:"cad84648",4439:"82582b69",4440:"8b1b2883",4557:"64a34be6",4599:"a94a4682",4879:"ae8e5624",4917:"cc496b32",4969:"836654e7",4988:"9010ec73",5022:"3b36ca8e",5036:"484b6277",5069:"4af125dc",5166:"69a95a34",5204:"1b05ed46",5315:"05e5ef8f",5329:"339ee8e1",5332:"8ded3f77",5414:"21f7ae82",5455:"d5c687ae",5609:"5035b6a4",5610:"352a2724",5635:"1cf5eacf",5658:"d21a173f",5821:"e3c92f47",5850:"4c00a561",5964:"6af3e01d",5980:"cb5ae183",6009:"aa94d6df",6032:"94e20dfd",6103:"ccc49370",6122:"78ac7022",6148:"c062b789",6244:"af73321e",6401:"530fec33",6506:"a0168dc0",6508:"f4a64ebe",6525:"c4348821",6633:"737adc8d",6639:"08114ca6",6686:"a65f34dc",6811:"acc723e6",6864:"cbce90b2",6879:"7356add0",6922:"57e40cfe",6958:"b28182d4",7059:"eb154561",7123:"57b51348",7146:"df8eaafd",7176:"cf629d26",7192:"5b5a3966",7259:"a3a5cdb3",7280:"780b1457",7291:"82a7b37c",7373:"63dd4865",7396:"b0846cea",7414:"393be207",7502:"43883141",7525:"c7f532e1",7589:"2c0f3de2",7593:"04dd6bbf",7686:"78005bf6",7696:"e8ed6e8b",7718:"c875b75b",7739:"adb750bb",7810:"2f245288",7828:"e6c80b16",7838:"ce05be13",7918:"17896441",7936:"afca79fb",7946:"d3b36941",7983:"b42b1cce",8069:"463d321d",8080:"f040d35e",8112:"9ed0691e",8240:"843949a5",8317:"44b10a21",8370:"99f237dc",8385:"8eb20e8c",8506:"27acd01e",8518:"a7bd4aaa",8598:"4f5513f7",8610:"6875c492",8631:"0dfb50c0",8656:"a50a9650",8698:"905648c2",8702:"b7686fe1",8759:"fba7183b",8777:"602d2aba",8814:"ecc6e0e3",8860:"59c77264",8993:"24f6044e",9022:"25021cc6",9074:"23f1990b",9122:"b885bf58",9183:"2d4a7f47",9306:"04de189a",9491:"e39444e4",9661:"5e95c892",9683:"5aeabefc",9716:"ec177486",9755:"c0c5477b",9758:"4bd433da",9761:"d55b4038",9769:"b723c464",9774:"a8a3d11e",9817:"14eb3368",9836:"8fdae525",9905:"20c7fb6f",9931:"af355bab",9971:"498e264e"}[e]||e)+"."+{21:"24311bab",25:"94cc3e7a",53:"584e979a",55:"22cb969e",71:"ebbf28c2",79:"a451f270",285:"39dd975f",299:"9e10939b",348:"fae2fe8f",350:"a4403505",427:"89f37d14",438:"47fc01b0",452:"d319f9ab",635:"5c258295",685:"01ec0f17",759:"51bedf47",770:"5550f363",775:"a4db236d",851:"69eee92b",877:"c0d00dd1",913:"6cc36e5d",946:"3ba9344a",977:"6dd451b8",1029:"580aee2c",1043:"8e00bb10",1182:"c3daa6dd",1229:"efc1839b",1242:"99e112cf",1267:"9d3aee10",1336:"981729e6",1389:"158c77b9",1404:"2f578d87",1431:"eed8c5ba",1534:"7466bbec",1571:"1883fc99",1628:"a38c70d4",1648:"aa886b3d",1704:"fdb8542b",1761:"46504d2e",1772:"22d645a1",1785:"bbe1529a",1798:"658754e2",1829:"aad84469",1869:"89d55153",1898:"8e5898ac",1919:"941694a6",1934:"761f978e",1938:"0594c20c",1993:"771bc039",2002:"93cd8ae6",2013:"f04fc69c",2046:"8ac7249c",2069:"359c1bb8",2079:"9e14e2dc",2119:"b46e91b5",2145:"cc4816af",2336:"c6f63ede",2365:"81c57bfe",2392:"de91d44d",2528:"5f027985",2535:"67360812",2608:"db42c702",2697:"b0682720",2701:"494ea3bd",2803:"515ed2b2",2810:"006bba1f",2875:"bf9f8f1d",3085:"fa8680eb",3089:"d410008f",3137:"8c6a97a6",3207:"680f4daf",3263:"2e572022",3296:"3e811cce",3374:"e8d458cc",3426:"20e4f357",3440:"fb84fa15",3563:"a5d8e1de",3604:"d7b81426",3608:"8eec8b12",3617:"848b5228",3712:"ac445854",3748:"39ec2c0c",3759:"d6f39a1e",3843:"325ef419",3850:"f7652a6f",3881:"4bfaa04c",4013:"354f3ef2",4084:"9d164f37",4102:"b30bf730",4108:"0e7076ce",4110:"60c3eaf6",4134:"46c9128f",4195:"b82e09e8",4213:"f38b0fec",4238:"e7c8d9f7",4334:"9d4af5e6",4368:"9ecc2e7c",4407:"627d6a1a",4413:"b13c687b",4439:"c0c7b3c0",4440:"e3a7b614",4557:"9c7aa276",4599:"44b2d2fd",4879:"bfad032a",4917:"757962f8",4969:"72f7a7e4",4988:"a052fb9a",5022:"c1ec8f85",5036:"0c36331e",5069:"53595e49",5166:"21772d20",5204:"05da8861",5315:"a097ace9",5329:"ed73a73c",5332:"39e635f8",5414:"f230d8cd",5455:"ed5869dd",5609:"ba29a9c9",5610:"29b897a7",5635:"f0426422",5658:"7cd6da87",5821:"57b047c8",5850:"cd87c5af",5964:"9b26f81f",5980:"29dc0bfa",6009:"7f883505",6032:"1913822f",6103:"d9da7455",6122:"c8bd6b21",6148:"65946548",6244:"5e4df75c",6401:"6c93aea7",6506:"020f221e",6508:"604871c5",6525:"3aeaa6d0",6633:"43afa7d5",6639:"4947aeb3",6686:"174e8c05",6811:"c64753b0",6864:"b5ea0f0e",6879:"f3487b4f",6922:"aeb576f0",6958:"7f1c5441",7059:"c8a2a8cd",7123:"13e056d4",7146:"ae76ca45",7176:"49022147",7192:"bf7a28a0",7259:"d71b2c7d",7280:"a9445761",7291:"8fce7159",7373:"5dfda47d",7396:"3b8ac3e2",7414:"e44f1810",7502:"dfaaee05",7525:"761d0d15",7589:"61bbe160",7593:"548c06af",7686:"5a790137",7696:"89315a51",7718:"5698c1ce",7739:"1ccccb00",7810:"82eed055",7828:"e34b2337",7838:"0aaa020d",7918:"15723699",7936:"2df84490",7946:"d84370e5",7983:"57637745",8069:"f0348105",8080:"ee0007d3",8112:"b43280c3",8240:"9e119365",8317:"1bcf04af",8370:"5a757c8a",8385:"b761dd92",8506:"219a85cf",8518:"f93b23a7",8598:"a76e5d37",8610:"686aaf2c",8631:"920789e0",8656:"f76af84a",8698:"c5739e19",8702:"e004f42c",8759:"b6a01123",8777:"bababa39",8814:"91fadc63",8860:"1ade3b69",8993:"a1e6abc1",9022:"2d5f14e2",9074:"6e8b77ea",9122:"694d9c31",9183:"15768c44",9306:"959d4783",9491:"7281ba03",9661:"17c48d1d",9677:"ea822b9e",9683:"7a093544",9716:"8101c54c",9755:"570fdcda",9758:"4d7601d9",9761:"9ac720c2",9769:"4dc1509d",9774:"0b3a73d5",9817:"21d38987",9836:"bc4fccda",9905:"a97cfa18",9931:"66334ddd",9971:"0089f170"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},f="docs:",r.l=(e,a,b,d)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==b)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(b))),a)return a(b)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/touying/zh/",r.gca=function(e){return e={17896441:"7918",43883141:"7502",65122322:"1628","56424af8":"21",e2afdb46:"25","935f2afb":"53",abd5ed0d:"55",b08ed549:"71","5d9196ef":"79","0bee9dda":"285","6ea55157":"299",fb15e9e7:"348","466c6918":"350","901b6cf8":"427","8c4e5360":"438","86ce6de9":"452","5fe8a7d6":"635",e3f0bdb4:"685",c21d2b24:"759","6c78ff94":"770","20c179ae":"775",b0ad5fdb:"851","8891196d":"877","18caf1db":"913","9093a083":"946",b48061fd:"977",bb8dba6b:"1029","04a36ee2":"1043",cf8983c6:"1182",a2ce0262:"1229","8f8b8c9d":"1242","128a9485":"1267","55c13872":"1336",a5ceaf45:"1389","35c994aa":"1431","561e6c7b":"1534","05c4b512":"1571",e0c6d955:"1648","5896fb71":"1704",f01ace04:"1761","31fc2e15":"1785","3760b40e":"1798",daafa18c:"1829",d9d9b422:"1869","8dbec68f":"1898","5c493c38":"1919",f6262a69:"1934","287643ec":"1938",b39d38b0:"1993","90b312ed":"2002",c984ce9d:"2013",fc90ac41:"2046",dcf6645f:"2069","06be141e":"2079","568df868":"2119",a9d8b83d:"2145","94d2f82b":"2336",b223e519:"2365",fafe762b:"2392",ae31ff46:"2528","814f3328":"2535",fdbf24e4:"2608",ed4bb18f:"2697","1aab1ab5":"2701",f49334b8:"2803","6a503890":"2810",c1d231e7:"2875","1f391b9e":"3085",a6aa9e1f:"3089","443dc191":"3137","874294bc":"3207",c6092dbc:"3263","4e00a773":"3296",f757d0c5:"3374","449c721b":"3426","2e03f7f4":"3440","5bb6c1c3":"3563","77c2c049":"3604","9e4087bc":"3608","8da45283":"3617","2c8659d9":"3712",bcac2ad4:"3748","802946da":"3759","20f452e9":"3843","2a635ef0":"3850","1c3f293b":"3881","01a85c17":"4013","71e4bc12":"4084","2845e528":"4102",cf04afb9:"4108","08c77efa":"4110","4eaaf39d":"4134",c4f5d8e4:"4195","468510f3":"4213","2edddeb1":"4238",a6759f2d:"4334",a94703ab:"4368",a876e6bc:"4407",cad84648:"4413","82582b69":"4439","8b1b2883":"4440","64a34be6":"4557",a94a4682:"4599",ae8e5624:"4879",cc496b32:"4917","836654e7":"4969","9010ec73":"4988","3b36ca8e":"5022","484b6277":"5036","4af125dc":"5069","69a95a34":"5166","1b05ed46":"5204","05e5ef8f":"5315","339ee8e1":"5329","8ded3f77":"5332","21f7ae82":"5414",d5c687ae:"5455","5035b6a4":"5609","352a2724":"5610","1cf5eacf":"5635",d21a173f:"5658",e3c92f47:"5821","4c00a561":"5850","6af3e01d":"5964",cb5ae183:"5980",aa94d6df:"6009","94e20dfd":"6032",ccc49370:"6103","78ac7022":"6122",c062b789:"6148",af73321e:"6244","530fec33":"6401",a0168dc0:"6506",f4a64ebe:"6508",c4348821:"6525","737adc8d":"6633","08114ca6":"6639",a65f34dc:"6686",acc723e6:"6811",cbce90b2:"6864","7356add0":"6879","57e40cfe":"6922",b28182d4:"6958",eb154561:"7059","57b51348":"7123",df8eaafd:"7146",cf629d26:"7176","5b5a3966":"7192",a3a5cdb3:"7259","780b1457":"7280","82a7b37c":"7291","63dd4865":"7373",b0846cea:"7396","393be207":"7414",c7f532e1:"7525","2c0f3de2":"7589","04dd6bbf":"7593","78005bf6":"7686",e8ed6e8b:"7696",c875b75b:"7718",adb750bb:"7739","2f245288":"7810",e6c80b16:"7828",ce05be13:"7838",afca79fb:"7936",d3b36941:"7946",b42b1cce:"7983","463d321d":"8069",f040d35e:"8080","9ed0691e":"8112","843949a5":"8240","44b10a21":"8317","99f237dc":"8370","8eb20e8c":"8385","27acd01e":"8506",a7bd4aaa:"8518","4f5513f7":"8598","6875c492":"8610","0dfb50c0":"8631",a50a9650:"8656","905648c2":"8698",b7686fe1:"8702",fba7183b:"8759","602d2aba":"8777",ecc6e0e3:"8814","59c77264":"8860","24f6044e":"8993","25021cc6":"9022","23f1990b":"9074",b885bf58:"9122","2d4a7f47":"9183","04de189a":"9306",e39444e4:"9491","5e95c892":"9661","5aeabefc":"9683",ec177486:"9716",c0c5477b:"9755","4bd433da":"9758",d55b4038:"9761",b723c464:"9769",a8a3d11e:"9774","14eb3368":"9817","8fdae525":"9836","20c7fb6f":"9905",af355bab:"9931","498e264e":"9971"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,b)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)b.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((b,f)=>c=e[a]=[b,f]));b.push(c[2]=f);var d=r.p+r.u(a),t=new Error;r.l(d,(b=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var f=b&&("load"===b.type?"missing":b.type),d=b&&b.target&&b.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+d+")",t.name="ChunkLoadError",t.type=f,t.request=d,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,b)=>{var c,f,d=b[0],t=b[1],o=b[2],n=0;if(d.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(b);n 历史博文 | Touying - + diff --git a/zh/blog/index.html b/zh/blog/index.html index 313fff378..f410d78e7 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 836cffecf..4577c1c68 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 41cd313f0..04109cf91 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 770078923..b007ce2ee 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/0.2.x/build-your-own-theme/index.html b/zh/docs/0.2.x/build-your-own-theme/index.html index 60205b84b..dbffaf45b 100644 --- a/zh/docs/0.2.x/build-your-own-theme/index.html +++ b/zh/docs/0.2.x/build-your-own-theme/index.html @@ -5,7 +5,7 @@ 创建自己的主题 | Touying - + diff --git a/zh/docs/0.2.x/category/dynamic-slides/index.html b/zh/docs/0.2.x/category/dynamic-slides/index.html index 3e97716f9..0c8af9aec 100644 --- a/zh/docs/0.2.x/category/dynamic-slides/index.html +++ b/zh/docs/0.2.x/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/zh/docs/0.2.x/category/external-tools/index.html b/zh/docs/0.2.x/category/external-tools/index.html index 13713b804..354e8c437 100644 --- a/zh/docs/0.2.x/category/external-tools/index.html +++ b/zh/docs/0.2.x/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/zh/docs/0.2.x/category/progress/index.html b/zh/docs/0.2.x/category/progress/index.html index 0bee006f8..481a586bf 100644 --- a/zh/docs/0.2.x/category/progress/index.html +++ b/zh/docs/0.2.x/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/zh/docs/0.2.x/category/themes/index.html b/zh/docs/0.2.x/category/themes/index.html index 5b4f82c3d..55dae2d71 100644 --- a/zh/docs/0.2.x/category/themes/index.html +++ b/zh/docs/0.2.x/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/zh/docs/0.2.x/category/utilities/index.html b/zh/docs/0.2.x/category/utilities/index.html index 5829f3385..7ca7a2963 100644 --- a/zh/docs/0.2.x/category/utilities/index.html +++ b/zh/docs/0.2.x/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/zh/docs/0.2.x/changelog/index.html b/zh/docs/0.2.x/changelog/index.html index 5309a6e79..793816a27 100644 --- a/zh/docs/0.2.x/changelog/index.html +++ b/zh/docs/0.2.x/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/complex/index.html b/zh/docs/0.2.x/dynamic/complex/index.html index dac21ff44..f1ec277cd 100644 --- a/zh/docs/0.2.x/dynamic/complex/index.html +++ b/zh/docs/0.2.x/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/cover/index.html b/zh/docs/0.2.x/dynamic/cover/index.html index 6193c2043..5035cad15 100644 --- a/zh/docs/0.2.x/dynamic/cover/index.html +++ b/zh/docs/0.2.x/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover 函数 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/equation/index.html b/zh/docs/0.2.x/dynamic/equation/index.html index e7c9eb4eb..790df2167 100644 --- a/zh/docs/0.2.x/dynamic/equation/index.html +++ b/zh/docs/0.2.x/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/handout/index.html b/zh/docs/0.2.x/dynamic/handout/index.html index 99d335a5b..5005fe416 100644 --- a/zh/docs/0.2.x/dynamic/handout/index.html +++ b/zh/docs/0.2.x/dynamic/handout/index.html @@ -5,7 +5,7 @@ 创建讲义 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/other/index.html b/zh/docs/0.2.x/dynamic/other/index.html index 5fcb7afbd..a387990eb 100644 --- a/zh/docs/0.2.x/dynamic/other/index.html +++ b/zh/docs/0.2.x/dynamic/other/index.html @@ -5,7 +5,7 @@ 其他动画 | Touying - + diff --git a/zh/docs/0.2.x/dynamic/simple/index.html b/zh/docs/0.2.x/dynamic/simple/index.html index 5b51ad8d5..b74038cd3 100644 --- a/zh/docs/0.2.x/dynamic/simple/index.html +++ b/zh/docs/0.2.x/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + diff --git a/zh/docs/0.2.x/external/pdfpc/index.html b/zh/docs/0.2.x/external/pdfpc/index.html index d4ab07cbd..468f5a1e4 100644 --- a/zh/docs/0.2.x/external/pdfpc/index.html +++ b/zh/docs/0.2.x/external/pdfpc/index.html @@ -5,7 +5,7 @@ pdfpc | Touying - + diff --git a/zh/docs/0.2.x/external/typst-preview/index.html b/zh/docs/0.2.x/external/typst-preview/index.html index 9327b9bb8..4b1e6d1b6 100644 --- a/zh/docs/0.2.x/external/typst-preview/index.html +++ b/zh/docs/0.2.x/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/zh/docs/0.2.x/intro/index.html b/zh/docs/0.2.x/intro/index.html index 86951eb06..e81b9e39d 100644 --- a/zh/docs/0.2.x/intro/index.html +++ b/zh/docs/0.2.x/intro/index.html @@ -5,7 +5,7 @@ Touying 介绍 | Touying - + diff --git a/zh/docs/0.2.x/layout/index.html b/zh/docs/0.2.x/layout/index.html index b830e5d72..57f31e05c 100644 --- a/zh/docs/0.2.x/layout/index.html +++ b/zh/docs/0.2.x/layout/index.html @@ -5,7 +5,7 @@ 排篇布局 | Touying - + diff --git a/zh/docs/0.2.x/progress/counters/index.html b/zh/docs/0.2.x/progress/counters/index.html index 0026151d2..a0cc2ac4c 100644 --- a/zh/docs/0.2.x/progress/counters/index.html +++ b/zh/docs/0.2.x/progress/counters/index.html @@ -5,7 +5,7 @@ Touying 的计数器 | Touying - + diff --git a/zh/docs/0.2.x/progress/sections/index.html b/zh/docs/0.2.x/progress/sections/index.html index e83f1230b..67caf43a1 100644 --- a/zh/docs/0.2.x/progress/sections/index.html +++ b/zh/docs/0.2.x/progress/sections/index.html @@ -5,7 +5,7 @@ Touying 的 Sections | Touying - + diff --git a/zh/docs/0.2.x/start/index.html b/zh/docs/0.2.x/start/index.html index 4c7f3b94a..9b5be1fed 100644 --- a/zh/docs/0.2.x/start/index.html +++ b/zh/docs/0.2.x/start/index.html @@ -5,7 +5,7 @@ 开始 | Touying - + diff --git a/zh/docs/0.2.x/style/index.html b/zh/docs/0.2.x/style/index.html index bab2d8066..6b5d79b0f 100644 --- a/zh/docs/0.2.x/style/index.html +++ b/zh/docs/0.2.x/style/index.html @@ -5,7 +5,7 @@ 代码风格 | Touying - + diff --git a/zh/docs/0.2.x/themes/dewdrop/index.html b/zh/docs/0.2.x/themes/dewdrop/index.html index 974ae7242..f30493aff 100644 --- a/zh/docs/0.2.x/themes/dewdrop/index.html +++ b/zh/docs/0.2.x/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop 主题 | Touying - + diff --git a/zh/docs/0.2.x/themes/metropolis/index.html b/zh/docs/0.2.x/themes/metropolis/index.html index 444f0847d..45ce06cc9 100644 --- a/zh/docs/0.2.x/themes/metropolis/index.html +++ b/zh/docs/0.2.x/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis 主题 | Touying - + diff --git a/zh/docs/0.2.x/themes/simple/index.html b/zh/docs/0.2.x/themes/simple/index.html index 1e99d01a4..8073bf10c 100644 --- a/zh/docs/0.2.x/themes/simple/index.html +++ b/zh/docs/0.2.x/themes/simple/index.html @@ -5,7 +5,7 @@ Simple 主题 | Touying - + diff --git a/zh/docs/0.2.x/themes/university/index.html b/zh/docs/0.2.x/themes/university/index.html index f9dfa3b34..e01ae38e2 100644 --- a/zh/docs/0.2.x/themes/university/index.html +++ b/zh/docs/0.2.x/themes/university/index.html @@ -5,7 +5,7 @@ University 主题 | Touying - + diff --git a/zh/docs/0.2.x/utilities/fit-to/index.html b/zh/docs/0.2.x/utilities/fit-to/index.html index 1eabadb62..93fa8d2fa 100644 --- a/zh/docs/0.2.x/utilities/fit-to/index.html +++ b/zh/docs/0.2.x/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to height / width | Touying - + diff --git a/zh/docs/0.2.x/utilities/oop/index.html b/zh/docs/0.2.x/utilities/oop/index.html index 678aab782..2e475319c 100644 --- a/zh/docs/0.2.x/utilities/oop/index.html +++ b/zh/docs/0.2.x/utilities/oop/index.html @@ -5,7 +5,7 @@ 面向对象编程 | Touying - + diff --git a/zh/docs/0.3.2+/build-your-own-theme/index.html b/zh/docs/0.3.2+/build-your-own-theme/index.html index 5c4595224..7dc2b6a18 100644 --- a/zh/docs/0.3.2+/build-your-own-theme/index.html +++ b/zh/docs/0.3.2+/build-your-own-theme/index.html @@ -5,7 +5,7 @@ 创建自己的主题 | Touying - + diff --git a/zh/docs/0.3.2+/category/dynamic-slides/index.html b/zh/docs/0.3.2+/category/dynamic-slides/index.html index 493de382c..19f38490c 100644 --- a/zh/docs/0.3.2+/category/dynamic-slides/index.html +++ b/zh/docs/0.3.2+/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/zh/docs/0.3.2+/category/external-tools/index.html b/zh/docs/0.3.2+/category/external-tools/index.html index 84082c8b8..a734a5005 100644 --- a/zh/docs/0.3.2+/category/external-tools/index.html +++ b/zh/docs/0.3.2+/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/zh/docs/0.3.2+/category/package-integration/index.html b/zh/docs/0.3.2+/category/package-integration/index.html index 63113b649..eb2643ca5 100644 --- a/zh/docs/0.3.2+/category/package-integration/index.html +++ b/zh/docs/0.3.2+/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/zh/docs/0.3.2+/category/progress/index.html b/zh/docs/0.3.2+/category/progress/index.html index 83a689ed9..1854a2ea5 100644 --- a/zh/docs/0.3.2+/category/progress/index.html +++ b/zh/docs/0.3.2+/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/zh/docs/0.3.2+/category/themes/index.html b/zh/docs/0.3.2+/category/themes/index.html index ce7ebff03..2a41d6d33 100644 --- a/zh/docs/0.3.2+/category/themes/index.html +++ b/zh/docs/0.3.2+/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/zh/docs/0.3.2+/category/utilities/index.html b/zh/docs/0.3.2+/category/utilities/index.html index de93617da..bc71014bf 100644 --- a/zh/docs/0.3.2+/category/utilities/index.html +++ b/zh/docs/0.3.2+/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/zh/docs/0.3.2+/changelog/index.html b/zh/docs/0.3.2+/changelog/index.html index c17e9bc1f..c38651b9a 100644 --- a/zh/docs/0.3.2+/changelog/index.html +++ b/zh/docs/0.3.2+/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/0.3.2+/code-styles/index.html b/zh/docs/0.3.2+/code-styles/index.html index 5f9fb0025..2e9862382 100644 --- a/zh/docs/0.3.2+/code-styles/index.html +++ b/zh/docs/0.3.2+/code-styles/index.html @@ -5,7 +5,7 @@ 代码风格 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/complex/index.html b/zh/docs/0.3.2+/dynamic/complex/index.html index 0ed113048..c03eb3fe2 100644 --- a/zh/docs/0.3.2+/dynamic/complex/index.html +++ b/zh/docs/0.3.2+/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/cover/index.html b/zh/docs/0.3.2+/dynamic/cover/index.html index a2adabd7e..398ab0296 100644 --- a/zh/docs/0.3.2+/dynamic/cover/index.html +++ b/zh/docs/0.3.2+/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover 函数 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/equation/index.html b/zh/docs/0.3.2+/dynamic/equation/index.html index d93b4e859..b82cb4fb8 100644 --- a/zh/docs/0.3.2+/dynamic/equation/index.html +++ b/zh/docs/0.3.2+/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/handout/index.html b/zh/docs/0.3.2+/dynamic/handout/index.html index 6483a0c5d..3eee56c59 100644 --- a/zh/docs/0.3.2+/dynamic/handout/index.html +++ b/zh/docs/0.3.2+/dynamic/handout/index.html @@ -5,7 +5,7 @@ 创建讲义 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/other/index.html b/zh/docs/0.3.2+/dynamic/other/index.html index 407c183c8..1938bd95b 100644 --- a/zh/docs/0.3.2+/dynamic/other/index.html +++ b/zh/docs/0.3.2+/dynamic/other/index.html @@ -5,7 +5,7 @@ 其他动画 | Touying - + diff --git a/zh/docs/0.3.2+/dynamic/simple/index.html b/zh/docs/0.3.2+/dynamic/simple/index.html index f98afdc97..3f6008ffb 100644 --- a/zh/docs/0.3.2+/dynamic/simple/index.html +++ b/zh/docs/0.3.2+/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + diff --git a/zh/docs/0.3.2+/external/pdfpc/index.html b/zh/docs/0.3.2+/external/pdfpc/index.html index 294ec9338..e27f5b87a 100644 --- a/zh/docs/0.3.2+/external/pdfpc/index.html +++ b/zh/docs/0.3.2+/external/pdfpc/index.html @@ -5,7 +5,7 @@ pdfpc | Touying - + diff --git a/zh/docs/0.3.2+/external/typst-preview/index.html b/zh/docs/0.3.2+/external/typst-preview/index.html index 6cd076fbb..9b9e06946 100644 --- a/zh/docs/0.3.2+/external/typst-preview/index.html +++ b/zh/docs/0.3.2+/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/zh/docs/0.3.2+/global-settings/index.html b/zh/docs/0.3.2+/global-settings/index.html index 5b25e9844..4fc2eeeaa 100644 --- a/zh/docs/0.3.2+/global-settings/index.html +++ b/zh/docs/0.3.2+/global-settings/index.html @@ -5,7 +5,7 @@ 全局设置 | Touying - + diff --git a/zh/docs/0.3.2+/integration/cetz/index.html b/zh/docs/0.3.2+/integration/cetz/index.html index 78e30bb32..c6d2b2656 100644 --- a/zh/docs/0.3.2+/integration/cetz/index.html +++ b/zh/docs/0.3.2+/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/zh/docs/0.3.2+/integration/codly/index.html b/zh/docs/0.3.2+/integration/codly/index.html index 41b1e7eb2..bce2fec49 100644 --- a/zh/docs/0.3.2+/integration/codly/index.html +++ b/zh/docs/0.3.2+/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/zh/docs/0.3.2+/integration/fletcher/index.html b/zh/docs/0.3.2+/integration/fletcher/index.html index b2c585112..1df87db80 100644 --- a/zh/docs/0.3.2+/integration/fletcher/index.html +++ b/zh/docs/0.3.2+/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/zh/docs/0.3.2+/integration/mitex/index.html b/zh/docs/0.3.2+/integration/mitex/index.html index 2cdcbc237..14bbaf454 100644 --- a/zh/docs/0.3.2+/integration/mitex/index.html +++ b/zh/docs/0.3.2+/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/zh/docs/0.3.2+/integration/pinit/index.html b/zh/docs/0.3.2+/integration/pinit/index.html index 2932786df..25e6d2f66 100644 --- a/zh/docs/0.3.2+/integration/pinit/index.html +++ b/zh/docs/0.3.2+/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/zh/docs/0.3.2+/integration/polylux/index.html b/zh/docs/0.3.2+/integration/polylux/index.html index 7f7488f44..bf0996176 100644 --- a/zh/docs/0.3.2+/integration/polylux/index.html +++ b/zh/docs/0.3.2+/integration/polylux/index.html @@ -5,7 +5,7 @@ Polylux | Touying - + diff --git a/zh/docs/0.3.2+/intro/index.html b/zh/docs/0.3.2+/intro/index.html index 8c454b017..51bc12a4f 100644 --- a/zh/docs/0.3.2+/intro/index.html +++ b/zh/docs/0.3.2+/intro/index.html @@ -5,7 +5,7 @@ Touying 介绍 | Touying - + diff --git a/zh/docs/0.3.2+/layout/index.html b/zh/docs/0.3.2+/layout/index.html index ded04f44d..894c0c391 100644 --- a/zh/docs/0.3.2+/layout/index.html +++ b/zh/docs/0.3.2+/layout/index.html @@ -5,7 +5,7 @@ 页面布局 | Touying - + diff --git a/zh/docs/0.3.2+/progress/counters/index.html b/zh/docs/0.3.2+/progress/counters/index.html index 4698b9140..f16cd7c7f 100644 --- a/zh/docs/0.3.2+/progress/counters/index.html +++ b/zh/docs/0.3.2+/progress/counters/index.html @@ -5,7 +5,7 @@ Touying 的计数器 | Touying - + diff --git a/zh/docs/0.3.2+/progress/sections/index.html b/zh/docs/0.3.2+/progress/sections/index.html index a469753ac..f4dbc109b 100644 --- a/zh/docs/0.3.2+/progress/sections/index.html +++ b/zh/docs/0.3.2+/progress/sections/index.html @@ -5,7 +5,7 @@ Touying 的 Sections | Touying - + diff --git a/zh/docs/0.3.2+/sections/index.html b/zh/docs/0.3.2+/sections/index.html index cdeb2980a..2f0b91fdc 100644 --- a/zh/docs/0.3.2+/sections/index.html +++ b/zh/docs/0.3.2+/sections/index.html @@ -5,7 +5,7 @@ 节与小节 | Touying - + diff --git a/zh/docs/0.3.2+/start/index.html b/zh/docs/0.3.2+/start/index.html index 6bc911d67..fef57eb7a 100644 --- a/zh/docs/0.3.2+/start/index.html +++ b/zh/docs/0.3.2+/start/index.html @@ -5,7 +5,7 @@ 开始 | Touying - + diff --git a/zh/docs/0.3.2+/themes/aqua/index.html b/zh/docs/0.3.2+/themes/aqua/index.html index f4ba61b21..cbd05dd65 100644 --- a/zh/docs/0.3.2+/themes/aqua/index.html +++ b/zh/docs/0.3.2+/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua 主题 | Touying - + diff --git a/zh/docs/0.3.2+/themes/dewdrop/index.html b/zh/docs/0.3.2+/themes/dewdrop/index.html index f3a520bc3..30054e9f3 100644 --- a/zh/docs/0.3.2+/themes/dewdrop/index.html +++ b/zh/docs/0.3.2+/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop 主题 | Touying - + diff --git a/zh/docs/0.3.2+/themes/metropolis/index.html b/zh/docs/0.3.2+/themes/metropolis/index.html index 91058ac0f..17c6862ad 100644 --- a/zh/docs/0.3.2+/themes/metropolis/index.html +++ b/zh/docs/0.3.2+/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis 主题 | Touying - + diff --git a/zh/docs/0.3.2+/themes/simple/index.html b/zh/docs/0.3.2+/themes/simple/index.html index 9c5143ef5..1d10c7b64 100644 --- a/zh/docs/0.3.2+/themes/simple/index.html +++ b/zh/docs/0.3.2+/themes/simple/index.html @@ -5,7 +5,7 @@ Simple 主题 | Touying - + diff --git a/zh/docs/0.3.2+/themes/university/index.html b/zh/docs/0.3.2+/themes/university/index.html index 7ac93f456..3b47dd38f 100644 --- a/zh/docs/0.3.2+/themes/university/index.html +++ b/zh/docs/0.3.2+/themes/university/index.html @@ -5,7 +5,7 @@ University 主题 | Touying - + diff --git a/zh/docs/0.3.2+/utilities/fit-to/index.html b/zh/docs/0.3.2+/utilities/fit-to/index.html index 622395ded..7f9ec2e4e 100644 --- a/zh/docs/0.3.2+/utilities/fit-to/index.html +++ b/zh/docs/0.3.2+/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to height / width | Touying - + diff --git a/zh/docs/0.3.2+/utilities/oop/index.html b/zh/docs/0.3.2+/utilities/oop/index.html index f2c8ab436..b2973eb67 100644 --- a/zh/docs/0.3.2+/utilities/oop/index.html +++ b/zh/docs/0.3.2+/utilities/oop/index.html @@ -5,7 +5,7 @@ 面向对象编程 | Touying - + diff --git a/zh/docs/0.3.x/build-your-own-theme/index.html b/zh/docs/0.3.x/build-your-own-theme/index.html index 1153a4ba8..3a69e0a4f 100644 --- a/zh/docs/0.3.x/build-your-own-theme/index.html +++ b/zh/docs/0.3.x/build-your-own-theme/index.html @@ -5,7 +5,7 @@ 创建自己的主题 | Touying - + diff --git a/zh/docs/0.3.x/category/dynamic-slides/index.html b/zh/docs/0.3.x/category/dynamic-slides/index.html index 1b0c7daa3..63dc4aae9 100644 --- a/zh/docs/0.3.x/category/dynamic-slides/index.html +++ b/zh/docs/0.3.x/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/zh/docs/0.3.x/category/external-tools/index.html b/zh/docs/0.3.x/category/external-tools/index.html index 458f6a382..66f9e2b44 100644 --- a/zh/docs/0.3.x/category/external-tools/index.html +++ b/zh/docs/0.3.x/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/zh/docs/0.3.x/category/package-integration/index.html b/zh/docs/0.3.x/category/package-integration/index.html index 70f71de31..afebcec34 100644 --- a/zh/docs/0.3.x/category/package-integration/index.html +++ b/zh/docs/0.3.x/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/zh/docs/0.3.x/category/progress/index.html b/zh/docs/0.3.x/category/progress/index.html index b10eace0d..d705bd30d 100644 --- a/zh/docs/0.3.x/category/progress/index.html +++ b/zh/docs/0.3.x/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/zh/docs/0.3.x/category/themes/index.html b/zh/docs/0.3.x/category/themes/index.html index 1a5fe4046..f2655c17d 100644 --- a/zh/docs/0.3.x/category/themes/index.html +++ b/zh/docs/0.3.x/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/zh/docs/0.3.x/category/utilities/index.html b/zh/docs/0.3.x/category/utilities/index.html index 6361c7d14..ddfa4d04d 100644 --- a/zh/docs/0.3.x/category/utilities/index.html +++ b/zh/docs/0.3.x/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/zh/docs/0.3.x/changelog/index.html b/zh/docs/0.3.x/changelog/index.html index 856019271..cb778e423 100644 --- a/zh/docs/0.3.x/changelog/index.html +++ b/zh/docs/0.3.x/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/0.3.x/code-styles/index.html b/zh/docs/0.3.x/code-styles/index.html index f68e9cc90..202894d6a 100644 --- a/zh/docs/0.3.x/code-styles/index.html +++ b/zh/docs/0.3.x/code-styles/index.html @@ -5,7 +5,7 @@ 代码风格 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/complex/index.html b/zh/docs/0.3.x/dynamic/complex/index.html index ac8ef04fd..384786aa8 100644 --- a/zh/docs/0.3.x/dynamic/complex/index.html +++ b/zh/docs/0.3.x/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/cover/index.html b/zh/docs/0.3.x/dynamic/cover/index.html index 8d6673ddd..097755ce4 100644 --- a/zh/docs/0.3.x/dynamic/cover/index.html +++ b/zh/docs/0.3.x/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover 函数 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/equation/index.html b/zh/docs/0.3.x/dynamic/equation/index.html index 042f906a5..e6d193b7e 100644 --- a/zh/docs/0.3.x/dynamic/equation/index.html +++ b/zh/docs/0.3.x/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/handout/index.html b/zh/docs/0.3.x/dynamic/handout/index.html index f30f05465..d79e3b15b 100644 --- a/zh/docs/0.3.x/dynamic/handout/index.html +++ b/zh/docs/0.3.x/dynamic/handout/index.html @@ -5,7 +5,7 @@ 创建讲义 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/other/index.html b/zh/docs/0.3.x/dynamic/other/index.html index 7eb5d7461..506a50d83 100644 --- a/zh/docs/0.3.x/dynamic/other/index.html +++ b/zh/docs/0.3.x/dynamic/other/index.html @@ -5,7 +5,7 @@ 其他动画 | Touying - + diff --git a/zh/docs/0.3.x/dynamic/simple/index.html b/zh/docs/0.3.x/dynamic/simple/index.html index 3eaff4010..53e87392d 100644 --- a/zh/docs/0.3.x/dynamic/simple/index.html +++ b/zh/docs/0.3.x/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + diff --git a/zh/docs/0.3.x/external/pdfpc/index.html b/zh/docs/0.3.x/external/pdfpc/index.html index bb3a66a15..9d65d4938 100644 --- a/zh/docs/0.3.x/external/pdfpc/index.html +++ b/zh/docs/0.3.x/external/pdfpc/index.html @@ -5,7 +5,7 @@ pdfpc | Touying - + diff --git a/zh/docs/0.3.x/external/typst-preview/index.html b/zh/docs/0.3.x/external/typst-preview/index.html index 046cfbfb6..b52875a86 100644 --- a/zh/docs/0.3.x/external/typst-preview/index.html +++ b/zh/docs/0.3.x/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/zh/docs/0.3.x/global-settings/index.html b/zh/docs/0.3.x/global-settings/index.html index 34b5f1fbc..a6ab89f15 100644 --- a/zh/docs/0.3.x/global-settings/index.html +++ b/zh/docs/0.3.x/global-settings/index.html @@ -5,7 +5,7 @@ 全局设置 | Touying - + diff --git a/zh/docs/0.3.x/integration/cetz/index.html b/zh/docs/0.3.x/integration/cetz/index.html index 065d68a26..7c50adc92 100644 --- a/zh/docs/0.3.x/integration/cetz/index.html +++ b/zh/docs/0.3.x/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/zh/docs/0.3.x/integration/codly/index.html b/zh/docs/0.3.x/integration/codly/index.html index ac737740e..28bab2d67 100644 --- a/zh/docs/0.3.x/integration/codly/index.html +++ b/zh/docs/0.3.x/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/zh/docs/0.3.x/integration/fletcher/index.html b/zh/docs/0.3.x/integration/fletcher/index.html index 87e6b180c..8de0d3354 100644 --- a/zh/docs/0.3.x/integration/fletcher/index.html +++ b/zh/docs/0.3.x/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/zh/docs/0.3.x/integration/mitex/index.html b/zh/docs/0.3.x/integration/mitex/index.html index 2a4cc1c87..5191e3c89 100644 --- a/zh/docs/0.3.x/integration/mitex/index.html +++ b/zh/docs/0.3.x/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/zh/docs/0.3.x/integration/pinit/index.html b/zh/docs/0.3.x/integration/pinit/index.html index cd6408aab..7fc08a533 100644 --- a/zh/docs/0.3.x/integration/pinit/index.html +++ b/zh/docs/0.3.x/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/zh/docs/0.3.x/integration/polylux/index.html b/zh/docs/0.3.x/integration/polylux/index.html index 70539070c..da98f6572 100644 --- a/zh/docs/0.3.x/integration/polylux/index.html +++ b/zh/docs/0.3.x/integration/polylux/index.html @@ -5,7 +5,7 @@ Polylux | Touying - + diff --git a/zh/docs/0.3.x/intro/index.html b/zh/docs/0.3.x/intro/index.html index 341d11eaf..2aa8ea8ef 100644 --- a/zh/docs/0.3.x/intro/index.html +++ b/zh/docs/0.3.x/intro/index.html @@ -5,7 +5,7 @@ Touying 介绍 | Touying - + diff --git a/zh/docs/0.3.x/layout/index.html b/zh/docs/0.3.x/layout/index.html index 7f8a1bdba..16af07e11 100644 --- a/zh/docs/0.3.x/layout/index.html +++ b/zh/docs/0.3.x/layout/index.html @@ -5,7 +5,7 @@ 页面布局 | Touying - + diff --git a/zh/docs/0.3.x/progress/counters/index.html b/zh/docs/0.3.x/progress/counters/index.html index 72013ca99..af8dc117b 100644 --- a/zh/docs/0.3.x/progress/counters/index.html +++ b/zh/docs/0.3.x/progress/counters/index.html @@ -5,7 +5,7 @@ Touying 的计数器 | Touying - + diff --git a/zh/docs/0.3.x/progress/sections/index.html b/zh/docs/0.3.x/progress/sections/index.html index e0779f40e..8b37bcc0b 100644 --- a/zh/docs/0.3.x/progress/sections/index.html +++ b/zh/docs/0.3.x/progress/sections/index.html @@ -5,7 +5,7 @@ Touying 的 Sections | Touying - + diff --git a/zh/docs/0.3.x/sections/index.html b/zh/docs/0.3.x/sections/index.html index b4fe73971..a00542927 100644 --- a/zh/docs/0.3.x/sections/index.html +++ b/zh/docs/0.3.x/sections/index.html @@ -5,7 +5,7 @@ 节与小节 | Touying - + diff --git a/zh/docs/0.3.x/start/index.html b/zh/docs/0.3.x/start/index.html index b03c219ff..05f07da40 100644 --- a/zh/docs/0.3.x/start/index.html +++ b/zh/docs/0.3.x/start/index.html @@ -5,7 +5,7 @@ 开始 | Touying - + diff --git a/zh/docs/0.3.x/themes/dewdrop/index.html b/zh/docs/0.3.x/themes/dewdrop/index.html index 465579faa..0c3a9a195 100644 --- a/zh/docs/0.3.x/themes/dewdrop/index.html +++ b/zh/docs/0.3.x/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop 主题 | Touying - + diff --git a/zh/docs/0.3.x/themes/metropolis/index.html b/zh/docs/0.3.x/themes/metropolis/index.html index 38180b601..a7d6adb4b 100644 --- a/zh/docs/0.3.x/themes/metropolis/index.html +++ b/zh/docs/0.3.x/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis 主题 | Touying - + diff --git a/zh/docs/0.3.x/themes/simple/index.html b/zh/docs/0.3.x/themes/simple/index.html index f461338da..9664c55ed 100644 --- a/zh/docs/0.3.x/themes/simple/index.html +++ b/zh/docs/0.3.x/themes/simple/index.html @@ -5,7 +5,7 @@ Simple 主题 | Touying - + diff --git a/zh/docs/0.3.x/themes/university/index.html b/zh/docs/0.3.x/themes/university/index.html index 00da918c8..3f0da04bc 100644 --- a/zh/docs/0.3.x/themes/university/index.html +++ b/zh/docs/0.3.x/themes/university/index.html @@ -5,7 +5,7 @@ University 主题 | Touying - + diff --git a/zh/docs/0.3.x/utilities/fit-to/index.html b/zh/docs/0.3.x/utilities/fit-to/index.html index 26641a760..9cca279c1 100644 --- a/zh/docs/0.3.x/utilities/fit-to/index.html +++ b/zh/docs/0.3.x/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to height / width | Touying - + diff --git a/zh/docs/0.3.x/utilities/oop/index.html b/zh/docs/0.3.x/utilities/oop/index.html index 4b24e372b..79768a5e2 100644 --- a/zh/docs/0.3.x/utilities/oop/index.html +++ b/zh/docs/0.3.x/utilities/oop/index.html @@ -5,7 +5,7 @@ 面向对象编程 | Touying - + diff --git a/zh/docs/build-your-own-theme/index.html b/zh/docs/build-your-own-theme/index.html index f1748414e..e23b0a8f2 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 67859f67d..e79416878 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 99acbca19..55592d4d9 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/package-integration/index.html b/zh/docs/category/package-integration/index.html index 7084418fc..eb88b8001 100644 --- a/zh/docs/category/package-integration/index.html +++ b/zh/docs/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/zh/docs/category/progress/index.html b/zh/docs/category/progress/index.html index 7533310fd..55fee8d22 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 d16942e37..e96d42733 100644 --- a/zh/docs/category/themes/index.html +++ b/zh/docs/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/zh/docs/category/utilities/index.html b/zh/docs/category/utilities/index.html index 70fcfab88..a81d6f213 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 6152924ac..70499ac1e 100644 --- a/zh/docs/changelog/index.html +++ b/zh/docs/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/code-styles/index.html b/zh/docs/code-styles/index.html index 2f6640cd9..3fb7d9df2 100644 --- a/zh/docs/code-styles/index.html +++ b/zh/docs/code-styles/index.html @@ -5,7 +5,7 @@ 代码风格 | Touying - + diff --git a/zh/docs/dynamic/complex/index.html b/zh/docs/dynamic/complex/index.html index 209c8beb2..a004b5fb9 100644 --- a/zh/docs/dynamic/complex/index.html +++ b/zh/docs/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + diff --git a/zh/docs/dynamic/cover/index.html b/zh/docs/dynamic/cover/index.html index 867f21d3a..2aa0db5ba 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 d68b8ac55..d6b7a341c 100644 --- a/zh/docs/dynamic/equation/index.html +++ b/zh/docs/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + diff --git a/zh/docs/dynamic/handout/index.html b/zh/docs/dynamic/handout/index.html index 7dccb086d..034b29390 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/other/index.html b/zh/docs/dynamic/other/index.html index 0ce29caf7..8c18fdbc4 100644 --- a/zh/docs/dynamic/other/index.html +++ b/zh/docs/dynamic/other/index.html @@ -5,7 +5,7 @@ 其他动画 | Touying - + diff --git a/zh/docs/dynamic/simple/index.html b/zh/docs/dynamic/simple/index.html index 9c09c442a..5e1cd1798 100644 --- a/zh/docs/dynamic/simple/index.html +++ b/zh/docs/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + diff --git a/zh/docs/external/pdfpc/index.html b/zh/docs/external/pdfpc/index.html index ae925da67..fb5bb4ea4 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 13f237d72..d743bf69d 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/global-settings/index.html b/zh/docs/global-settings/index.html index 60e2c5bc7..85c075e2c 100644 --- a/zh/docs/global-settings/index.html +++ b/zh/docs/global-settings/index.html @@ -5,7 +5,7 @@ 全局设置 | Touying - + diff --git a/zh/docs/integration/cetz/index.html b/zh/docs/integration/cetz/index.html index e98cc9e63..bbc23a981 100644 --- a/zh/docs/integration/cetz/index.html +++ b/zh/docs/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + diff --git a/zh/docs/integration/codly/index.html b/zh/docs/integration/codly/index.html index 58653d27b..c0e5faf65 100644 --- a/zh/docs/integration/codly/index.html +++ b/zh/docs/integration/codly/index.html @@ -5,7 +5,7 @@ Codly | Touying - + diff --git a/zh/docs/integration/ctheorems/index.html b/zh/docs/integration/ctheorems/index.html index a6bbdb617..3946625b0 100644 --- a/zh/docs/integration/ctheorems/index.html +++ b/zh/docs/integration/ctheorems/index.html @@ -5,7 +5,7 @@ Ctheorems | Touying - + diff --git a/zh/docs/integration/fletcher/index.html b/zh/docs/integration/fletcher/index.html index 021ffeeff..f8f2efbb2 100644 --- a/zh/docs/integration/fletcher/index.html +++ b/zh/docs/integration/fletcher/index.html @@ -5,7 +5,7 @@ Fletcher | Touying - + diff --git a/zh/docs/integration/mitex/index.html b/zh/docs/integration/mitex/index.html index faacf2b83..8f3991fd2 100644 --- a/zh/docs/integration/mitex/index.html +++ b/zh/docs/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/zh/docs/integration/pinit/index.html b/zh/docs/integration/pinit/index.html index 70caeaa0a..b5d07e03a 100644 --- a/zh/docs/integration/pinit/index.html +++ b/zh/docs/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + diff --git a/zh/docs/intro/index.html b/zh/docs/intro/index.html index 8ef13b996..fa95a7a71 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 0e8084ab5..7ac264fde 100644 --- a/zh/docs/layout/index.html +++ b/zh/docs/layout/index.html @@ -5,7 +5,7 @@ 页面布局 | Touying - + diff --git a/zh/docs/multi-file/index.html b/zh/docs/multi-file/index.html index 516e911a6..649545c32 100644 --- a/zh/docs/multi-file/index.html +++ b/zh/docs/multi-file/index.html @@ -5,7 +5,7 @@ 多文件架构 | Touying - + diff --git a/zh/docs/next/build-your-own-theme/index.html b/zh/docs/next/build-your-own-theme/index.html index 77c8a09e4..fce316edf 100644 --- a/zh/docs/next/build-your-own-theme/index.html +++ b/zh/docs/next/build-your-own-theme/index.html @@ -5,7 +5,7 @@ 创建自己的主题 | Touying - + @@ -28,17 +28,17 @@

      修改已
      1. themes 目录下的 主题代码 复制到本地,例如将 themes/university.typ 复制到本地 university.typ 中。
      2. university.typ 文件顶部的 #import "../xxx.typ" 命令全部移除。
      3. -
      4. university.typ 文件顶部中加入 #import "@preview/touying:0.4.0": * 来导入所有模块。
      5. +
      6. university.typ 文件顶部中加入 #import "@preview/touying:0.4.1": * 来导入所有模块。
      7. register 函数中的 self: s 替换成 self: themes.default.register() (重要)

      然后就可以通过

      -
      #import "@preview/touying:0.4.0": *
      #import "university.typ"

      #let s = university.register(aspect-ratio: "16-9")
      +
      #import "@preview/touying:0.4.1": *
      #import "university.typ"

      #let s = university.register(aspect-ratio: "16-9")

      的方式导入和使用主题了。

      一个具体的示例:https://typst.app/project/rqRuzg0keo_ZEB5AdxjweA

      导入

      取决于这个主题是你自己的,还是 Touying 的一部分,你可以用两种方式导入:

      如果只是你自己使用,你可以直接导入 Touying:

      -
      #import "@preview/touying:0.4.0": *
      +
      #import "@preview/touying:0.4.1": *

      如果你希望这个主题作为 Touying 的一部分,放置在 Touying themes 目录下,那你应该将上面的导入语句改为

      #import "../utils/utils.typ"
      #import "../utils/states.typ"
      #import "../utils/components.typ"

      并且要在 Touying 的 themes/themes.typ 里加上

      @@ -46,7 +46,7 @@

      导入register 函数和 init 方法

      接下来,我们会区分 bamboo.typ 模板文件和 main.typ 文件,后者有时会被省略。

      一般而言,我们制作 slides 的第一步,就是确定好字体大小和页面长宽比,因此我们需要注册一个初始化方法:

      -
      // bamboo.typ
      #import "@preview/touying:0.4.0": *

      #let register(
      self: themes.default.register(),
      aspect-ratio: "16-9",
      ) = {
      self.page-args += (
      paper: "presentation-" + aspect-ratio,
      )
      self.methods.init = (self: none, body) => {
      set text(size: 20pt)
      body
      }
      self
      }

      // main.typ
      #import "@preview/touying:0.4.0": *
      #import "bamboo.typ"

      #let s = bamboo.register(aspect-ratio: "16-9")
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = First Section

      == First Slide

      #slide[
      A slide with a title and an *important* information.
      ]
      +
      // bamboo.typ
      #import "@preview/touying:0.4.1": *

      #let register(
      self: themes.default.register(),
      aspect-ratio: "16-9",
      ) = {
      self.page-args += (
      paper: "presentation-" + aspect-ratio,
      )
      self.methods.init = (self: none, body) => {
      set text(size: 20pt)
      body
      }
      self
      }

      // main.typ
      #import "@preview/touying:0.4.1": *
      #import "bamboo.typ"

      #let s = bamboo.register(aspect-ratio: "16-9")
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = First Section

      == First Slide

      #slide[
      A slide with a title and an *important* information.
      ]

      如您所见,我们创建了一个 register 函数,并传入了一个 aspect-ratio 参数来设定页面长宽比。我们使用 self: themes.default.register() 的方式,获得了缺省的 self。然后我们就需要设置页面参数了。您应该已经知道了,在 Touying 中,我们不应该使用 set page(..) 来设置页面参数,而是应该使用 self.page-args += (..) 这种语法来设置,具体内容可以参考页面布局章节。

      除此之外,我们还注册了一个 self.methods.init 方法,它可以用来进行一些全局的样式设置,例如在此处,我们加上了 set text(size: 20pt) 来设置文字大小。你也可以在这里放置一些额外的全局样式设置,例如 set par(justify: true) 等。由于 init 函数被放置到了 self.methods 里,是一个方法,而非普通函数,因此我们需要加上 self: none 参数才能正常使用。

      如您所见,后续在 main.typ 中,我们会通过 #show: init 来应用 init 方法里面的全局样式设置,其中 init 函数是通过 utils.methods(s) 绑定并解包而来的。

      @@ -75,7 +75,7 @@

      自定义特殊 Slide

      我们在上面的基础 slide 的基础上,进一步加入一些特殊的 slide 函数,例如 title-slidefocus-slide 以及自定义 slides 方法。

      @@ -83,7 +83,7 @@

      自定

      对于 new-section-slide 方法,也是同理,不过唯一要注意的是我们在 (self.methods.touying-slide)(self: self, repeat: none, section: section, body) 的参数里面多传入了一个 section: section,这是用来声明新建一个 section 的。另一点需要注意的是,我们除了 self.methods.new-section-slide = new-section-slide,还注册了 self.methods.touying-new-section-slide = new-section-slide,这样 new-section-slide 就会在碰到一级标题时自动被调用。

      对于 focus-slide 方法,大部分内容也基本一致,不过值得注意的是,我们通过 self.page-args += (..) 更新了页面的背景颜色。

      最后,我们还更新了 slides(self: none, title-slide: true, slide-level: 1, ..args) 方法,其中 title-slidetrue 时,在使用 #show: slides 后会自动创建一个 title-slide;而 slide-level: 1 指明了一级标题和二级标题分别对应 sectiontitle

      -
      // bamboo.typ
      #import "@preview/touying:0.4.0": *

      #let slide(self: none, title: auto, ..args) = {
      if title != auto {
      self.bamboo-title = title
      }
      (self.methods.touying-slide)(self: self, ..args)
      }

      #let title-slide(self: none, ..args) = {
      self = utils.empty-page(self)
      let info = self.info + args.named()
      let body = {
      set align(center + horizon)
      block(
      fill: self.colors.primary,
      width: 80%,
      inset: (y: 1em),
      radius: 1em,
      text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)
      )
      set text(fill: self.colors.neutral-darkest)
      if info.author != none {
      block(info.author)
      }
      if info.date != none {
      block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })
      }
      }
      (self.methods.touying-slide)(self: self, repeat: none, body)
      }

      #let new-section-slide(self: none, section) = {
      self = utils.empty-page(self)
      let body = {
      set align(center + horizon)
      set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")
      section
      }
      (self.methods.touying-slide)(self: self, repeat: none, section: section, body)
      }

      #let focus-slide(self: none, body) = {
      self = utils.empty-page(self)
      self.page-args += (
      fill: self.colors.primary,
      margin: 2em,
      )
      set text(fill: self.colors.neutral-lightest, size: 2em)
      (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))
      }

      #let slides(self: none, title-slide: true, slide-level: 1, ..args) = {
      if title-slide {
      (self.methods.title-slide)(self: self)
      }
      (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)
      }

      #let register(
      self: themes.default.register(),
      aspect-ratio: "16-9",
      footer: [],
      ) = {
      // color theme
      self = (self.methods.colors)(
      self: self,
      primary: rgb("#5E8B65"),
      neutral-lightest: rgb("#ffffff"),
      neutral-darkest: rgb("#000000"),
      )
      // variables for later use
      self.bamboo-title = []
      self.bamboo-footer = footer
      // set page
      let header(self) = {
      set align(top)
      show: components.cell.with(fill: self.colors.primary, inset: 1em)
      set align(horizon)
      set text(fill: self.colors.neutral-lightest, size: .7em)
      states.current-section-title
      linebreak()
      set text(size: 1.5em)
      utils.call-or-display(self, self.bamboo-title)
      }
      let footer(self) = {
      set align(bottom)
      show: pad.with(.4em)
      set text(fill: self.colors.neutral-darkest, size: .8em)
      utils.call-or-display(self, self.bamboo-footer)
      h(1fr)
      states.slide-counter.display() + " / " + states.last-slide-number
      }
      self.page-args += (
      paper: "presentation-" + aspect-ratio,
      header: header,
      footer: footer,
      margin: (top: 4em, bottom: 1.5em, x: 2em),
      )
      // register methods
      self.methods.slide = slide
      self.methods.title-slide = title-slide
      self.methods.new-section-slide = new-section-slide
      self.methods.touying-new-section-slide = new-section-slide
      self.methods.focus-slide = focus-slide
      self.methods.slides = slides
      self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
      self.methods.init = (self: none, body) => {
      set text(size: 20pt)
      body
      }
      self
      }


      // main.typ
      #import "@preview/touying:0.4.0": *
      #import "bamboo.typ"

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)
      #show: slides

      = First Section

      == First Slide

      #slide[
      A slide with a title and an *important* information.
      ]

      #focus-slide[
      Focus on it!
      ]
      +
      // bamboo.typ
      #import "@preview/touying:0.4.1": *

      #let slide(self: none, title: auto, ..args) = {
      if title != auto {
      self.bamboo-title = title
      }
      (self.methods.touying-slide)(self: self, ..args)
      }

      #let title-slide(self: none, ..args) = {
      self = utils.empty-page(self)
      let info = self.info + args.named()
      let body = {
      set align(center + horizon)
      block(
      fill: self.colors.primary,
      width: 80%,
      inset: (y: 1em),
      radius: 1em,
      text(size: 2em, fill: self.colors.neutral-lightest, weight: "bold", info.title)
      )
      set text(fill: self.colors.neutral-darkest)
      if info.author != none {
      block(info.author)
      }
      if info.date != none {
      block(if type(info.date) == datetime { info.date.display(self.datetime-format) } else { info.date })
      }
      }
      (self.methods.touying-slide)(self: self, repeat: none, body)
      }

      #let new-section-slide(self: none, section) = {
      self = utils.empty-page(self)
      let body = {
      set align(center + horizon)
      set text(size: 2em, fill: self.colors.primary, weight: "bold", style: "italic")
      section
      }
      (self.methods.touying-slide)(self: self, repeat: none, section: section, body)
      }

      #let focus-slide(self: none, body) = {
      self = utils.empty-page(self)
      self.page-args += (
      fill: self.colors.primary,
      margin: 2em,
      )
      set text(fill: self.colors.neutral-lightest, size: 2em)
      (self.methods.touying-slide)(self: self, repeat: none, align(horizon + center, body))
      }

      #let slides(self: none, title-slide: true, slide-level: 1, ..args) = {
      if title-slide {
      (self.methods.title-slide)(self: self)
      }
      (self.methods.touying-slides)(self: self, slide-level: slide-level, ..args)
      }

      #let register(
      self: themes.default.register(),
      aspect-ratio: "16-9",
      footer: [],
      ) = {
      // color theme
      self = (self.methods.colors)(
      self: self,
      primary: rgb("#5E8B65"),
      neutral-lightest: rgb("#ffffff"),
      neutral-darkest: rgb("#000000"),
      )
      // variables for later use
      self.bamboo-title = []
      self.bamboo-footer = footer
      // set page
      let header(self) = {
      set align(top)
      show: components.cell.with(fill: self.colors.primary, inset: 1em)
      set align(horizon)
      set text(fill: self.colors.neutral-lightest, size: .7em)
      states.current-section-title
      linebreak()
      set text(size: 1.5em)
      utils.call-or-display(self, self.bamboo-title)
      }
      let footer(self) = {
      set align(bottom)
      show: pad.with(.4em)
      set text(fill: self.colors.neutral-darkest, size: .8em)
      utils.call-or-display(self, self.bamboo-footer)
      h(1fr)
      states.slide-counter.display() + " / " + states.last-slide-number
      }
      self.page-args += (
      paper: "presentation-" + aspect-ratio,
      header: header,
      footer: footer,
      margin: (top: 4em, bottom: 1.5em, x: 2em),
      )
      // register methods
      self.methods.slide = slide
      self.methods.title-slide = title-slide
      self.methods.new-section-slide = new-section-slide
      self.methods.touying-new-section-slide = new-section-slide
      self.methods.focus-slide = focus-slide
      self.methods.slides = slides
      self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
      self.methods.init = (self: none, body) => {
      set text(size: 20pt)
      body
      }
      self
      }


      // main.typ
      #import "@preview/touying:0.4.1": *
      #import "bamboo.typ"

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

      #show strong: alert

      #let (slide, empty-slide, title-slide, focus-slide) = utils.slides(s)
      #show: slides

      = First Section

      == First Slide

      #slide[
      A slide with a title and an *important* information.
      ]

      #focus-slide[
      Focus on it!
      ]

      image

      总结

      至此,我们就已经创建了一个简洁又美观的主题了。也许你会觉得,Touying 引入的概念过于丰富了,以至于让人一时很难轻易接受。这是正常的,在强大的功能与简洁的概念之间,Touying 选择了前者。但是也正是得益于 Touying 这种大而全的统一理念,你可以很容易地在不同的主题之间抽离出共通之处,并将你学到的概念迁移到另一个主题上。亦或者,你可以很轻易地保存全局变量,或者更改已有的主题,例如全局保存主题颜色,替换掉 slides 的 header,或者添加一两个 Logo 等,这也正是 Touying 解耦与面向对象编程带来的好处。

      diff --git a/zh/docs/next/category/dynamic-slides/index.html b/zh/docs/next/category/dynamic-slides/index.html index 12a726058..a652b846a 100644 --- a/zh/docs/next/category/dynamic-slides/index.html +++ b/zh/docs/next/category/dynamic-slides/index.html @@ -5,7 +5,7 @@ Dynamic Slides | Touying - + diff --git a/zh/docs/next/category/external-tools/index.html b/zh/docs/next/category/external-tools/index.html index 7e70af488..49d8e202c 100644 --- a/zh/docs/next/category/external-tools/index.html +++ b/zh/docs/next/category/external-tools/index.html @@ -5,7 +5,7 @@ External Tools | Touying - + diff --git a/zh/docs/next/category/package-integration/index.html b/zh/docs/next/category/package-integration/index.html index 99a2cddbe..fcb789efe 100644 --- a/zh/docs/next/category/package-integration/index.html +++ b/zh/docs/next/category/package-integration/index.html @@ -5,7 +5,7 @@ Package Integration | Touying - + diff --git a/zh/docs/next/category/progress/index.html b/zh/docs/next/category/progress/index.html index aff5c8c7d..87439e29d 100644 --- a/zh/docs/next/category/progress/index.html +++ b/zh/docs/next/category/progress/index.html @@ -5,7 +5,7 @@ Progress | Touying - + diff --git a/zh/docs/next/category/themes/index.html b/zh/docs/next/category/themes/index.html index 7d3bbc60a..9d4d7f83b 100644 --- a/zh/docs/next/category/themes/index.html +++ b/zh/docs/next/category/themes/index.html @@ -5,7 +5,7 @@ Themes | Touying - + diff --git a/zh/docs/next/category/utilities/index.html b/zh/docs/next/category/utilities/index.html index 5db7850ae..e099b0d81 100644 --- a/zh/docs/next/category/utilities/index.html +++ b/zh/docs/next/category/utilities/index.html @@ -5,7 +5,7 @@ Utilities | Touying - + diff --git a/zh/docs/next/changelog/index.html b/zh/docs/next/changelog/index.html index 970009690..fb4074a05 100644 --- a/zh/docs/next/changelog/index.html +++ b/zh/docs/next/changelog/index.html @@ -5,7 +5,7 @@ 更新日志 | Touying - + diff --git a/zh/docs/next/code-styles/index.html b/zh/docs/next/code-styles/index.html index 2e9f31aa4..87feee36b 100644 --- a/zh/docs/next/code-styles/index.html +++ b/zh/docs/next/code-styles/index.html @@ -5,21 +5,21 @@ 代码风格 | Touying - +
      版本:Next

      代码风格

      简单风格

      如果我们只是需要简单使用,我们可以直接在标题下输入内容,就像是在编写正常 Typst 文档一样。这里的标题有着分割页面的作用,同时我们也能正常地使用 #pause 等命令实现动画效果。

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

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!

      image

      并且你可以使用空标题 == 创建一个新页,这个技巧也有助于清除上一个标题的继续应用。

      PS:我们可以使用 #slides-end 记号来标志 #show: slides 的结束。

      块风格

      很多时候,仅仅使用简单风格并不能实现我们需要的所有功能,为了更强大的功能和更清晰的结构,我们同样可以使用 #slide[...] 形式的块风格,其中 #slide 函数需要使用 #let (slide, empty-slide) = utils.slides(s) 语法进行解包,才能正常在 #show: slides 后使用。

      例如上面的例子就可以改造成

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

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      #slide[
      Hello, Touying!

      #pause

      Hello, Typst!
      ]
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      #slide[
      Hello, Touying!

      #pause

      Hello, Typst!
      ]

      以及 #empty-slide[] 可以创建一个没有 header 和 footer 的空 Slide。

      这样做的好处有很多:

        @@ -31,15 +31,15 @@

        块风格约定优于配置

        你可能注意到了,在使用 simple 主题时,我们使用一级标题会自动创建一个 section slide,这是因为 simple 主题注册了一个 s.methods.touying-new-section-slide 方法,因此 touying 会默认调用这个方法。

        如果我们不希望它自动创建这样一个 section slide,我们可以将这个方法删除:

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

        #let s = themes.simple.register()
        #(s.methods.touying-new-section-slide = none)
        #let (init, slides) = utils.methods(s)
        #show: init

        #let (slide, empty-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!
        +
        #import "@preview/touying:0.4.1": *

        #let s = themes.simple.register()
        #(s.methods.touying-new-section-slide = none)
        #let (init, slides) = utils.methods(s)
        #show: init

        #let (slide, empty-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!

        image

        如你所见,这样就只会剩下两页,而默认的 section slide 就会消失了。

        同理,我们也可以注册一个新的 section slide:

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

        #let s = themes.simple.register()
        #(s.methods.touying-new-section-slide = (self: none, section, ..args) => {
        self = utils.empty-page(self)
        (s.methods.touying-slide)(self: self, section: section, {
        set align(center + horizon)
        set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")
        section
        }, ..args)
        })
        #let (init, slides, touying-outline) = utils.methods(s)
        #show: init

        #let (slide, empty-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!
        +
        #import "@preview/touying:0.4.1": *

        #let s = themes.simple.register()
        #(s.methods.touying-new-section-slide = (self: none, section, ..args) => {
        self = utils.empty-page(self)
        (s.methods.touying-slide)(self: self, section: section, {
        set align(center + horizon)
        set text(size: 2em, fill: s.colors.primary, style: "italic", weight: "bold")
        section
        }, ..args)
        })
        #let (init, slides, touying-outline) = utils.methods(s)
        #show: init

        #let (slide, empty-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!

        image

        同样地,我们也可以修改 s.methods.touying-new-subsection-slide 来对 subsection 做同样的事。

        实际上,除了 s.methods.touying-new-section-slide,另一个特殊的 slide 函数就是 s.methods.slide 函数,它会在简单风格里没有显示使用 #slide[...] 的情况下默认被调用。

        同时,由于 #slide[...] 被注册在了 s.slides = ("slide",) 里,因此 sectionsubsectiontitle 参数会被自动传入,而其他的如 #focus-slide[...] 则不会自动传入这三个参数。

        -
        原理

        实际上,你也可以不使用 #show: slidesutils.slides(s),而是只使用 utils.methods(s),例如

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

        #let s = themes.simple.register()
        #let (init, touying-outline, slide) = utils.methods(s)
        #show: init

        #slide(section: [Title], title: [First Slide])[
        Hello, Touying!

        #pause

        Hello, Typst!
        ]

        这时候需要手动传入 sectionsubsectiontitle,但是会有更好的性能,适合需要更快的性能的情况,例如超过数十数百页的情形。

      +
      原理

      实际上,你也可以不使用 #show: slidesutils.slides(s),而是只使用 utils.methods(s),例如

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

      #let s = themes.simple.register()
      #let (init, touying-outline, slide) = utils.methods(s)
      #show: init

      #slide(section: [Title], title: [First Slide])[
      Hello, Touying!

      #pause

      Hello, Typst!
      ]

      这时候需要手动传入 sectionsubsectiontitle,但是会有更好的性能,适合需要更快的性能的情况,例如超过数十数百页的情形。

      \ No newline at end of file diff --git a/zh/docs/next/dynamic/complex/index.html b/zh/docs/next/dynamic/complex/index.html index abbaf6c70..cd1f583a7 100644 --- a/zh/docs/next/dynamic/complex/index.html +++ b/zh/docs/next/dynamic/complex/index.html @@ -5,7 +5,7 @@ 复杂动画 | Touying - + diff --git a/zh/docs/next/dynamic/cover/index.html b/zh/docs/next/dynamic/cover/index.html index bd840d807..e2855678a 100644 --- a/zh/docs/next/dynamic/cover/index.html +++ b/zh/docs/next/dynamic/cover/index.html @@ -5,7 +5,7 @@ Cover 函数 | Touying - + diff --git a/zh/docs/next/dynamic/equation/index.html b/zh/docs/next/dynamic/equation/index.html index 70f779248..f9b93be89 100644 --- a/zh/docs/next/dynamic/equation/index.html +++ b/zh/docs/next/dynamic/equation/index.html @@ -5,7 +5,7 @@ 数学公式动画 | Touying - + diff --git a/zh/docs/next/dynamic/handout/index.html b/zh/docs/next/dynamic/handout/index.html index 19f84c2d8..3e54620ec 100644 --- a/zh/docs/next/dynamic/handout/index.html +++ b/zh/docs/next/dynamic/handout/index.html @@ -5,7 +5,7 @@ 创建讲义 | Touying - + diff --git a/zh/docs/next/dynamic/other/index.html b/zh/docs/next/dynamic/other/index.html index e78d991fb..3a8815bd9 100644 --- a/zh/docs/next/dynamic/other/index.html +++ b/zh/docs/next/dynamic/other/index.html @@ -5,7 +5,7 @@ 其他动画 | Touying - + @@ -13,7 +13,7 @@

      Touying 还提供了 touying-reducer,它能为 cetz 与 fletcher 加入 pausemeanwhile 动画。

      简单动画

      一个例子:

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]

      image

      only 与 uncover

      事实上,我们也可以在 cetz 内部使用 onlyuncover,只是需要一点技巧:

      diff --git a/zh/docs/next/dynamic/simple/index.html b/zh/docs/next/dynamic/simple/index.html index 3dddcd39c..7fba3f89a 100644 --- a/zh/docs/next/dynamic/simple/index.html +++ b/zh/docs/next/dynamic/simple/index.html @@ -5,7 +5,7 @@ 简单动画 | Touying - + diff --git a/zh/docs/next/external/pdfpc/index.html b/zh/docs/next/external/pdfpc/index.html index fa48dee12..5c453dc3a 100644 --- a/zh/docs/next/external/pdfpc/index.html +++ b/zh/docs/next/external/pdfpc/index.html @@ -5,7 +5,7 @@ pdfpc | Touying - + @@ -24,6 +24,6 @@

      pdfpc 配置
      typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc

      直接导出 .pdfpc 文件。

      借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要加入下面的代码即可。

      -
      #import "@preview/touying:0.4.0"

      #locate(loc => touying.pdfpc.pdfpc-file(loc))
      +
      #import "@preview/touying:0.4.1"

      #locate(loc => touying.pdfpc.pdfpc-file(loc))
      \ No newline at end of file diff --git a/zh/docs/next/external/pympress/index.html b/zh/docs/next/external/pympress/index.html index b265e4d9c..8973d4d7f 100644 --- a/zh/docs/next/external/pympress/index.html +++ b/zh/docs/next/external/pympress/index.html @@ -5,14 +5,14 @@ Pympress | Touying - +
      版本:Next

      Pympress

      Pympress is a PDF presentation tool designed for dual-screen setups such as presentations and public talks. Highly configurable, fully-featured, and portable

      Speaker Notes

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

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

      // Set the speaker notes configuration, you can show it by pympress
      #let s = (s.methods.show-notes-on-second-screen)(self: s, right)

      #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Animation

      == Simple Animation

      We can use `#pause` to #pause display something later.

      #pause

      Just like this.

      #meanwhile

      Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.

      #speaker-note[
      + This is a speaker note.
      + You won't see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`
      ]
      +
      #import "@preview/touying:0.4.1": *

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

      // Set the speaker notes configuration, you can show it by pympress
      #let s = (s.methods.show-notes-on-second-screen)(self: s, right)

      #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Animation

      == Simple Animation

      We can use `#pause` to #pause display something later.

      #pause

      Just like this.

      #meanwhile

      Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.

      #speaker-note[
      + This is a speaker note.
      + You won't see it unless you use `#let s = (s.math.show-notes-on-second-screen)(self: s, right)`
      ]

      image

      Then we can use the pympress to show it.

      image

      diff --git a/zh/docs/next/external/typst-preview/index.html b/zh/docs/next/external/typst-preview/index.html index 6a70f3119..2cfeab31a 100644 --- a/zh/docs/next/external/typst-preview/index.html +++ b/zh/docs/next/external/typst-preview/index.html @@ -5,7 +5,7 @@ Typst Preview | Touying - + diff --git a/zh/docs/next/global-settings/index.html b/zh/docs/next/global-settings/index.html index 3de2bca0b..3e5bdadf8 100644 --- a/zh/docs/next/global-settings/index.html +++ b/zh/docs/next/global-settings/index.html @@ -5,7 +5,7 @@ 全局设置 | Touying - + @@ -30,7 +30,7 @@

      全局信息
      原理

      在这里,我们会稍微引入一点 Touying 的 OOP 概念。

      您应该知道,Typst 是一个支持增量渲染的排版语言,也就是说,Typst 会缓存之前的函数调用结果,这就要求 Typst 里只有纯函数,即无法改变外部变量的函数。因此我们很难真正意义上地像 LaTeX 那样修改一个全局变量。即使是使用 statecounter,也需要使用 locate 与回调函数来获取里面的值,且实际上这种方式会对性能有很大的影响。

      Touying 并没有使用 statecounter,也没有违反 Typst 纯函数的原则,而是使用了一种巧妙的方式,并以面向对象风格的代码,维护了一个全局单例 s。在 Touying 中,一个对象指拥有自己的成员变量和方法的 Typst 字典,并且我们约定方法均有一个命名参数 self 用于传入对象自身,并且方法均放在 .methods 域里。有了这个理念,我们就不难写出更新 info 的方法了:

      #let s = (
      info: (:),
      methods: (
      // update info
      info: (self: none, ..args) => {
      self.info += args.named()
      self
      },
      )
      )

      #let s = (s.methods.info)(self: s, title: [title])

      Title is #s.info.title

      这样,你也能够理解 utils.methods() 函数的用途了:将 self 绑定到 s 的所有方法上并返回,并通过解包语法简化后续的使用。

      #let (init, slides, alert) = utils.methods(s)

      状态初始化

      一般而言,上面的两种方式就已经足够用于加入全局设置了,但是仍然会有部分情况,我们需要初始化 counters 或 states。如果将这些代码放在 #show: slides 之前,就会创建一个空白页,这是我们不想看见的,因此这时候我们就可以使用 s.methods.append-preamble 方法。例如在使用 codly 包的时候:

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

      #let s = themes.simple.register(aspect-ratio: "16-9")
      #let s = (s.methods.append-preamble)(self: s)[
      #codly(languages: (
      rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
      ))
      ]
      #let (init, slides) = utils.methods(s)
      #show heading.where(level: 2): set block(below: 1em)
      #show: init
      #show: codly-init.with()

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      #slide[
      == First slide

      #raw(lang: "rust", block: true,
      `pub fn main() {
      println!("Hello, world!");
      }`.text)
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/codly:0.2.0": *

      #let s = themes.simple.register(aspect-ratio: "16-9")
      #let s = (s.methods.append-preamble)(self: s)[
      #codly(languages: (
      rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
      ))
      ]
      #let (init, slides) = utils.methods(s)
      #show heading.where(level: 2): set block(below: 1em)
      #show: init
      #show: codly-init.with()

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      #slide[
      == First slide

      #raw(lang: "rust", block: true,
      `pub fn main() {
      println!("Hello, world!");
      }`.text)
      ]

      image

      又或者是进行 Pdfpc 的配置的时候:

      // Pdfpc configuration
      // typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
      #let s = (s.methods.append-preamble)(self: s, pdfpc.config(
      duration-minutes: 30,
      start-time: datetime(hour: 14, minute: 10, second: 0),
      end-time: datetime(hour: 14, minute: 40, second: 0),
      last-minutes: 5,
      note-font-size: 12,
      disable-markdown: false,
      default-transition: (
      type: "push",
      duration-seconds: 2,
      angle: ltr,
      alignment: "vertical",
      direction: "inward",
      ),
      ))
      diff --git a/zh/docs/next/integration/cetz/index.html b/zh/docs/next/integration/cetz/index.html index 809a64165..ece83a760 100644 --- a/zh/docs/next/integration/cetz/index.html +++ b/zh/docs/next/integration/cetz/index.html @@ -5,7 +5,7 @@ CeTZ | Touying - + @@ -13,7 +13,7 @@

      Touying 提供了 touying-reducer,它能为 cetz 与 fletcher 加入 pausemeanwhile 动画。

      简单动画

      一个例子:

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]

      image

      only 与 uncover

      事实上,我们也可以在 cetz 内部使用 onlyuncover,只是需要一点技巧:

      diff --git a/zh/docs/next/integration/codly/index.html b/zh/docs/next/integration/codly/index.html index 31c94a1aa..95c8a1ec3 100644 --- a/zh/docs/next/integration/codly/index.html +++ b/zh/docs/next/integration/codly/index.html @@ -5,13 +5,13 @@ Codly | Touying - +
      版本:Next

      Codly

      在使用 codly 的时候,我们应该使用 s.methods.append-preamble 方法进行初始化。

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

      #let s = themes.simple.register(aspect-ratio: "16-9")
      #let s = (s.methods.append-preamble)(self: s)[
      #codly(languages: (
      rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
      ))
      ]
      #let (init, slides) = utils.methods(s)
      #show heading.where(level: 2): set block(below: 1em)
      #show: init
      #show: codly-init.with()

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      #slide[
      == First slide

      #raw(lang: "rust", block: true,
      `pub fn main() {
      println!("Hello, world!");
      }`.text)
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/codly:0.2.0": *

      #let s = themes.simple.register(aspect-ratio: "16-9")
      #let s = (s.methods.append-preamble)(self: s)[
      #codly(languages: (
      rust: (name: "Rust", icon: "\u{fa53}", color: rgb("#CE412B")),
      ))
      ]
      #let (init, slides) = utils.methods(s)
      #show heading.where(level: 2): set block(below: 1em)
      #show: init
      #show: codly-init.with()

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      #slide[
      == First slide

      #raw(lang: "rust", block: true,
      `pub fn main() {
      println!("Hello, world!");
      }`.text)
      ]

      image

      \ No newline at end of file diff --git a/zh/docs/next/integration/ctheorems/index.html b/zh/docs/next/integration/ctheorems/index.html index f4b5e3a95..859bac066 100644 --- a/zh/docs/next/integration/ctheorems/index.html +++ b/zh/docs/next/integration/ctheorems/index.html @@ -5,14 +5,14 @@ Ctheorems | Touying - +
      版本:Next

      Ctheorems

      Touying 能够与 ctheorems 包一起正常工作,你可以直接使用 ctheorems 包。

      其中,你还可以使用 #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") 为 sections 和 subsections 设置 numbering。

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/ctheorems:1.1.2": *

      // Register university theme
      #let s = themes.simple.register(aspect-ratio: "16-9")

      // Set the numbering of section and subsection
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

      // Theroems configuration by ctheorems
      #show: thmrules.with(qed-symbol: $square$)
      #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
      #let corollary = thmplain(
      "corollary",
      "Corollary",
      base: "theorem",
      titlefmt: strong
      )
      #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
      #let example = thmplain("example", "Example").with(numbering: none)
      #let proof = thmproof("proof", "Proof")

      // Extract methods
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      // Extract slide functions
      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Theroems

      == Prime numbers

      #definition[
      A natural number is called a #highlight[_prime number_] if it is greater
      than 1 and cannot be written as the product of two smaller natural numbers.
      ]
      #example[
      The numbers $2$, $3$, and $17$ are prime.
      @cor_largest_prime shows that this list is not exhaustive!
      ]

      #theorem("Euclid")[
      There are infinitely many primes.
      ]
      #proof[
      Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
      of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
      it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
      $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
      contradiction.
      ]

      #corollary[
      There is no largest prime number.
      ] <cor_largest_prime>
      #corollary[
      There are infinitely many composite numbers.
      ]

      #theorem[
      There are arbitrarily long stretches of composite numbers.
      ]

      #proof[
      For any $n > 2$, consider $
      n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
      $
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/ctheorems:1.1.2": *

      // Register university theme
      #let s = themes.simple.register(aspect-ratio: "16-9")

      // Set the numbering of section and subsection
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

      // Theroems configuration by ctheorems
      #show: thmrules.with(qed-symbol: $square$)
      #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
      #let corollary = thmplain(
      "corollary",
      "Corollary",
      base: "theorem",
      titlefmt: strong
      )
      #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
      #let example = thmplain("example", "Example").with(numbering: none)
      #let proof = thmproof("proof", "Proof")

      // Extract methods
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      // Extract slide functions
      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Theroems

      == Prime numbers

      #definition[
      A natural number is called a #highlight[_prime number_] if it is greater
      than 1 and cannot be written as the product of two smaller natural numbers.
      ]
      #example[
      The numbers $2$, $3$, and $17$ are prime.
      @cor_largest_prime shows that this list is not exhaustive!
      ]

      #theorem("Euclid")[
      There are infinitely many primes.
      ]
      #proof[
      Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
      of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
      it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
      $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
      contradiction.
      ]

      #corollary[
      There is no largest prime number.
      ] <cor_largest_prime>
      #corollary[
      There are infinitely many composite numbers.
      ]

      #theorem[
      There are arbitrarily long stretches of composite numbers.
      ]

      #proof[
      For any $n > 2$, consider $
      n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
      $
      ]

      image

      \ No newline at end of file diff --git a/zh/docs/next/integration/fletcher/index.html b/zh/docs/next/integration/fletcher/index.html index 801d441ed..07d2da1ea 100644 --- a/zh/docs/next/integration/fletcher/index.html +++ b/zh/docs/next/integration/fletcher/index.html @@ -5,14 +5,14 @@ Fletcher | Touying - +
      版本:Next

      Fletcher

      Touying 提供了 touying-reducer,它能为 fletcher 加入 pausemeanwhile 动画。

      一个例子:

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(title-slide: false, outline-slide: false)

      // cetz animation
      #slide[
      Cetz in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })
      ]

      // fletcher animation
      #slide[
      Fletcher in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )
      ]

      image

      \ No newline at end of file diff --git a/zh/docs/next/integration/mitex/index.html b/zh/docs/next/integration/mitex/index.html index c1f86ba44..7e5b46f1f 100644 --- a/zh/docs/next/integration/mitex/index.html +++ b/zh/docs/next/integration/mitex/index.html @@ -5,7 +5,7 @@ MiTeX | Touying - + diff --git a/zh/docs/next/integration/pinit/index.html b/zh/docs/next/integration/pinit/index.html index 95307c4b8..50502825c 100644 --- a/zh/docs/next/integration/pinit/index.html +++ b/zh/docs/next/integration/pinit/index.html @@ -5,7 +5,7 @@ Pinit | Touying - + @@ -19,7 +19,7 @@

      简单示例复杂示例

      image

      一个与 Touying 共同使用的示例:

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/pinit:0.1.3": *

      #(s.page-args.paper = "presentation-4-3")
      #let (init, slides) = utils.methods(s)
      #show: init

      #set text(size: 20pt, font: "Calibri", ligatures: false)
      #show heading: set text(weight: "regular")
      #show heading: set block(above: 1.4em, below: 1em)
      #show heading.where(level: 1): set text(size: 1.5em)

      // Useful functions
      #let crimson = rgb("#c00000")
      #let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)
      #let redbold(body) = {
      set text(fill: crimson, weight: "bold")
      body
      }
      #let blueit(body) = {
      set text(fill: blue)
      body
      }

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      // Main body
      #slide(self => [
      #let (uncover, only) = utils.methods(self)

      = Asymptotic Notation: $O$

      Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.
      (Ignore constant coefficients and lower-order terms.)

      #pause

      #greybox[
      Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:
      #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)
      ]

      #pinit-highlight("h1", "h2")

      #pause

      $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)

      // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))

      #pause

      $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.

      #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))

      #pause

      #block[Insertion Sort as an #pin("r1")example#pin("r2"):]

      - Best Case: $T(n) approx c n + c' n - c''$ #pin(3)
      - Worst case: $T(n) approx c n + (c' \/ 2) n^2 - c''$ #pin(4)

      #pinit-rect("r1", "r2")

      #pause

      #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]
      #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]

      #pause

      #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]

      #pause

      #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))
      #only("8-", pinit-point-from("ans", body-dx: -150pt)[
      Show that the equation $(3/2)^n >= c$ \
      has infinitely many solutions for $n$.
      ])
      ])
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/pinit:0.1.3": *

      #(s.page-args.paper = "presentation-4-3")
      #let (init, slides) = utils.methods(s)
      #show: init

      #set text(size: 20pt, font: "Calibri", ligatures: false)
      #show heading: set text(weight: "regular")
      #show heading: set block(above: 1.4em, below: 1em)
      #show heading.where(level: 1): set text(size: 1.5em)

      // Useful functions
      #let crimson = rgb("#c00000")
      #let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)
      #let redbold(body) = {
      set text(fill: crimson, weight: "bold")
      body
      }
      #let blueit(body) = {
      set text(fill: blue)
      body
      }

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      // Main body
      #slide(self => [
      #let (uncover, only) = utils.methods(self)

      = Asymptotic Notation: $O$

      Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.
      (Ignore constant coefficients and lower-order terms.)

      #pause

      #greybox[
      Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:
      #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)
      ]

      #pinit-highlight("h1", "h2")

      #pause

      $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)

      // #absolute-place(dx: 550pt, dy: 320pt, image(width: 25%, "asymptotic.png"))

      #pause

      $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.

      #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))

      #pause

      #block[Insertion Sort as an #pin("r1")example#pin("r2"):]

      - Best Case: $T(n) approx c n + c' n - c''$ #pin(3)
      - Worst case: $T(n) approx c n + (c' \/ 2) n^2 - c''$ #pin(4)

      #pinit-rect("r1", "r2")

      #pause

      #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]
      #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]

      #pause

      #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]

      #pause

      #only("8-", pinit-point-to("que", fill: crimson, redbold[No.]))
      #only("8-", pinit-point-from("ans", body-dx: -150pt)[
      Show that the equation $(3/2)^n >= c$ \
      has infinitely many solutions for $n$.
      ])
      ])

      image

      \ No newline at end of file diff --git a/zh/docs/next/intro/index.html b/zh/docs/next/intro/index.html index b5d5c2c8a..949635730 100644 --- a/zh/docs/next/intro/index.html +++ b/zh/docs/next/intro/index.html @@ -5,7 +5,7 @@ Touying 介绍 | Touying - + diff --git a/zh/docs/next/layout/index.html b/zh/docs/next/layout/index.html index cd04667a5..7673455a7 100644 --- a/zh/docs/next/layout/index.html +++ b/zh/docs/next/layout/index.html @@ -5,7 +5,7 @@ 页面布局 | Touying - + @@ -41,7 +41,7 @@

      页面管理

      为 slides 添加一个 Logo 是及其普遍,但是又及其多变的一个需求。其中的难点在于,所需要的 Logo 大小和位置往往因人而异。因此,Touying 的主题大部分都不包含 Logo 的配置选项。但借助本章节提到的页面布局的概念,我们知道可以在 header 或 footer 中使用 place 函数来放置 Logo 图片。

      例如,我们决定给 metropolis 主题加入 GitHub 的图标,我们可以这样实现:

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/octique:0.1.0": *

      #let s = themes.metropolis.register(aspect-ratio: "16-9")
      #(s.page-args.header = self => {
      // display the original header
      utils.call-or-display(self, s.page-args.header)
      // place logo to top-right
      place(top + right, dx: -0.5em, dy: 0.3em)[
      #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)
      ]
      })
      #let (init, slide) = utils.methods(s)
      #show: init

      #slide(title: [Title])[
      Logo example.
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/octique:0.1.0": *

      #let s = themes.metropolis.register(aspect-ratio: "16-9")
      #(s.page-args.header = self => {
      // display the original header
      utils.call-or-display(self, s.page-args.header)
      // place logo to top-right
      place(top + right, dx: -0.5em, dy: 0.3em)[
      #octique("mark-github", color: rgb("#fafafa"), width: 1.5em, height: 1.5em)
      ]
      })
      #let (init, slide) = utils.methods(s)
      #show: init

      #slide(title: [Title])[
      Logo example.
      ]

      image

      其中 utils.call-or-display(self, body) 可以用于显示 body 为 content 或 body 为形如 self => content 形式的回调函数。

      页面分栏

      diff --git a/zh/docs/next/multi-file/index.html b/zh/docs/next/multi-file/index.html index b601fb8e1..6386ef0b4 100644 --- a/zh/docs/next/multi-file/index.html +++ b/zh/docs/next/multi-file/index.html @@ -5,7 +5,7 @@ 多文件架构 | Touying - + @@ -16,7 +16,7 @@

      配置

      一个最简单的 Touying 多文件架构包括三个文件:全局配置文件 globals.typ、主入口文件 main.typ 和存放内容的 content.typ 文件。

      分成三个文件是由于要让 main.typcontent.typ 均可以引入 globals.typ,从而避免循环引用。

      globals.typ 可以用于存放一些全局的自定义函数,以及对 Touying 主题进行初始化:

      -
      // globals.typ
      #import "@preview/touying:0.4.0": *

      #let s = themes.university.register(aspect-ratio: "16-9")
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)

      // as well as some utility functions
      +
      // globals.typ
      #import "@preview/touying:0.4.1": *

      #let s = themes.university.register(aspect-ratio: "16-9")
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)

      // as well as some utility functions

      main.typ 作为项目的主入口,通过导入 globals.typ 应用 show rules,以及通过 #include 置入 content.typ

      // main.typ
      #import "/globals.typ": *

      #show: init
      #show strong: alert
      #show: slides

      #include "content.typ"

      content.typ 便是用于书写具体内容的文件了。

      diff --git a/zh/docs/next/progress/counters/index.html b/zh/docs/next/progress/counters/index.html index adea29653..ef0bfbb4a 100644 --- a/zh/docs/next/progress/counters/index.html +++ b/zh/docs/next/progress/counters/index.html @@ -5,7 +5,7 @@ Touying 的计数器 | Touying - + diff --git a/zh/docs/next/progress/sections/index.html b/zh/docs/next/progress/sections/index.html index 20cf8e8aa..258288d3f 100644 --- a/zh/docs/next/progress/sections/index.html +++ b/zh/docs/next/progress/sections/index.html @@ -5,7 +5,7 @@ Touying 的 Sections | Touying - + diff --git a/zh/docs/next/sections/index.html b/zh/docs/next/sections/index.html index 1f6ecd5eb..6ca271915 100644 --- a/zh/docs/next/sections/index.html +++ b/zh/docs/next/sections/index.html @@ -5,7 +5,7 @@ 节与小节 | Touying - + @@ -13,10 +13,10 @@

      结构

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

      一般而言,1 级、2 级和 3 级标题分别用来对应 section、subsection 和 title,例如 dewdrop 主题。

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

      #let s = themes.dewdrop.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Section

      == Subsection

      === Title

      Hello, Touying!
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.dewdrop.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Section

      == Subsection

      === Title

      Hello, Touying!

      image

      但是很多时候我们并不需要 subsection,因此也会使用 1 级和 2 级标题来分别对应 section 和 title,例如 university 主题。

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

      #let s = themes.university.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Section

      == Title

      Hello, Touying!
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.university.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Section

      == Title

      Hello, Touying!

      image

      实际上,我们可以通过 slides 函数的 slide-level 参数来控制这里的行为。slide-level 代表着嵌套结构的复杂度,从 0 开始计算。例如 #show: slides.with(slide-level: 2) 等价于 sectionsubsectiontitle 结构;而 #show: slides.with(slide-level: 1) 等价于 sectiontitle 结构。

      编号

      @@ -25,7 +25,7 @@

      编号目录

      在 Touying 中显示目录很简单:

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

      #let s = themes.simple.register()
      #let (init, slides, alert, touying-outline) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(slide-level: 2)

      = Section

      == Subsection

      === Title

      ==== Table of contents

      #touying-outline()
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.simple.register()
      #let (init, slides, alert, touying-outline) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides.with(slide-level: 2)

      = Section

      == Subsection

      === Title

      ==== Table of contents

      #touying-outline()

      image

      其中 touying-oultine() 的定义为:

      #let touying-outline(enum-args: (:), padding: 0pt) = { .. }
      diff --git a/zh/docs/next/start/index.html b/zh/docs/next/start/index.html index b2627c58d..212130e5b 100644 --- a/zh/docs/next/start/index.html +++ b/zh/docs/next/start/index.html @@ -5,21 +5,21 @@ 开始 | Touying - +
      版本:Next

      开始

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

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

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

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.simple.register()
      #let (init, slides) = utils.methods(s)
      #show: init

      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Title

      == First Slide

      Hello, Touying!

      #pause

      Hello, Typst!

      image

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

      提示: 你可以使用 #import "config.typ": *#include "content.typ" 等 Typst 语法来实现 Touying 的多文件架构。

      警告: #let (slide, empty-slide) = utils.slides(s) 里的逗号对于解包语法来说是必要的!

      更复杂的例子

      事实上,Touying 提供了多种 slides 编写风格,实际上您也可以使用 #slide[..] 的写法,以获得 Touying 提供的更多更强大的功能。

      -
      #import "@preview/touying:0.4.0": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge
      #import "@preview/ctheorems:1.1.2": *

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      // Register university theme
      // You can replace it with other themes and it can still work normally
      #let s = themes.university.register(aspect-ratio: "16-9")

      // Set the numbering of section and subsection
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

      // Global information configuration
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )

      // Pdfpc configuration
      // typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
      #let s = (s.methods.append-preamble)(self: s, pdfpc.config(
      duration-minutes: 30,
      start-time: datetime(hour: 14, minute: 10, second: 0),
      end-time: datetime(hour: 14, minute: 40, second: 0),
      last-minutes: 5,
      note-font-size: 12,
      disable-markdown: false,
      default-transition: (
      type: "push",
      duration-seconds: 2,
      angle: ltr,
      alignment: "vertical",
      direction: "inward",
      ),
      ))

      // Theroems configuration by ctheorems
      #show: thmrules.with(qed-symbol: $square$)
      #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
      #let corollary = thmplain(
      "corollary",
      "Corollary",
      base: "theorem",
      titlefmt: strong
      )
      #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
      #let example = thmplain("example", "Example").with(numbering: none)
      #let proof = thmproof("proof", "Proof")

      // Extract methods
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      // Extract slide functions
      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Animation

      == Simple Animation

      We can use `#pause` to #pause display something later.

      #pause

      Just like this.

      #meanwhile

      Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.


      == Complex Animation

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

      At subslide #self.subslide, we can

      use #uncover("2-")[`#uncover` function] for reserving space,

      use #only("2-")[`#only` function] for not reserving space,

      #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
      ])


      == Math Equation Animation

      Touying equation with `pause`:

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

      #meanwhile

      Here, #pause we have the expression of $f(x)$.

      #pause

      By factorizing, we can obtain this result.


      == CeTZ Animation

      CeTZ Animation in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })


      == Fletcher Animation

      Fletcher Animation in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )


      = Theroems

      == Prime numbers

      #definition[
      A natural number is called a #highlight[_prime number_] if it is greater
      than 1 and cannot be written as the product of two smaller natural numbers.
      ]
      #example[
      The numbers $2$, $3$, and $17$ are prime.
      @cor_largest_prime shows that this list is not exhaustive!
      ]

      #theorem("Euclid")[
      There are infinitely many primes.
      ]
      #proof[
      Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
      of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
      it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
      $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
      contradiction.
      ]

      #corollary[
      There is no largest prime number.
      ] <cor_largest_prime>
      #corollary[
      There are infinitely many composite numbers.
      ]

      #theorem[
      There are arbitrarily long stretches of composite numbers.
      ]

      #proof[
      For any $n > 2$, consider $
      n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
      $
      ]


      = Others

      == Side-by-side

      #slide(composer: (1fr, 1fr))[
      First column.
      ][
      Second column.
      ]


      == Multiple Pages

      #lorem(200)


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

      == Appendix

      #slide[
      Please pay attention to the current slide number.
      ]
      +
      #import "@preview/touying:0.4.1": *
      #import "@preview/cetz:0.2.2"
      #import "@preview/fletcher:0.4.4" as fletcher: node, edge
      #import "@preview/ctheorems:1.1.2": *

      // cetz and fletcher bindings for touying
      #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))
      #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)

      // Register university theme
      // You can replace it with other themes and it can still work normally
      #let s = themes.university.register(aspect-ratio: "16-9")

      // Set the numbering of section and subsection
      #let s = (s.methods.numbering)(self: s, section: "1.", "1.1")

      // Global information configuration
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )

      // Pdfpc configuration
      // typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
      #let s = (s.methods.append-preamble)(self: s, pdfpc.config(
      duration-minutes: 30,
      start-time: datetime(hour: 14, minute: 10, second: 0),
      end-time: datetime(hour: 14, minute: 40, second: 0),
      last-minutes: 5,
      note-font-size: 12,
      disable-markdown: false,
      default-transition: (
      type: "push",
      duration-seconds: 2,
      angle: ltr,
      alignment: "vertical",
      direction: "inward",
      ),
      ))

      // Theroems configuration by ctheorems
      #show: thmrules.with(qed-symbol: $square$)
      #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
      #let corollary = thmplain(
      "corollary",
      "Corollary",
      base: "theorem",
      titlefmt: strong
      )
      #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
      #let example = thmplain("example", "Example").with(numbering: none)
      #let proof = thmproof("proof", "Proof")

      // Extract methods
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      // Extract slide functions
      #let (slide, empty-slide) = utils.slides(s)
      #show: slides

      = Animation

      == Simple Animation

      We can use `#pause` to #pause display something later.

      #pause

      Just like this.

      #meanwhile

      Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.


      == Complex Animation

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

      At subslide #self.subslide, we can

      use #uncover("2-")[`#uncover` function] for reserving space,

      use #only("2-")[`#only` function] for not reserving space,

      #alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
      ])


      == Math Equation Animation

      Touying equation with `pause`:

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

      #meanwhile

      Here, #pause we have the expression of $f(x)$.

      #pause

      By factorizing, we can obtain this result.


      == CeTZ Animation

      CeTZ Animation in Touying:

      #cetz-canvas({
      import cetz.draw: *

      rect((0,0), (5,5))

      (pause,)

      rect((0,0), (1,1))
      rect((1,1), (2,2))
      rect((2,2), (3,3))

      (pause,)

      line((0,0), (2.5, 2.5), name: "line")
      })


      == Fletcher Animation

      Fletcher Animation in Touying:

      #fletcher-diagram(
      node-stroke: .1em,
      node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%),
      spacing: 4em,
      edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
      node((0,0), `reading`, radius: 2em),
      edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
      pause,
      edge(`read()`, "-|>"),
      node((1,0), `eof`, radius: 2em),
      pause,
      edge(`close()`, "-|>"),
      node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
      edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
      )


      = Theroems

      == Prime numbers

      #definition[
      A natural number is called a #highlight[_prime number_] if it is greater
      than 1 and cannot be written as the product of two smaller natural numbers.
      ]
      #example[
      The numbers $2$, $3$, and $17$ are prime.
      @cor_largest_prime shows that this list is not exhaustive!
      ]

      #theorem("Euclid")[
      There are infinitely many primes.
      ]
      #proof[
      Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
      of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
      it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
      $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
      contradiction.
      ]

      #corollary[
      There is no largest prime number.
      ] <cor_largest_prime>
      #corollary[
      There are infinitely many composite numbers.
      ]

      #theorem[
      There are arbitrarily long stretches of composite numbers.
      ]

      #proof[
      For any $n > 2$, consider $
      n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
      $
      ]


      = Others

      == Side-by-side

      #slide(composer: (1fr, 1fr))[
      First column.
      ][
      Second column.
      ]


      == Multiple Pages

      #lorem(200)


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

      == Appendix

      #slide[
      Please pay attention to the current slide number.
      ]

      image

      Touying 提供了很多内置的主题,能够简单地编写精美的 slides,例如此处的

      #let s = themes.university.register(aspect-ratio: "16-9")
      diff --git a/zh/docs/next/themes/aqua/index.html b/zh/docs/next/themes/aqua/index.html index 5aad46f1d..33be616e9 100644 --- a/zh/docs/next/themes/aqua/index.html +++ b/zh/docs/next/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua 主题 | Touying - + @@ -14,7 +14,7 @@

      这个主题由 @pride7 制作,它的美丽背景为使用 Typst 的可视化功能制作的矢量图形。

      初始化

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

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

      #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
      #show: slides
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
      #let s = (s.methods.info)(
      self: s,
      title: [Title],
      subtitle: [Subtitle],
      author: [Authors],
      date: datetime.today(),
      institution: [Institution],
      )
      #let (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
      #show: slides

      其中 register 接收参数:

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

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

        PS: 其中 outline title 可以通过 #(s.outline-title = [Outline]) 的方式修改。

        以及可以通过 #(s.methods.touying-new-section-slide = none) 的方式关闭自动加入 new-section-slide 的功能。

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

        #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
        #let s = (s.methods.info)(
        self: s,
        title: [Title],
        subtitle: [Subtitle],
        author: [Authors],
        date: datetime.today(),
        institution: [Institution],
        )
        #let (init, slides, touying-outline, alert) = utils.methods(s)
        #show: init

        #show strong: alert

        #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!
        +
        #import "@preview/touying:0.4.1": *

        #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
        #let s = (s.methods.info)(
        self: s,
        title: [Title],
        subtitle: [Subtitle],
        author: [Authors],
        date: datetime.today(),
        institution: [Institution],
        )
        #let (init, slides, touying-outline, alert) = utils.methods(s)
        #show: init

        #show strong: alert

        #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!

        image

        示例

        #import "../lib.typ": *

        #let s = themes.aqua.register(aspect-ratio: "16-9", lang: "en")
        #let s = (s.methods.info)(
        self: s,
        title: [Title],
        subtitle: [Subtitle],
        author: [Authors],
        date: datetime.today(),
        institution: [Institution],
        )
        #let (init, slides, touying-outline, alert) = utils.methods(s)
        #show: init

        #show strong: alert

        #let (slide, empty-slide, title-slide, outline-slide, focus-slide) = utils.slides(s)
        #show: slides

        = The Section

        == Slide Title

        #slide[
        #lorem(40)
        ]

        #focus-slide[
        Another variant with primary color in background...
        ]

        == Summary

        #align(center + horizon)[
        #set text(size: 3em, weight: "bold", s.colors.primary)
        THANKS FOR ALL
        ]

      diff --git a/zh/docs/next/themes/dewdrop/index.html b/zh/docs/next/themes/dewdrop/index.html index 9e7de6405..cc96e4315 100644 --- a/zh/docs/next/themes/dewdrop/index.html +++ b/zh/docs/next/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop 主题 | Touying - + @@ -15,7 +15,7 @@

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

      初始化

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

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

      #let s = themes.dewdrop.register(
      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 (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
      #show: slides
      +
      #import "@preview/touying:0.4.1": *

      #let s = themes.dewdrop.register(
      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 (init, slides, touying-outline, alert) = utils.methods(s)
      #show: init

      #show strong: alert

      #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
      #show: slides

      其中 register 接收参数:

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

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

        PS: 其中 outline title 可以通过 #(s.outline-title = [Outline]) 的方式修改。

        以及可以通过 #(s.methods.touying-new-section-slide = none) 的方式关闭自动加入 new-section-slide 的功能。

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

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!
        +
        #import "@preview/touying:0.4.1": *

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Title

        == First Slide

        Hello, Touying!

        #pause

        Hello, Typst!

        image

        示例

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

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Section A

        == Subsection A.1

        #slide[
        A slide with equation:

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

        == Subsection A.2

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

        = Section B

        == Subsection B.1

        #slide[
        #lorem(80)
        ]

        #focus-slide[
        Wake up!
        ]

        == Subsection B.2

        #slide[
        We can use `#pause` to #pause display something later.

        #pause

        Just like this.

        #meanwhile

        Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.
        ]

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

        = Appendix

        === Appendix

        #slide[
        Please pay attention to the current slide number.
        ]
        +
        #import "@preview/touying:0.4.1": *

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides

        = Section A

        == Subsection A.1

        #slide[
        A slide with equation:

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

        == Subsection A.2

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

        = Section B

        == Subsection B.1

        #slide[
        #lorem(80)
        ]

        #focus-slide[
        Wake up!
        ]

        == Subsection B.2

        #slide[
        We can use `#pause` to #pause display something later.

        #pause

        Just like this.

        #meanwhile

        Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.
        ]

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

        = Appendix

        === Appendix

        #slide[
        Please pay attention to the current slide number.
        ]
        \ No newline at end of file diff --git a/zh/docs/next/themes/metropolis/index.html b/zh/docs/next/themes/metropolis/index.html index 40b1d5c23..afec6185b 100644 --- a/zh/docs/next/themes/metropolis/index.html +++ b/zh/docs/next/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis 主题 | Touying - + @@ -15,7 +15,7 @@

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

        初始化

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

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

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides
        +
        #import "@preview/touying:0.4.1": *

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

        #show strong: alert

        #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
        #show: slides

        其中 register 接收参数:

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

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

          PS: 其中 outline title 可以通过 #(s.outline-title = [Outline]) 的方式修改。

          以及可以通过 #(s.methods.touying-new-section-slide = none) 的方式关闭自动加入 new-section-slide 的功能。

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

          #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
          #let s = (s.methods.info)(
          self: s,
          title: [Title],
          subtitle: [Subtitle],
          author: [Authors],
          date: datetime.today(),
          institution: [Institution],
          )
          #let 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!
          +
          #import "@preview/touying:0.4.1": *

          #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
          #let s = (s.methods.info)(
          self: s,
          title: [Title],
          subtitle: [Subtitle],
          author: [Authors],
          date: datetime.today(),
          institution: [Institution],
          )
          #let 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.4.0": *

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

          #set text(font: "Fira Sans", weight: "light", size: 20pt)
          #show math.equation: set text(font: "Fira Math")
          #set strong(delta: 100)
          #set par(justify: true)
          #show strong: alert

          #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
          #show: slides

          = First Section

          #slide[
          A slide without a title but with some *important* information.
          ]

          == 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

          #slide[
          A slide with equation:

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

          #lorem(200)
          ]

          = Second Section

          #focus-slide[
          Wake up!
          ]

          == Simple Animation

          #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, empty-slide) = utils.slides(s)

          = Appendix

          #slide[
          Appendix.
          ]
          +
          #import "@preview/touying:0.4.1": *

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

          #set text(font: "Fira Sans", weight: "light", size: 20pt)
          #show math.equation: set text(font: "Fira Math")
          #set strong(delta: 100)
          #set par(justify: true)
          #show strong: alert

          #let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
          #show: slides

          = First Section

          #slide[
          A slide without a title but with some *important* information.
          ]

          == 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

          #slide[
          A slide with equation:

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

          #lorem(200)
          ]

          = Second Section

          #focus-slide[
          Wake up!
          ]

          == Simple Animation

          #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, empty-slide) = utils.slides(s)

          = Appendix

          #slide[
          Appendix.
          ]
          \ No newline at end of file diff --git a/zh/docs/next/themes/simple/index.html b/zh/docs/next/themes/simple/index.html index 7fbc584ca..901d09c8e 100644 --- a/zh/docs/next/themes/simple/index.html +++ b/zh/docs/next/themes/simple/index.html @@ -5,7 +5,7 @@ Simple 主题 | Touying - + @@ -15,7 +15,7 @@

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

          初始化

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

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

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

          #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
          #show: slides
          +
          #import "@preview/touying:0.4.1": *

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

          #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
          #show: slides

          其中 register 接收参数:

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

            slides

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

            以及可以通过 #(s.methods.touying-new-section-slide = none) 的方式关闭自动加入 new-section-slide 的功能。

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

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

            #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
            #show: slides

            = Title

            == First Slide

            Hello, Touying!

            #pause

            Hello, Typst!
            +
            #import "@preview/touying:0.4.1": *

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

            #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
            #show: slides

            = Title

            == First Slide

            Hello, Touying!

            #pause

            Hello, Typst!

            image

            示例

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

            #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
            #let (init, slides) = utils.methods(s)
            #show: init

            #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
            #show: slides

            #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
            ]

            == First slide

            #slide[
            #lorem(20)
            ]

            #focus-slide[
            _Focus!_

            This is very important.
            ]

            = Let's start a new section!

            == Dynamic slide

            #slide[
            Did you know that...

            #pause

            ...you can see the current section at the top of the slide?
            ]
            +
            #import "@preview/touying:0.4.1": *

            #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
            #let (init, slides) = utils.methods(s)
            #show: init

            #let (slide, empty-slide, title-slide, centered-slide, focus-slide) = utils.slides(s)
            #show: slides

            #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
            ]

            == First slide

            #slide[
            #lorem(20)
            ]

            #focus-slide[
            _Focus!_

            This is very important.
            ]

            = Let's start a new section!

            == Dynamic slide

            #slide[
            Did you know that...

            #pause

            ...you can see the current section at the top of the slide?
            ]
            \ No newline at end of file diff --git a/zh/docs/next/themes/university/index.html b/zh/docs/next/themes/university/index.html index 3f984208d..adb0b08d4 100644 --- a/zh/docs/next/themes/university/index.html +++ b/zh/docs/next/themes/university/index.html @@ -5,7 +5,7 @@ University 主题 | Touying - + @@ -14,7 +14,7 @@

            这个美观的主题来自 Pol Dellaiera

            初始化

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

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

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

            #show strong: alert

            #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
            #show: slides
            +
            #import "@preview/touying:0.4.1": *

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

            #show strong: alert

            #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
            #show: slides

            其中 register 接收参数:

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

              slides

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

              以及可以通过 #(s.methods.touying-new-section-slide = none) 的方式关闭自动加入 new-section-slide 的功能。

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

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

              #show strong: alert

              #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
              #show: slides

              = Title

              == First Slide

              Hello, Touying!

              #pause

              Hello, Typst!
              +
              #import "@preview/touying:0.4.1": *

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

              #show strong: alert

              #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
              #show: slides

              = Title

              == First Slide

              Hello, Touying!

              #pause

              Hello, Typst!

              image

              示例

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

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

              #show strong: alert

              #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
              #show: slides.with(title-slide: false)

              #title-slide(authors: ([Author A], [Author B]))

              = The Section

              == Slide Title

              #slide[
              #lorem(40)
              ]

              #slide(subtitle: emph[What is the problem?])[
              #lorem(40)
              ]

              #focus-slide[
              Another variant with primary color in background...
              ]

              #matrix-slide[
              left
              ][
              middle
              ][
              right
              ]

              #matrix-slide(columns: 1)[
              top
              ][
              bottom
              ]

              #matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)
              +
              #import "@preview/touying:0.4.1": *

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

              #show strong: alert

              #let (slide, empty-slide, title-slide, focus-slide, matrix-slide) = utils.slides(s)
              #show: slides.with(title-slide: false)

              #title-slide(authors: ([Author A], [Author B]))

              = The Section

              == Slide Title

              #slide[
              #lorem(40)
              ]

              #slide(subtitle: emph[What is the problem?])[
              #lorem(40)
              ]

              #focus-slide[
              Another variant with primary color in background...
              ]

              #matrix-slide[
              left
              ][
              middle
              ][
              right
              ]

              #matrix-slide(columns: 1)[
              top
              ][
              bottom
              ]

              #matrix-slide(columns: (1fr, 2fr, 1fr), ..(lorem(8),) * 9)
              \ No newline at end of file diff --git a/zh/docs/next/utilities/fit-to/index.html b/zh/docs/next/utilities/fit-to/index.html index d6b1d9a2f..7668b1c22 100644 --- a/zh/docs/next/utilities/fit-to/index.html +++ b/zh/docs/next/utilities/fit-to/index.html @@ -5,7 +5,7 @@ Fit to height / width | Touying - + diff --git a/zh/docs/next/utilities/oop/index.html b/zh/docs/next/utilities/oop/index.html index 34f6d1e1b..a33431709 100644 --- a/zh/docs/next/utilities/oop/index.html +++ b/zh/docs/next/utilities/oop/index.html @@ -5,7 +5,7 @@ 面向对象编程 | Touying - + diff --git a/zh/docs/progress/counters/index.html b/zh/docs/progress/counters/index.html index 283d3e229..c2700100c 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 1b076b1dd..c0bfe2ec1 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/sections/index.html b/zh/docs/sections/index.html index e1f2de45e..14b5bae85 100644 --- a/zh/docs/sections/index.html +++ b/zh/docs/sections/index.html @@ -5,7 +5,7 @@ 节与小节 | Touying - + diff --git a/zh/docs/start/index.html b/zh/docs/start/index.html index a843e74ed..6f4367253 100644 --- a/zh/docs/start/index.html +++ b/zh/docs/start/index.html @@ -5,7 +5,7 @@ 开始 | Touying - + diff --git a/zh/docs/themes/aqua/index.html b/zh/docs/themes/aqua/index.html index c8f26c133..7d9bf4785 100644 --- a/zh/docs/themes/aqua/index.html +++ b/zh/docs/themes/aqua/index.html @@ -5,7 +5,7 @@ Aqua 主题 | Touying - + diff --git a/zh/docs/themes/dewdrop/index.html b/zh/docs/themes/dewdrop/index.html index be92bea71..85294f058 100644 --- a/zh/docs/themes/dewdrop/index.html +++ b/zh/docs/themes/dewdrop/index.html @@ -5,7 +5,7 @@ Dewdrop 主题 | Touying - + diff --git a/zh/docs/themes/metropolis/index.html b/zh/docs/themes/metropolis/index.html index ee7e40875..354cc7575 100644 --- a/zh/docs/themes/metropolis/index.html +++ b/zh/docs/themes/metropolis/index.html @@ -5,7 +5,7 @@ Metropolis 主题 | Touying - + diff --git a/zh/docs/themes/simple/index.html b/zh/docs/themes/simple/index.html index f3418e351..90f7b97be 100644 --- a/zh/docs/themes/simple/index.html +++ b/zh/docs/themes/simple/index.html @@ -5,7 +5,7 @@ Simple 主题 | Touying - + diff --git a/zh/docs/themes/university/index.html b/zh/docs/themes/university/index.html index baa7aa4e1..711b5a2eb 100644 --- a/zh/docs/themes/university/index.html +++ b/zh/docs/themes/university/index.html @@ -5,7 +5,7 @@ University 主题 | Touying - + diff --git a/zh/docs/utilities/fit-to/index.html b/zh/docs/utilities/fit-to/index.html index eddbcb114..53024d0a4 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 - + diff --git a/zh/docs/utilities/oop/index.html b/zh/docs/utilities/oop/index.html index f5aecfc33..238d07d1f 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 0a67bf2fe..d33840526 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 749d03f5e..ebb99e67a 100644 --- a/zh/markdown-page/index.html +++ b/zh/markdown-page/index.html @@ -5,7 +5,7 @@ Markdown page example | Touying - +