forked from matchy233/typst-chi-cv-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chicv.typ
82 lines (73 loc) · 1.44 KB
/
chicv.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
#import "fontawesome.typ": *
#let chiline() = {
v(-3pt);
line(length: 100%, stroke: gray);
v(-10pt)
}
#let iconlink(
uri, text: "", icon: link-icon) = {
if text != "" {
link(uri)[#fa[#icon] #text]
} else {
link(uri)[#fa[#icon]]
}
}
#let cventry(
tl: lorem(2),
tr: "2333/23 - 2333/23",
bl: "",
br: "",
content
) = {
block(
inset: (left: 0pt),
strong(tl) + h(1fr) + tr +
linebreak() +
if bl != "" or br != "" {
bl + h(1fr) + br + linebreak()
} +
content
)
}
#let chicv(body) = {
set par(justify: true)
show heading.where(
level: 1
): set text(
size: 22pt,
font: (
"Avenir Next LT Pro", // original chi-cv font
"Manrope", // a font available in the typst environment and looks similar to Avenir
),
weight: "light",
)
show heading.where(
level: 2
): it => text(
size: 12pt,
font: (
"Avenir Next LT Pro",
"Manrope",
),
weight: "light",
block(
chiline() + it,
)
)
set list(indent: 0pt)
show link: it => underline(offset: 2pt, it)
set page(
margin: (x: 0.9cm, y: 1.3cm),
)
set par(justify: true)
body
}
#let today() = {
let month = (
"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December",
).at(datetime.today().month() - 1);
let day = datetime.today().day();
let year = datetime.today().year();
[#month #day, #year]
}