feat: initial commit

This commit is contained in:
johannes committed 2026-07-26 11:42:17 +02:00
commit b802ff49ab
454 files changed
+52429

No files matched your search

+151
View File
@@ -0,0 +1,151 @@
---
sidebar_position: 5
---
# Aqua Theme
![image](https://github.com/touying-typ/touying/assets/34951714/5f9b3c99-a22a-4f3d-a266-93dd75997593)
This theme is created by [@pride7](https://github.com/pride7), featuring beautiful backgrounds made with Typst's visualization capabilities.
## Initialization
You can initialize it with the following code:
```typst
#import "@preview/touying:0.6.1": *
#import themes.aqua: *
#show: aqua-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
),
)
#title-slide()
#outline-slide()
```
The `register` function in the Aqua theme accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
- `header`: The content displayed in the header of the slides, with a default of `utils.display-current-heading()`. You can also provide a function like `self => self.info.title` to customize the header content.
- `footer`: The content displayed on the right side of the footer, with a default of `context utils.slide-counter.display()`.
Additionally, the Aqua theme provides a `#alert[..]` function, which you can use with the `#show strong: alert` syntax to emphasize text within your slides.
## Color Theme
The Aqua theme uses the following color scheme by default:
```typst
config-colors(
primary: rgb("#003F88"),
primary-light: rgb("#2159A5"),
primary-lightest: rgb("#F2F4F8"),
neutral-lightest: rgb("#FFFFFF"),
)
```
You can modify this color scheme using the `config-colors()` function to suit your preferences or to match the branding of your presentation.
## Slide Function Family
Aqua theme offers a series of custom slide functions:
```typst
#title-slide(..args)
```
`title-slide` will read information from `self.info` for display.
---
```typst
#let outline-slide(self: none, enum-args: (:), leading: 50pt)
```
Display an outline slide.
---
```typst
#slide(
repeat: auto,
setting: body => body,
composer: components.side-by-side,
// Aqua theme
title: auto,
)[
...
]
```
A default ordinary slide function with title and footer, where `title` defaults to the current section title.
---
```typst
#focus-slide[
...
]
```
Used to draw the audience's attention. The background color is `self.colors.primary`.
---
```typst
#new-section-slide(title)
```
Start a new section with the given title.
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.aqua: *
#show: aqua-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
),
)
#title-slide()
#outline-slide()
= The Section
== Slide Title
#lorem(40)
#focus-slide[
Another variant with primary color in background...
]
== Summary
#slide(self => [
#align(center + horizon)[
#set text(size: 3em, weight: "bold", fill: self.colors.primary)
THANKS FOR ALL
]
])
```
+20
View File
@@ -0,0 +1,20 @@
---
sidebar_position: 7
---
# Custom Theme
You could consider making your own theme, you can refer to the "Build Your Own Theme" section later.
If you have any questions or need to customize a template, you can also contact orangex4@qq.com for free or inexpensive paid help. All forms are welcome.
## 🥤A cup of coffee
If you feel that this project has helped you in your work, you can donate to Touying's development work in the following ways to keep the project going.
Sponsor: https://afdian.com/a/orangex4
QR Code:
![image](https://github.com/user-attachments/assets/41adbf0b-663e-4693-8408-859cac3edaa1)
+177
View File
@@ -0,0 +1,177 @@
---
sidebar_position: 3
---
# Dewdrop Theme
![image](https://github.com/touying-typ/touying/assets/34951714/0b5b2bb2-c6ec-45c0-9cea-0af2ed896bba)
This theme takes inspiration from Zhibo Wang's [BeamerTheme](https://github.com/zbowang/BeamerTheme) and has been modified by [OrangeX4](https://github.com/OrangeX4).
The Dewdrop theme features an elegantly designed navigation, including two modes: `sidebar` and `mini-slides`.
## Initialization
You can initialize it using the following code:
```typst
#import "@preview/touying:0.6.1": *
#import themes.dewdrop: *
#import "@preview/numbly:0.1.0": numbly
#show: dewdrop-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
navigation: "mini-slides",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
),
)
#title-slide()
#outline-slide()
```
The `register` function in the Dewdrop theme accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
- `navigation`: The style of the navigation bar, which can be `"sidebar"`, `"mini-slides"`, or `none`, with a default of `"sidebar"`.
- `sidebar`: Settings for the sidebar navigation, with default values of `(width: 10em, filled: false, numbered: false, indent: .5em, short-heading: true)`.
- `mini-slides`: Settings for the mini-slides navigation, with default values of `(height: 4em, x: 2em, display-section: false, display-subsection: true, short-heading: true)`.
- `height`: The height of the mini-slides, with a default of `2em`.
- `x`: The x-axis padding for the mini-slides, with a default of `2em`.
- `section`: Whether to display slides after the section and before the subsection, with a default of `false`.
- `subsection`: Whether to separate mini-slides based on subsections, with a default of `true`. Setting this to `false` will squash them into a single line.
- `footer`: The content displayed in the footer of the slides, with a default of an empty array `[]`. You can customize it with a function, such as `self => self.info.author`.
- `footer-right`: The content displayed on the right side of the footer, with a default of `context utils.slide-counter.display() + " / " + utils.last-slide-number`.
- `primary`: The primary color of the theme, with a default of `rgb("#0c4842")`.
- `alpha`: The transparency level, with a default of `70%`.
Additionally, the Dewdrop theme provides a `#alert[..]` function, which you can use with the `#show strong: alert` syntax to create emphasized alert text.
## Color Theme
The Dewdrop theme uses the following color scheme by default:
```typc
config-colors(
neutral-darkest: rgb("#000000"),
neutral-dark: rgb("#202020"),
neutral-light: rgb("#f3f3f3"),
neutral-lightest: rgb("#ffffff"),
primary: primary,
)
```
You can modify this color scheme using the `config-colors()` function. This allows you to tailor the color palette of your slides to match the aesthetic you're aiming for or to conform to a specific branding guideline.
## Slide Function Family
The Dewdrop theme provides a variety of custom slide functions:
```typst
#title-slide(extra: none, ..args)
```
`title-slide` reads information from `self.info` for display, and you can also pass in an `extra` parameter to display additional information.
---
```typst
#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: components.side-by-side,
)[
...
]
```
A default slide with navigation and footer, where the footer is what you set.
---
```typst
#focus-slide[
...
]
```
Used to draw attention, with the background color set to `self.colors.primary`.
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.dewdrop: *
#import "@preview/numbly:0.1.0": numbly
#show: dewdrop-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
navigation: "mini-slides",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
#outline-slide()
= Section A
== Subsection A.1
$ x_(n+1) = (x_n + a/x_n) / 2 $
== Subsection A.2
A slide without a title but with *important* infos
= Section B
== Subsection B.1
#lorem(80)
#focus-slide[
Wake up!
]
== Subsection B.2
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.
#show: appendix
= Appendix
== Appendix
Please pay attention to the current slide number.
```
+189
View File
@@ -0,0 +1,189 @@
---
sidebar_position: 2
---
# Metropolis Theme
![image](https://github.com/touying-typ/touying/assets/34951714/383ceb22-f696-4450-83a6-c0f17e4597e1)
This theme draws inspiration from Matthias Vogelgesang's [Metropolis beamer](https://github.com/matze/mtheme) theme and has been modified by [Enivex](https://github.com/Enivex).
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:
```typst
#import "@preview/touying:0.6.1": *
#import themes.metropolis: *
#import "@preview/numbly:0.1.0": numbly
#show: metropolis-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.city,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
```
The `metropolis-theme` in the theme accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
- `align`: The alignment of the content within the slides, with a default of `horizon` (horizontal alignment).
- `header`: The content displayed in the header of the slides, with a default that displays the current heading adjusted to fit the width (`utils.display-current-heading(setting: utils.fit-to-width.with(grow: false, 100%))`). Alternatively, you can provide a function like `self => self.info.title` to customize the header content.
- `header-right`: The content displayed on the right side of the header, with a default that shows the logo specified in `self.info.logo`.
- `footer`: The content displayed in the footer of the slides, with a default of an empty array `[]`. You can customize it with a function, for example, to display the author's information: `self => self.info.author`.
- `footer-right`: The content displayed on the right side of the footer, with a default that shows the slide number and the total number of slides (`context utils.slide-counter.display() + " / " + utils.last-slide-number`).
- `footer-progress`: A boolean value indicating whether to display a progress bar at the bottom of the slides, with a default of `true`.
## Color Theme
Metropolis uses the following default color theme:
```typc
config-colors(
primary: rgb("#eb811b"),
primary-light: rgb("#d6c6b7"),
secondary: rgb("#23373b"),
neutral-lightest: rgb("#fafafa"),
neutral-dark: rgb("#23373b"),
neutral-darkest: rgb("#23373b"),
)
```
You can modify this color theme using `config-colors()`.
## Slide Function Family
The Metropolis theme provides a variety of custom slide functions:
```typst
#title-slide(extra: none, ..args)
```
`title-slide` reads information from `self.info` for display, and you can also pass in an `extra` parameter to display additional information.
---
```typst
#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: components.side-by-side,
// metropolis theme
title: auto,
footer: auto,
align: horizon,
)[
...
]
```
A default slide with headers and footers, where the title defaults to the current section title, and the footer is what you set.
---
```typst
#focus-slide[
...
]
```
Used to draw attention, with the background color set to `self.colors.primary-dark`.
---
```typst
#new-section-slide(short-title: auto, title)
```
Creates a new section with the given title.
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.metropolis: *
#import "@preview/numbly:0.1.0": numbly
#show: metropolis-theme.with(
aspect-ratio: "16-9",
footer: self => self.info.institution,
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.city,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
= Outline <touying:hidden>
#outline(title: none, indent: 1em, depth: 1)
= First Section
---
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
=== sdfsdf
A slide with equation:
$ x_(n+1) = (x_n + a/x_n) / 2 $
#lorem(200)
= Second Section
#focus-slide[
Wake up!
]
== Simple Animation
We can use `#pause` to #pause display something later.
#meanwhile
Meanwhile, #pause we can also use `#meanwhile` to display other content synchronously.
#speaker-note[
+ This is a speaker note.
+ You won't see it unless you use `config-common(show-notes-on-second-screen: right)`
]
#show: appendix
= Appendix
---
Please pay attention to the current slide number.
```
+128
View File
@@ -0,0 +1,128 @@
---
sidebar_position: 1
---
# Simple Theme
![image](https://github.com/touying-typ/touying/assets/34951714/83d5295e-f961-4ffd-bc56-a7049848d408)
This theme originates from [Polylux](https://polylux.dev/book/themes/gallery/simple.html), created by Andreas Kröpelin.
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:
```typst
#import "@preview/touying:0.6.1": *
#import themes.simple: *
#show: simple-theme.with(
aspect-ratio: "16-9",
footer: [Simple slides],
)
```
The `register` function in the theme accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".
- `header`: The content displayed in the header, with a default of `utils.display-current-heading(setting: utils.fit-to-width.with(grow: false, 100%))`. You can also pass a function like `self => self.info.title`.
- `header-right`: The content displayed on the right side of the header, with a default of `self => self.info.logo`.
- `footer`: The content displayed in the footer, with a default of `[]` (empty). You can also pass a function like `self => self.info.author`.
- `footer-right`: The content displayed on the right side of the footer, with a default of `context utils.slide-counter.display() + " / " + utils.last-slide-number`.
- `primary`: The primary color of the theme, with a default of `aqua.darken(50%)`.
- `subslide-preamble`: By default, it adds the subsection title to the current slide.
## Slide Function Family
The Simple theme provides a variety of custom slide functions:
```typst
#centered-slide(section: ..)[
...
]
```
A slide with content centered, and the `section` parameter can be used to create a new section.
---
```typst
#title-slide[
...
]
```
Similar to `centered-slide`, this is provided for consistency with Polylux syntax.
---
```typst
#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: components.side-by-side,
)[
...
]
```
A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set.
---
```typst
#focus-slide(foreground: ..., background: ...)[
...
]
```
Used to draw attention, it optionally accepts a foreground color (defaulting to `white`) and a background color (defaulting to `auto`, i.e., `self.colors.primary`).
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.simple: *
#show: simple-theme.with(
aspect-ratio: "16-9",
footer: [Simple 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
#lorem(20)
#focus-slide[
_Focus!_
This is very important.
]
= Let's start a new section!
== Dynamic slide
Did you know that...
#pause
...you can see the current section at the top of the slide?
```
+197
View File
@@ -0,0 +1,197 @@
---
sidebar_position: 6
---
# Stargazer Theme
![image](https://github.com/user-attachments/assets/4950008f-ac64-47ab-a7ca-cdf15361ba0f)
The Stargazer theme, originally created by [Coekjan](https://github.com/Coekjan/) for the [touying-buaa](https://github.com/Coekjan/touying-buaa) project, is an aesthetically pleasing and versatile theme suitable for everyday use.
## Initialization
You can initialize the theme with the following code:
```typst
#import "@preview/touying:0.6.1": *
#import themes.stargazer: *
#import "@preview/numbly:0.1.0": numbly
#show: stargazer-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Stargazer in Touying: Customize Your Slide Title Here],
subtitle: [Customize Your Slide Subtitle Here],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.school,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
#outline-slide()
```
The `stargazer-theme` accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, either "16-9" or "4-3", with a default of "16-9".
- `align`: The alignment of the slides, with a default of `horizon`.
- `alpha`: The transparency of the slides, with a default of `20%`.
- `title`: The content displayed in the header, with a default of `utils.display-current-heading()`, or you can pass a function like `self => self.info.title`.
- `progress-bar`: Whether to display a progress bar at the bottom of the slide, with a default of `true`.
- `footer-columns`: The widths of the three footer columns, with a default of `(25%, 25%, 1fr, 5em)`.
- `footer-a`: The first column, with a default of `self => self.info.author`.
- `footer-b`: The second column, with a default of `self => utils.display-info-date(self)`.
- `footer-c`: The third column, with a default of `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`.
- `footer-d`: The fourth column, with a default of `context utils.slide-counter.display() + " / " + utils.last-slide-number`.
## Color Theme
The Stargazer theme uses the following color scheme by default:
```typc
config-colors(
primary: rgb("#005bac"),
primary-dark: rgb("#004078"),
secondary: rgb("#ffffff"),
tertiary: rgb("#005bac"),
neutral-lightest: rgb("#ffffff"),
neutral-darkest: rgb("#000000"),
)
```
You can modify this color scheme using `config-colors()`.
## Slide Function Family
The Stargazer theme offers a variety of custom slide functions:
```typst
#title-slide(extra: none, ..args)
```
`title-slide` reads information from `self.info` for display, and you can also pass an `extra` parameter for additional information.
---
```typst
#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: components.side-by-side,
// stargazer theme
title: auto,
footer: auto,
align: horizon,
)[
...
]
```
A standard slide function with a title and footer by default, where `title` defaults to the current section title, and the footer is the one you set.
---
```typst
#outline-slide[
...
]
```
Used to add a table of contents slide.
---
```typst
#focus-slide[
...
]
```
Used to draw the audience's attention. The background color is `self.colors.primary-dark`.
---
```typst
#new-section-slide(short-title: auto, title)
```
Start a new section with the given title.
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.stargazer: *
#import "@preview/numbly:0.1.0": numbly
#show: stargazer-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Stargazer in Touying: Customize Your Slide Title Here],
subtitle: [Customize Your Slide Subtitle Here],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.school,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
#outline-slide()
= Section A
== Subsection A.1
#tblock(title: [Theorem])[
A simple theorem.
$ x_(n+1) = (x_n + a / x_n) / 2 $
]
== Subsection A.2
A slide without a title but with *important* information.
= Section B
== Subsection B.1
#lorem(80)
#focus-slide[
Wake up!
]
== Subsection B.2
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.
#show: appendix
= Appendix
== Appendix
Please pay attention to the current slide number.
```
+174
View File
@@ -0,0 +1,174 @@
---
sidebar_position: 4
---
# University Theme
![image](https://github.com/touying-typ/touying/assets/34951714/4095163c-0c16-4760-b370-8adc1cdd7e6c)
This aesthetically pleasing theme is courtesy of [Pol Dellaiera](https://github.com/drupol).
## Initialization
You can initialize the theme with the following code:
```typst
#import "@preview/touying:0.6.1": *
#import themes.university: *
#import "@preview/numbly:0.1.0": numbly
#show: university-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.school,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide()
```
The `register` function accepts the following parameters:
- `aspect-ratio`: The aspect ratio of the slides, either "16-9" or "4-3", with a default of "16-9".
- `progress-bar`: Whether to display a progress bar at the top of the slide, with a default of `true`.
- `header`: The content displayed in the header, with a default of `utils.display-current-heading(level: 2)`, or you can pass a function like `self => self.info.title`.
- `header-right`: The content displayed on the right side of the header, with a default of `self => self.info.logo`.
- `footer-columns`: The widths of the three columns in the footer, with a default of `(25%, 1fr, 25%)`.
- `footer-a`: The first column, with a default of `self => self.info.author`.
- `footer-b`: The second column, with a default of `self => if self.info.short-title == auto { self.info.title } else { self.info.short-title }`.
- `footer-c`: The third column, with a default of
```typst
self => {
h(1fr)
utils.display-info-date(self)
h(1fr)
context utils.slide-counter.display() + " / " + utils.last-slide-number
h(1fr)
}
```
## Color Theme
The University theme uses the following color scheme by default:
```typc
config-colors(
primary: rgb("#04364A"),
secondary: rgb("#176B87"),
tertiary: rgb("#448C95"),
neutral-lightest: rgb("#ffffff"),
neutral-darkest: rgb("#000000"),
)
```
You can modify this color scheme using `config-colors()`.
## Slide Function Family
The University theme provides a series of custom slide functions:
```typst
#title-slide(logo: none, authors: none, ..args)
```
The `title-slide` function reads information from `self.info` for display, and you can also pass a `logo` parameter and an array-type `authors` parameter.
---
```typst
#slide(
config: (:),
repeat: auto,
setting: body => body,
composer: components.side-by-side,
// university theme
title: none,
)[
...
]
```
A standard slide function with a title and footer by default, where `title` defaults to the current section title, and the footer is the one you set.
### Focus Slide
```typst
#focus-slide(background-img: ..., background-color: ...)[
...
]
```
Used to capture the audience's attention. The default background color is `self.colors.primary`.
### Matrix Slide
```typst
#matrix-slide(columns: ..., rows: ...)[
...
][
...
]
```
Refer to the [documentation](https://polylux.dev/book/themes/gallery/university.html).
## Example
```typst
#import "@preview/touying:0.6.1": *
#import themes.university: *
#import "@preview/numbly:0.1.0": numbly
#show: university-theme.with(
aspect-ratio: "16-9",
config-info(
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
logo: emoji.school,
),
)
#set heading(numbering: numbly("{1}.", default: "1.1"))
#title-slide(authors: ([Author A], [Author B]))
= The Section
== Slide Title
#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)
```