-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtwentysecondcv.typ
185 lines (173 loc) · 3.31 KB
/
twentysecondcv.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
* Twenty Seconds Curriculum Vitae in Typst
* Author: Xiaoliang Wang
* Date: 2023-08-04
* License: MIT (see included file LICENSE)
*/
#import "@preview/fontawesome:0.2.1": *
#let headercolor = gray
#let pblue = rgb("#0395DE")
#let gray80 = rgb("#333333") // \color{black!80}
#let sidecolor = rgb("#E7E7E7")
#let mainblue = rgb("#0E5484")
#let maingray = rgb("#B9B9B9")
#let fontSize = (
tiny: 5pt,
scriptsize: 7pt,
footnotesize: 8pt,
small: 9pt,
normalsize: 10pt,
large: 12pt,
Large: 14pt,
LARGE: 17pt,
huge: 20pt,
Huge: 25pt,
)
/**
* @pages {int} total pages to calculate left block height,
since it's difficult to calculate using typst. default to 1.
* @left {block} left block
* @right {block} right block
*/
#let main(
pages: 1,
left,
right,
) = {
set page(
margin: (
left: 0cm,
right: 0cm,
top: 0cm,
bottom: 0cm,
)
)
grid(
columns: (35%, 65%),
rows: auto,
// column-gutter: 1em,
block(
fill: sidecolor,
height: pages * 100%,
pad(
top: 1cm,
rest: 0.5cm,
left
)
),
block(
height: auto,
pad(
top: 0.7cm,
rest: 0.5cm,
right,
)
),
)
}
#let profile(
name: "",
jobtitle: "",
) = {
text(fill: pblue, size: fontSize.Huge, name) // {\Huge\color{pblue}\cvname}
linebreak()
v(2mm)
text(fill: gray80, size: fontSize.Large, jobtitle) // {\Large\color{black!80}\cvjobtitle}
}
#let profile_section(title) = {
v(3mm)
align(left)[
#text(size: fontSize.huge, fill: gray80)[#title]
#box(width: 1fr, baseline: -0.5em, line(length: 100%, stroke: gray80))
]
}
// score is 1 base
#let progress(score) = {
box(rect(
height: 1em,
width: score * 100%,
fill: mainblue,
))
box(rect(
height: 1em,
width: (1 - score) * 100%,
fill: maingray,
))
}
/*
interest item is dictionary
(
interest: "AI",
score: 0.6 // 1.0 based percentage
)
*/
#let show_interests(interests) = {
set text(size: fontSize.large, fill: gray80)
for interest in interests {
text(interest.interest)
linebreak()
progress(interest.score)
}
}
/*
contact item is dictionary
(
icon: "linkedin",
solid: false, // Whether to use the solid version of the icon
text: "https://www.linkedin.com/in/someone",
)
*/
#let show_contacts(contacts) = {
v(3mm)
let c = ()
for contact in contacts {
c.push(fa-icon(contact.icon, solid: contact.at("solid", default: false), fill: pblue))
c.push(contact.text)
}
grid(
columns: (auto, auto),
column-gutter: 1em,
row-gutter: 1em,
..c
)
}
#let body_section(slice:3, title) = {
let (header, tailer) = (title.slice(0, slice), title.slice(slice))
set text(size: fontSize.LARGE)
block[
#v(3mm)
#strong()[
#text(fill: pblue, header)#text(fill: headercolor, tailer)
]
]
}
/*
#1 period, like From - To
#2 title
#3 note, basic note
#4 addtional_note
#5 body: the main body
*/
#let twentyitem(
period: "",
title: "",
note: "",
addtional_note: "",
body: ""
) = {
grid(
columns: (20%, 80%),
period,
par([
#block()[
#strong(title)
#box(width: 1fr)
#text(size: fontSize.footnotesize, note)
]
#if (addtional_note.len() > 0) {
block(addtional_note)
}
#body
])
)
}