Skip to content

Commit 425a7e7

Browse files
committed
fix: use theorion
1 parent 3cfa243 commit 425a7e7

File tree

19 files changed

+256
-204
lines changed

19 files changed

+256
-204
lines changed

docs/integration/theorion.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# [Theorion](https://github.com/OrangeX4/typst-theorion)
6+
7+
Touying can work properly with the [Theorion](https://github.com/OrangeX4/typst-theorion) package, you can directly use the [theorion](https://github.com/OrangeX4/typst-theorion) package. Additionally, you can use `#set heading(numbering: "1.1")` to set numbering for sections and subsections.
8+
9+
**Note: To make animation commands like `#pause` work properly with theorion, you need to use `config-common(frozen-counters: (theorem-counter,))` to bind counters that need to be frozen.**
10+
11+
```typst
12+
#import "@preview/touying:0.6.1": *
13+
#import themes.university: *
14+
#import "@preview/numbly:0.1.0": numbly
15+
#import "@preview/theorion:0.3.2": *
16+
#import cosmos.clouds: *
17+
#show: show-theorion
18+
19+
#show: university-theme.with(
20+
aspect-ratio: "16-9",
21+
config-common(frozen-counters: (theorem-counter,)), // freeze theorem counter for animation
22+
)
23+
24+
#set heading(numbering: numbly("{1}.", default: "1.1"))
25+
26+
= Theorems
27+
28+
== Prime numbers
29+
30+
#definition[
31+
A natural number is called a #highlight[_prime number_] if it is greater
32+
than 1 and cannot be written as the product of two smaller natural numbers.
33+
]
34+
#example[
35+
The numbers $2$, $3$, and $17$ are prime.
36+
@cor_largest_prime shows that this list is not exhaustive!
37+
]
38+
39+
#pause
40+
41+
#theorem(title: "Euclid")[
42+
There are infinitely many primes.
43+
]
44+
45+
#pagebreak(weak: true)
46+
47+
#proof[
48+
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
49+
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
50+
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
51+
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
52+
contradiction.
53+
]
54+
55+
#corollary[
56+
There is no largest prime number.
57+
] <cor_largest_prime>
58+
#corollary[
59+
There are infinitely many composite numbers.
60+
]
61+
62+
#theorem[
63+
There are arbitrarily long stretches of composite numbers.
64+
]
65+
66+
#proof[
67+
For any $n > 2$, consider $
68+
n! + 2, quad n! + 3, quad ..., quad n! + n
69+
$
70+
]
71+
```
72+
73+
![image](https://github.com/user-attachments/assets/f54dd873-aa20-4703-b83e-8748658b569a)

docs/start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Touying offers many built-in themes to easily create beautiful slides. For examp
4343
#import "@preview/cetz:0.3.2"
4444
#import "@preview/fletcher:0.5.4" as fletcher: node, edge
4545
#import "@preview/numbly:0.1.0": numbly
46-
#import "@preview/theorion:0.3.0": *
46+
#import "@preview/theorion:0.3.2": *
4747
#import cosmos.clouds: *
4848
#show: show-theorion
4949

i18n/zh/docusaurus-plugin-content-docs/current/integration/cetz.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause`
1313
```typst
1414
#import "@preview/touying:0.6.1": *
1515
#import themes.metropolis: *
16-
#import "@preview/cetz:0.3.1"
17-
#import "@preview/fletcher:0.5.3" as fletcher: node, edge
16+
#import "@preview/cetz:0.3.2"
17+
#import "@preview/fletcher:0.5.4" as fletcher: node, edge
1818
1919
// cetz and fletcher bindings for touying
2020
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))

i18n/zh/docusaurus-plugin-content-docs/current/integration/ctheorems.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

i18n/zh/docusaurus-plugin-content-docs/current/integration/fletcher.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea
1111
```typst
1212
#import "@preview/touying:0.6.1": *
1313
#import themes.metropolis: *
14-
#import "@preview/cetz:0.3.1"
15-
#import "@preview/fletcher:0.5.3" as fletcher: node, edge
14+
#import "@preview/cetz:0.3.2"
15+
#import "@preview/fletcher:0.5.4" as fletcher: node, edge
1616
1717
// cetz and fletcher bindings for touying
1818
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))

i18n/zh/docusaurus-plugin-content-docs/current/integration/mitex.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 2
99
示例:
1010

1111
```typst
12-
#import "@preview/mitex:0.2.3": *
12+
#import "@preview/mitex:0.2.5": *
1313
1414
Write inline equations like #mi("x") or #mi[y].
1515

i18n/zh/docusaurus-plugin-content-docs/current/integration/pinit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 1
99
## 简单示例
1010

