resume/cv.typ

198 lines
4.8 KiB
Text
Raw Normal View History

2024-09-14 20:13:34 +00:00
#show heading: set text(font: "New Computer Modern")
#show link: underline
// smartypants and latex compatibility
#show "--": [#sym.dash.en]
#show "---": [#sym.dash.em]
#show "\&": [#sym.amp]
2024-09-14 20:13:34 +00:00
// Choose the compiled language through cli by doing
//
// $ typst compile --input lang=de cv.typ
//
#let lang = {
if "lang" in sys.inputs and sys.inputs.lang == "de" {
"de"
} else {
"en"
}
}
#let _columns_3(left_body, center_body, right_body) = {
block[
#box(width: 1fr)[
#align(left)[#left_body]
]
#box(width: 1fr)[
#align(center)[#center_body]
]
#box(width: 1fr)[
#align(right)[#right_body]
]
]
}
#let header(about, columns: (1.5fr, 1fr, 1fr)) = {
[= #about.fullname];
let contact_fields = (for c in about.contact {
if "link" in c {
([#c.icon ~ #link(c.link)[#c.text]],)
} else {
([#c.icon ~ #c.text],)
}
})
grid(
columns: columns,
gutter: 5pt,
..contact_fields
);
}
#let subdued(body) = {
block(inset: 5%, width: 85%, text(fill:luma(150), body))
}
2024-09-14 20:13:34 +00:00
#let entry(item: ()) = {
if "title" in item {
[*#item.title.at(lang)*]
}
if "place" in item {
if "title" in item {
[, ]
}
[_#item.place.at(lang)_]
}
[#h(1fr)]
if "date" in item {
[ _#item.date.at(lang)_ \ ]
}
2024-09-14 20:13:34 +00:00
if "bullets" in item {
for bullet in item.bullets {
[- #bullet.at(lang)]
}
}
if "publication" in item {
subdued[#item.publication.at(lang) \ ]
2024-09-14 20:13:34 +00:00
};
if "abstract" in item {
subdued[#item.abstract.at(lang) \ ]
}
2024-09-14 20:13:34 +00:00
}
#let horizon_line() = {v(-3pt); line(length: 100%); v(-5pt)}
#let section_header(title) = {[== #title]; horizon_line()};
#let section(title: "Section", entries: (), body) = {
section_header(title);
if body == none or body == [] {
for e in entries {
entry(item:e)
}
} else {
body
}
};
// Slightly re-styled entry with PLACE first and TITLE second
#let education_entry(item: ()) = {
assert("place" in item and "title" in item and "date" in item, message: "Education items require place, program and date.");
[*#item.place.at(lang)*, #item.title.at(lang) #h(1fr)];
2024-09-14 20:13:34 +00:00
[ _#item.date.at(lang)_ \ ];
}
// Restyled entry with PLACE not emphasized like usual, and no date but an abstract
#let thesis_entry(item: ()) = {
assert("title" in item and "place" in item, message: "Thesis items require type and title.");
[*#item.title.at(lang)* #item.place.at(lang) #h(1fr)];
2024-09-14 20:13:34 +00:00
[#par(item.abstract.at(lang))]
}
#let sel_word_lang(de: "", en:"") = {
if lang == "de" {
de
} else {
en
}
}
// Old-style presentation of skills and qualifications, to be overhauled
2024-09-14 20:13:34 +00:00
#let skill_item(item: ()) = {
[*#item.at(lang)*: \ ]
for skill in item.content {
[#skill.name.at(lang) (]
for (i, v) in skill.items.enumerate() {
[#v.at(lang)]
if i < skill.items.len() - 1 {
[, ]
}
}
[) \ ]
}
}
#let resume(contents) = {
// Feel free to change the margin below to best fit your own CV
set page(
paper: "a4",
margin: (x: 0.9cm, y: 1.3cm),
footer: [
#set text(
fill: luma(200),
size: 8pt,
)
#_columns_3[
#smallcaps[#datetime.today().display("[month repr:long] [day], [year]")]
][
#smallcaps[
// FIXME: Source from about.fullname variable
Marty Oehme
// #sym.dot.c
// CV
]
][
#counter(page).display()
]
],
)
set par(justify: true)
header(contents.about)
2024-09-14 20:13:34 +00:00
if "summary" in contents {
section(title:"", {
2024-09-14 20:13:34 +00:00
contents.summary.at(lang)
})
};
2024-09-14 20:13:34 +00:00
if "experience" in contents {
let title = sel_word_lang(en:"Professional Experience", de:"Berufserfahrung")
section(title: title, entries:contents.experience)[]
}
2024-09-14 20:13:34 +00:00
if "education" in contents {
let title = sel_word_lang(en:"Education", de:"Ausbildung")
section(title: title, entries:contents.thesis + contents.education)[]
}
if "volunteering" in contents {
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
section(title: title, entries:contents.volunteering)[]
2024-09-14 20:13:34 +00:00
}
if "skills" in contents {
let title = sel_word_lang(en:"Qualifications", de:"Qualifikationen")
section(title: "Qualifications", {
2024-09-14 20:13:34 +00:00
for cat in contents.skills {
skill_item(item:cat)
}
})
}
}
#resume(
yaml("content.yml")
)