-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.typ
168 lines (153 loc) · 3.62 KB
/
style.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
#import "@preview/fontawesome:0.5.0": *
#let author = "Aleksandr KADYKOV"
#let text-color = black
#let background-color = luma(100%, 0%) // Transparent white
#let primary-color = rgb("#3A468C")
// To avoid messing up with contexts
// #let layoutwidth = layout(size => {return size.width})
// #layoutwidth
#let full-width = 453.45pt
#let bodywidth = 317.41pt
#let line-spacing = 0.8em
// Define a function to set up style that accepts external variables
#let setup-style(
author: author,
public-email: "cv@kadykov.com",
title: "Research Engineer",
website: "www.kadykov.com",
github: "kadykov",
gitlab: "kadykov",
linkedin: "aleksandr-kadykov",
keywords: ("CV",),
language: "en",
date: auto,
hyphenate: auto,
doc,
) = {
// Document settings
set text(
font: "IBM Plex Serif",
size: 10.5pt,
lang: language,
fill: text-color,
hyphenate: hyphenate,
)
show heading: set text(
fill: primary-color,
font: "Fira Sans",
weight: "medium",
size: 1.1em,
hyphenate: auto,
)
show strong: set text(font: "IBM Plex Serif SmBld")
set document(
title: title,
author: author,
date: date,
keywords: keywords,
)
set page(
paper: "a4",
margin: (x: 2.5cm, y: 3.0cm),
header: [
#author
#h(1fr)
#if "PHONE" in sys.inputs.keys() [
#link("tel:" + sys.inputs.PHONE.replace(regex("[^0-9+]"), ""))[
#text(fill: primary-color)[#fa-phone()]
#sys.inputs.PHONE.replace("_", " ")
]
|
]
#let email = {
if "EMAIL" in sys.inputs.keys() {
sys.inputs.EMAIL
} else {
public-email
}
}
#link("mailto:" + email)[
#text(fill: primary-color)[#fa-envelope()]
#email
]
#v(-0.5em)
#line(length: 100%, stroke: 0.5pt)
#v(-1em)
],
footer: [
#v(-1em)
#line(length: 100%, stroke: 0.5pt)
#v(-0.5em)
#text(fill: primary-color)[#fa-arrow-up-right-from-square()]
#link("https://" + website)[#website]
#h(1fr)
#text(fill: black)[#fa-github()]
#link("https://github.com/" + github)[#github] |
#text(fill: orange)[#fa-gitlab()]
#link("https://gitlab.com/" + gitlab)[#gitlab] |
#text(fill: blue)[#fa-linkedin()]
#link("https://www.linkedin.com/in/" + linkedin)[#linkedin]
],
)
// Paragraph settings
set par(
justify: false,
leading: line-spacing,
)
doc
}
// Custom macros
#let horizontalrule = context {
let current-position = here().position().y
if current-position > 100pt and current-position < 730pt [
#line(length: full-width, stroke: 1.5pt + primary-color)
]
}
#let hidden-heading(title) = (
context {
let heading-size = measure(title)
[
#show heading: set text(fill: background-color)
#v(-1.5 * heading-size.height)
#title
#v(-heading-size.height)
]
}
)
#let body-side(body, side: []) = (
context {
let body-after-text = measure(block()[Text \ #body], width: bodywidth)
let text-only = measure([Text])
[
#body
#box()[
#place(
right,
dy: -(body-after-text.height - text-only.height),
dx: full-width,
)[#side]
]
#h(-0.25em)
]
}
)
#let company-location(body) = [
#text(fill: primary-color)[#fa-location-dot()]
#emph(body)
]
#let event-date(body) = [
#text(fill: primary-color)[#fa-calendar()]
#emph(body)
]
#let profile-photo(photo) = [
#box(
clip: true,
stroke: 1.5pt + primary-color,
radius: (
bottom-left: 0pt,
bottom-right: 50%,
top-left: 50%,
top-right: 0pt,
),
)[#photo]
]