-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.typ
More file actions
112 lines (90 loc) · 2.33 KB
/
Copy pathlib.typ
File metadata and controls
112 lines (90 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//<>在这里添加第三方库的导入
//时间轴:https://typst.app/universe/package/timeliney
#import "@preview/timeliney:0.0.1"
//代码块:https://typst.app/universe/package/codly
#import "@preview/codly:0.2.0": *
//图表:https://typst.app/universe/package/fletcher
#import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge
//提示框:https://typst.app/universe/package/gentle-clues
#import "@preview/gentle-clues:0.9.0": *
//展示框:https://typst.app/universe/package/showybox
#import "@preview/showybox:2.0.1": showybox
//泡泡框:https://typst.app/universe/package/babble-bubbles
#import "@preview/babble-bubbles:0.1.0": *
//日历:https://typst.app/universe/package/cineca
#import "@preview/cineca:0.2.1": *
//伪代码:https://typst.app/universe/package/lovelace
#import "@preview/lovelace:0.3.0": *
//</>
#let icon(codepoint) = {
box(
height: 0.8em,
baseline: 0.05em,
image(codepoint)
)
h(0.1em)
}
//下面是自定义的方法
#let (
BLUE,
GREEN,
YELLOW,
RED,
)=(
rgb("#4285f4"),
rgb("#34a853"),
rgb("#fbbc05"),
rgb("#ea4335"),
)
#let BlueText(_text)={
set text(fill: BLUE)
[#_text]
}
#let GreenText(_text)={
set text(fill: GREEN)
[#_text]
}
#let YellowText(_text)={
set text(fill: YELLOW)
[#_text]
}
#let RedText(_text)={
set text(fill: RED)
[#_text]
}
#import "@preview/suiji:0.3.0": *
#let Colorful(_text)={
let colors = (
rgb("#4285F4"),
rgb("#34A853"),
rgb("#FBBC05"),
rgb("#EA4335"),
)
let i=7;
let rng = gen-rng(_text.text.len() * i);
let index_pre = integers(rng, low: 0, high: 4, size: none, endpoint: false).at(1);
for c in _text.text{
let rng = gen-rng(i - 1);
let index_cur = integers(rng, low: 0, high: 4, size: none, endpoint: false).at(1);
let cnt=100;
while index_cur == index_pre and cnt>0{
let rng = gen-rng(cnt + i);
index_cur = integers(rng, low: 0, high: 4, size: none, endpoint: false).at(1);
cnt -= 1;
}
let color = colors.at(index_cur);
set text(fill: color)
[#c]
index_pre = index_cur;
i += 2;
}
}
// #let BlueBox(title:"信息",accent-color:BLUE,header-color:BLUE.lighten(0%),..args)=idea(
// title:title,
// accent-color:accent-color,
// header-color:header-color,
// ..args
// )
#let undo(_text)={
text(fill: black.lighten(80%),_text)
}