1111
```typst
12-
#import "@preview/pinit:0.2.0": *
12+
#import "@preview/pinit:0.2.2": *
1313
1414
#set text(size: 24pt)
1515
@@ -38,7 +38,7 @@ A simple #pin(1)highlighted text#pin(2).
3838
```typst
3939
#import "@preview/touying:0.6.1": *
4040
#import themes.default: *
41-
#import "@preview/pinit:0.2.0": *
41+
#import "@preview/pinit:0.2.2": *
4242
4343
#set text(size: 20pt, font: "Calibri", ligatures: false)
4444
#show heading: set text(weight: "regular")

docs/integration/ctheorems.md renamed to i18n/zh/docusaurus-plugin-content-docs/current/integration/theorion.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,26 @@
22
sidebar_position: 6
33
---
44

5-
# Ctheorems
5+
# Theorion
66

7-
Touying can work seamlessly with the `ctheorems` package, allowing you to directly use the `ctheorems` package.
7+
Touying 能够与 theorion 包一起正常工作,你可以直接使用 theorion 包。其中,你还可以使用 `#set heading(numbering: "1.1")` 为 sections 和 subsections 设置 numbering。
88

9-
Moreover, you can utilize `#set heading(numbering: "1.1")` to set numbering for sections and subsections.
9+
**注意:为了让 `#pause` 等动画命令与 theorion 一起正常工作,你需要使用 `config-common(frozen-counters: (theorem-counter,))` 来绑定需要冻结的 counter。**
1010

1111
```typst
1212
#import "@preview/touying:0.6.1": *
13-
#import themes.simple: *
14-
#import "@preview/ctheorems:1.1.3": *
13+
#import themes.university: *
1514
#import "@preview/numbly:0.1.0": numbly
15+
#import "@preview/theorion:0.3.2": *
16+
#import cosmos.clouds: *
17+
#show: show-theorion
1618
17-
// Theorems configuration by ctheorems
18-
#show: thmrules.with(qed-symbol: $square$)
19-
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
20-
#let corollary = thmplain(
21-
"corollary",
22-
"Corollary",
23-
base: "theorem",
24-
titlefmt: strong
19+
#show: university-theme.with(
20+
aspect-ratio: "16-9",
21+
config-common(frozen-counters: (theorem-counter,)), // freeze theorem counter for animation
2522
)
26-
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
27-
#let example = thmplain("example", "Example").with(numbering: none)
28-
#let proof = thmproof("proof", "Proof")
2923
30-
#show: simple-theme.with(aspect-ratio: "16-9")
24+
#set heading(numbering: numbly("{1}.", default: "1.1"))
3125
3226
= Theorems
3327
@@ -42,13 +36,18 @@ Moreover, you can utilize `#set heading(numbering: "1.1")` to set numbering for
4236
@cor_largest_prime shows that this list is not exhaustive!
4337
]
4438
45-
#theorem("Euclid")[
39+
#pause
40+
41+
#theorem(title: "Euclid")[
4642
There are infinitely many primes.
4743
]
44+
45+
#pagebreak(weak: true)
46+
4847
#proof[
4948
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
5049
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
51-
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
50+
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
5251
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
5352
contradiction.
5453
]
@@ -66,9 +65,9 @@ Moreover, you can utilize `#set heading(numbering: "1.1")` to set numbering for
6665
6766
#proof[
6867
For any $n > 2$, consider $
69-
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
68+
n! + 2, quad n! + 3, quad ..., quad n! + n
7069
$
7170
]
7271
```
7372

74-
![image](https://github.com/touying-typ/touying/assets/34951714/b506da7e-b7d6-4493-b35a-2307cfd38ddc)
73+
![image](https://github.com/user-attachments/assets/f54dd873-aa20-4703-b83e-8748658b569a)

i18n/zh/docusaurus-plugin-content-docs/current/start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Hello, Typst!
4141
#import "@preview/cetz:0.3.2"
4242
#import "@preview/fletcher:0.5.4" as fletcher: node, edge
4343
#import "@preview/numbly:0.1.0": numbly
44-
#import "@preview/theorion:0.3.0": *
44+
#import "@preview/theorion:0.3.2": *
4545
#import cosmos.clouds: *
4646
#show: show-theorion
4747

i18n/zh/docusaurus-plugin-content-docs/version-0.6.x/integration/cetz.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause`
1313
```typst
1414
#import "@preview/touying:0.6.1": *
1515
#import themes.metropolis: *
16-
#import "@preview/cetz:0.3.1"
17-
#import "@preview/fletcher:0.5.3" as fletcher: node, edge
16+
#import "@preview/cetz:0.3.2"
17+
#import "@preview/fletcher:0.5.4" as fletcher: node, edge
1818
1919
// cetz and fletcher bindings for touying
2020
#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true))

0 commit comments

Comments
 (0)