-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate.typ
129 lines (111 loc) · 2.06 KB
/
template.typ
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// You may need to change this settings
#let sansen = "KpSans"
#let sanszh = "Source Han Sans SC"
#let serifen = "KpRoman"
#let serifzh = "Source Han Serif SC"
#let emj = "Segoe UI Emoji"
#let info = author => align(center)[
#author.email \
#author.phone \
#author.home · #author.github · #author.linkin
]
// You don't really need to change the content below
#let sans = (sansen, sanszh, emj)
#let serif = (serifen, serifzh, emj)
#let titlefont = (serifen, sanszh, emj)
#let project(title: "", author: (
name: ""
), body) = {
// Set the document's basic properties.
set document(author: author.name, title: title)
set page(
numbering: "1 / 1",
number-align: center,
margin: (
x: 0.7in,
y: 0.5in
)
)
set text(
font: serif,
lang: "en"
)
show math.equation: set text(weight: 400)
// Title row.
align(center)[
#block(
text(
font: titlefont,
weight: 700,
1.75em,
smallcaps(title)
)
)
]
// Author information.
pad(
top: 0.5em,
bottom: 0.5em,
x: 2em,
info(author)
)
// Main body.
set par(justify: true)
body
}
#let icon(name, baseline: 1.5pt) = {
box(
baseline: baseline,
height: 10pt,
image(name)
)
}
#let titleemj(name, baseline: 1.5pt) = {
box(
baseline: baseline,
height: 16pt,
image(name)
)
}
#let chiline() = {v(-3pt); line(length: 100%); v(-5pt)}
#let section(term) = {
show heading.where(
level: 1
): it => block(width: 100%)[
#set text(
font: sans,
weight: "regular",
)
#smallcaps(it.body)
]
[ = #term ]
chiline()
}
#let datedsubsection(term, data) = {
grid(
columns: (1fr, auto),
align(left)[ #term ],
align(right)[ #data ],
)
}
#let leftsection(term) = [
#show heading.where(
level: 1
): it => block(width: 100%)[
#set text(
font: sans,
weight: "regular"
)
#smallcaps(it.body)
]
= #term
]
#let group(terms) = {
v(1.35em)
grid(
columns: (2fr, 8fr),
column-gutter: 2em,
row-gutter: 2em,
..terms
)
}