Format with typstyle
This commit is contained in:
parent
64dffb43d6
commit
18df7051e7
2 changed files with 491 additions and 439 deletions
444
cv.typ
444
cv.typ
|
@ -11,266 +11,290 @@
|
|||
// $ typst compile --input lang=de cv.typ
|
||||
//
|
||||
#let lang = {
|
||||
if "lang" in sys.inputs and sys.inputs.lang == "de" {
|
||||
"de"
|
||||
} else {
|
||||
"en"
|
||||
}
|
||||
if "lang" in sys.inputs and sys.inputs.lang == "de" {
|
||||
"de"
|
||||
} else {
|
||||
"en"
|
||||
}
|
||||
}
|
||||
#let sel_word_lang(de: "", en:"") = {
|
||||
if lang == "de" {
|
||||
de
|
||||
} else {
|
||||
en
|
||||
}
|
||||
#let sel_word_lang(de: "", en: "") = {
|
||||
if 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]
|
||||
]
|
||||
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
|
||||
);
|
||||
[= #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))
|
||||
block(inset: 5%, width: 85%, text(fill: luma(150), body))
|
||||
}
|
||||
|
||||
#let entry(item: ()) = {
|
||||
if "title" in item {
|
||||
[*#item.title.at(lang)*]
|
||||
}
|
||||
if "place" in 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)_ \ ]
|
||||
}
|
||||
if "bullets" in item {
|
||||
for bullet in item.bullets {
|
||||
[- #bullet.at(lang)]
|
||||
}
|
||||
}
|
||||
if "publication" in item {
|
||||
subdued[#item.publication.at(lang) \ ]
|
||||
};
|
||||
if "abstract" in item {
|
||||
subdued[#item.abstract.at(lang) \ ]
|
||||
[_#item.place.at(lang)_]
|
||||
}
|
||||
[#h(1fr)]
|
||||
if "date" in item {
|
||||
[ _#item.date.at(lang)_ \ ]
|
||||
}
|
||||
if "bullets" in item {
|
||||
for bullet in item.bullets {
|
||||
[- #bullet.at(lang)]
|
||||
}
|
||||
}
|
||||
if "publication" in item {
|
||||
subdued[#item.publication.at(lang) \ ]
|
||||
}
|
||||
if "abstract" in item {
|
||||
subdued[#item.abstract.at(lang) \ ]
|
||||
}
|
||||
}
|
||||
|
||||
#let horizon_line() = {v(-3pt); line(length: 100%); v(-5pt)}
|
||||
#let horizon_line() = {
|
||||
v(-3pt)
|
||||
line(length: 100%)
|
||||
v(-5pt)
|
||||
}
|
||||
|
||||
#let section_header(title) = {[== #title]; horizon_line()};
|
||||
#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
|
||||
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)];
|
||||
[ _#item.date.at(lang)_ \ ];
|
||||
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)]
|
||||
[ _#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)];
|
||||
[#par(item.abstract.at(lang))]
|
||||
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)]
|
||||
[#par(item.abstract.at(lang))]
|
||||
}
|
||||
|
||||
// skill-specific entry, changing its style for sidebar
|
||||
#let skill_item(item: (), is_sidebar: false) = {
|
||||
let side_list(body) = if is_sidebar {list(body)} else {par(body)}
|
||||
for skill in item {
|
||||
side_list({
|
||||
[*#skill.name.at(lang)*]
|
||||
if is_sidebar [\ ] else [ (]
|
||||
for (i,v) in skill.items.enumerate() {
|
||||
[#v.at(lang)]
|
||||
if i < skill.items.len() - 1 {
|
||||
[, ]
|
||||
}
|
||||
}
|
||||
if not is_sidebar [)]
|
||||
})
|
||||
}
|
||||
let side_list(body) = if is_sidebar { list(body) } else { par(body) }
|
||||
for skill in item {
|
||||
side_list({
|
||||
[*#skill.name.at(lang)*]
|
||||
if is_sidebar [\ ] else [ (]
|
||||
for (i, v) in skill.items.enumerate() {
|
||||
[#v.at(lang)]
|
||||
if i < skill.items.len() - 1 {
|
||||
[, ]
|
||||
}
|
||||
}
|
||||
if not is_sidebar [)]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#let cv(contents, use_sidebar: false) = {
|
||||
set text(lang: lang)
|
||||
set text(lang: lang)
|
||||
|
||||
let date_formatting = {
|
||||
if lang == "de" {
|
||||
"[day]. [month repr:long] [year]"
|
||||
} else {
|
||||
"[month repr:long] [day], [year]"
|
||||
}
|
||||
let date_formatting = {
|
||||
if lang == "de" {
|
||||
"[day]. [month repr:long] [year]"
|
||||
} else {
|
||||
"[month repr:long] [day], [year]"
|
||||
}
|
||||
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(date_formatting)]
|
||||
][
|
||||
#smallcaps[#contents.about.fullname]
|
||||
][
|
||||
#context counter(page).display()
|
||||
]
|
||||
],
|
||||
)
|
||||
}
|
||||
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(date_formatting)]
|
||||
][
|
||||
#smallcaps[#contents.about.fullname]
|
||||
][
|
||||
#context counter(page).display()
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
set par(justify: true)
|
||||
set par(justify: true)
|
||||
|
||||
header(contents.about)
|
||||
header(contents.about)
|
||||
|
||||
let body = {
|
||||
if "summary" in contents {
|
||||
section(title:"", {
|
||||
contents.summary.at(lang)
|
||||
})
|
||||
};
|
||||
|
||||
if "experience" in contents {
|
||||
let title = sel_word_lang(en:"Professional Experience", de:"Berufserfahrung")
|
||||
section(title: title, entries:contents.experience)[]
|
||||
}
|
||||
|
||||
if "education" in contents {
|
||||
let title = sel_word_lang(en:"Education", de:"Ausbildung")
|
||||
section(title: title, entries:contents.thesis + contents.education)[]
|
||||
}
|
||||
|
||||
if not use_sidebar {
|
||||
if "volunteering" in contents {
|
||||
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
|
||||
section(title: title, entries:contents.volunteering)[]
|
||||
}
|
||||
|
||||
if "skills" in contents {
|
||||
let title = sel_word_lang(en:"Qualifications", de:"Qualifikationen")
|
||||
section(title: title, {
|
||||
skill_item(item:contents.skills)
|
||||
})
|
||||
}
|
||||
|
||||
if "languages" in contents {
|
||||
let title = sel_word_lang(en:"Languages", de:"Sprachen")
|
||||
section(title: title, {
|
||||
skill_item(item:contents.languages)
|
||||
})
|
||||
}
|
||||
}
|
||||
let body = {
|
||||
if "summary" in contents {
|
||||
section(
|
||||
title: "",
|
||||
{
|
||||
contents.summary.at(lang)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
let sidebar = {
|
||||
if "volunteering" in contents {
|
||||
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
|
||||
[== #title]
|
||||
for e in contents.volunteering {
|
||||
[
|
||||
- *#e.title.at(lang)* (#e.date.at(lang))
|
||||
#par(e.bullets.at(0).at(lang)) \
|
||||
]
|
||||
}
|
||||
}
|
||||
if "experience" in contents {
|
||||
let title = sel_word_lang(en: "Professional Experience", de: "Berufserfahrung")
|
||||
section(title: title, entries: contents.experience)[]
|
||||
}
|
||||
|
||||
if "languages" in contents {
|
||||
let title = sel_word_lang(en:"Languages", de:"Sprachen")
|
||||
[== #title]
|
||||
skill_item(item:contents.languages, is_sidebar: true)
|
||||
[\ ]
|
||||
}
|
||||
|
||||
if "skills" in contents {
|
||||
let title = sel_word_lang(en:"Qualifications", de:"Kenntnisse")
|
||||
[== #title]
|
||||
skill_item(item:contents.skills, is_sidebar: true)
|
||||
}
|
||||
if "education" in contents {
|
||||
let title = sel_word_lang(en: "Education", de: "Ausbildung")
|
||||
section(title: title, entries: contents.thesis + contents.education)[]
|
||||
}
|
||||
|
||||
if not use_sidebar {
|
||||
body
|
||||
return
|
||||
}
|
||||
let margin = 1pt
|
||||
grid(
|
||||
columns: (2fr, 1fr),
|
||||
block(outset: 0pt, inset: (top: 0.4 * margin, right: 0pt, rest: margin), stroke: none, width: 100%, {
|
||||
set block(above: 10pt)
|
||||
show heading.where(level: 1): it => style(s => {
|
||||
let h = text(size: 18pt, upper(it))
|
||||
let dim = measure(h, s)
|
||||
stack(
|
||||
dir: ltr,
|
||||
h,
|
||||
place(
|
||||
dy: 7pt,
|
||||
dx: 10pt,
|
||||
horizon + left,
|
||||
line(stroke: accent-color, length: 100% - dim.width - 10pt)
|
||||
),
|
||||
)
|
||||
})
|
||||
body
|
||||
}),
|
||||
{
|
||||
v(20pt)
|
||||
set block(inset: (left: 20 * margin, right: 20 * margin))
|
||||
show heading: it => align(right, upper(it))
|
||||
set list(marker: "")
|
||||
show list: it => {
|
||||
set par(justify: false)
|
||||
align(right, block(it))
|
||||
}
|
||||
sidebar
|
||||
}
|
||||
)
|
||||
if "volunteering" in contents {
|
||||
let title = sel_word_lang(en: "Volunteer Work", de: "Ehrenamt")
|
||||
section(title: title, entries: contents.volunteering)[]
|
||||
}
|
||||
|
||||
if "skills" in contents {
|
||||
let title = sel_word_lang(en: "Qualifications", de: "Qualifikationen")
|
||||
section(
|
||||
title: title,
|
||||
{
|
||||
skill_item(item: contents.skills)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if "languages" in contents {
|
||||
let title = sel_word_lang(en: "Languages", de: "Sprachen")
|
||||
section(
|
||||
title: title,
|
||||
{
|
||||
skill_item(item: contents.languages)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let sidebar = {
|
||||
if "volunteering" in contents {
|
||||
let title = sel_word_lang(en: "Volunteer Work", de: "Ehrenamt")
|
||||
[== #title]
|
||||
for e in contents.volunteering {
|
||||
[
|
||||
- *#e.title.at(lang)* (#e.date.at(lang))
|
||||
#par(e.bullets.at(0).at(lang)) \
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if "languages" in contents {
|
||||
let title = sel_word_lang(en: "Languages", de: "Sprachen")
|
||||
[== #title]
|
||||
skill_item(item: contents.languages, is_sidebar: true)
|
||||
[\ ]
|
||||
}
|
||||
|
||||
if "skills" in contents {
|
||||
let title = sel_word_lang(en: "Qualifications", de: "Kenntnisse")
|
||||
[== #title]
|
||||
skill_item(item: contents.skills, is_sidebar: true)
|
||||
}
|
||||
}
|
||||
|
||||
if not use_sidebar {
|
||||
body
|
||||
return
|
||||
}
|
||||
let margin = 1pt
|
||||
grid(
|
||||
columns: (2fr, 1fr),
|
||||
block(
|
||||
outset: 0pt,
|
||||
inset: (top: 0.4 * margin, right: 0pt, rest: margin),
|
||||
stroke: none,
|
||||
width: 100%,
|
||||
{
|
||||
set block(above: 10pt)
|
||||
show heading.where(level: 1): it => style(s => {
|
||||
let h = text(size: 18pt, upper(it))
|
||||
let dim = measure(h, s)
|
||||
stack(
|
||||
dir: ltr,
|
||||
h,
|
||||
place(
|
||||
dy: 7pt,
|
||||
dx: 10pt,
|
||||
horizon + left,
|
||||
line(stroke: accent-color, length: 100% - dim.width - 10pt),
|
||||
),
|
||||
)
|
||||
})
|
||||
body
|
||||
},
|
||||
),
|
||||
{
|
||||
v(20pt)
|
||||
set block(inset: (left: 20 * margin, right: 20 * margin))
|
||||
show heading: it => align(right, upper(it))
|
||||
set list(marker: "")
|
||||
show list: it => {
|
||||
set par(justify: false)
|
||||
align(right, block(it))
|
||||
}
|
||||
sidebar
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
#cv.with(use_sidebar: false)(
|
||||
yaml("content.yml")
|
||||
)
|
||||
#cv.with(use_sidebar: false)(yaml("content.yml"))
|
||||
|
||||
|
|
486
resume.typ
486
resume.typ
|
@ -11,283 +11,312 @@
|
|||
// $ typst compile --input lang=de cv.typ
|
||||
//
|
||||
#let lang = {
|
||||
if "lang" in sys.inputs and sys.inputs.lang == "de" {
|
||||
"de"
|
||||
} else {
|
||||
"en"
|
||||
}
|
||||
if "lang" in sys.inputs and sys.inputs.lang == "de" {
|
||||
"de"
|
||||
} else {
|
||||
"en"
|
||||
}
|
||||
}
|
||||
#let sel_word_lang(de: "", en:"") = {
|
||||
if lang == "de" {
|
||||
de
|
||||
} else {
|
||||
en
|
||||
}
|
||||
#let sel_word_lang(de: "", en: "") = {
|
||||
if 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]
|
||||
]
|
||||
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
|
||||
);
|
||||
[= #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))
|
||||
block(inset: 5%, width: 85%, text(fill: luma(150), body))
|
||||
}
|
||||
|
||||
#let by_client(experience:()) = {
|
||||
let by_client = (:)
|
||||
#let by_client(experience: ()) = {
|
||||
let by_client = (:)
|
||||
|
||||
for item in experience {
|
||||
let client = item.place.at(lang)
|
||||
if client not in by_client {
|
||||
by_client.insert(client, ())
|
||||
|
||||
}
|
||||
by_client.at(client).push( (item.title.at(lang), item.date.at(lang)) )
|
||||
for item in experience {
|
||||
let client = item.place.at(lang)
|
||||
if client not in by_client {
|
||||
by_client.insert(client, ())
|
||||
}
|
||||
by_client.at(client).push((item.title.at(lang), item.date.at(lang)))
|
||||
}
|
||||
|
||||
for (client, jobs) in by_client {
|
||||
[*#client*:]
|
||||
for j in jobs {
|
||||
[- #j.at(0) #h(1fr) #j.at(1)]
|
||||
}
|
||||
for (client, jobs) in by_client {
|
||||
[*#client*:]
|
||||
for j in jobs {
|
||||
[- #j.at(0) #h(1fr) #j.at(1)]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#let by_experience_type(type:(), experience:()) = {
|
||||
let by_ty = (:)
|
||||
for (id, desc) in type {
|
||||
let matching_exp_items = ();
|
||||
// for item in experience {
|
||||
// [itemtypeid: #item.typeid, id: #id]
|
||||
// if item.typeid == id {
|
||||
// matching_exp_items.push(item)
|
||||
// }
|
||||
// }
|
||||
let matching_exp_items = experience.filter(item =>
|
||||
int(item.typeid) == int(id))
|
||||
[=== _#desc.at(lang)_]
|
||||
by_client(experience: matching_exp_items)
|
||||
}
|
||||
#let by_experience_type(type: (), experience: ()) = {
|
||||
let by_ty = (:)
|
||||
for (id, desc) in type {
|
||||
let matching_exp_items = ()
|
||||
// for item in experience {
|
||||
// [itemtypeid: #item.typeid, id: #id]
|
||||
// if item.typeid == id {
|
||||
// matching_exp_items.push(item)
|
||||
// }
|
||||
// }
|
||||
let matching_exp_items = experience.filter(item => int(item.typeid) == int(id))
|
||||
[=== _#desc.at(lang)_]
|
||||
by_client(experience: matching_exp_items)
|
||||
}
|
||||
}
|
||||
|
||||
#let entry(item: ()) = {
|
||||
if "title" in item {
|
||||
[*#item.title.at(lang)*]
|
||||
}
|
||||
if "place" in 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)_ \ ]
|
||||
}
|
||||
if "bullets" in item {
|
||||
for bullet in item.bullets {
|
||||
[- #bullet.at(lang)]
|
||||
}
|
||||
}
|
||||
if "publication" in item {
|
||||
subdued[#item.publication.at(lang) \ ]
|
||||
};
|
||||
if "abstract" in item {
|
||||
subdued[#item.abstract.at(lang) \ ]
|
||||
[_#item.place.at(lang)_]
|
||||
}
|
||||
[#h(1fr)]
|
||||
if "date" in item {
|
||||
[ _#item.date.at(lang)_ \ ]
|
||||
}
|
||||
if "bullets" in item {
|
||||
for bullet in item.bullets {
|
||||
[- #bullet.at(lang)]
|
||||
}
|
||||
}
|
||||
if "publication" in item {
|
||||
subdued[#item.publication.at(lang) \ ]
|
||||
}
|
||||
if "abstract" in item {
|
||||
subdued[#item.abstract.at(lang) \ ]
|
||||
}
|
||||
}
|
||||
|
||||
#let horizon_line() = {v(-3pt); line(length: 100%); v(-5pt)}
|
||||
#let horizon_line() = {
|
||||
v(-3pt)
|
||||
line(length: 100%)
|
||||
v(-5pt)
|
||||
}
|
||||
|
||||
#let section_header(title) = {[== #title]; horizon_line()};
|
||||
#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
|
||||
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)];
|
||||
[ _#item.date.at(lang)_ \ ];
|
||||
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)]
|
||||
[ _#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)];
|
||||
[#par(item.abstract.at(lang))]
|
||||
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)]
|
||||
[#par(item.abstract.at(lang))]
|
||||
}
|
||||
|
||||
// skill-specific entry, changing its style for sidebar
|
||||
#let skill_item(item: (), is_sidebar: false) = {
|
||||
let side_list(body) = if is_sidebar {list(body)} else {par(body)}
|
||||
for skill in item {
|
||||
side_list({
|
||||
[*#skill.name.at(lang)*]
|
||||
if is_sidebar [\ ] else [ (]
|
||||
for (i,v) in skill.items.enumerate() {
|
||||
[#v.at(lang)]
|
||||
if i < skill.items.len() - 1 {
|
||||
[, ]
|
||||
}
|
||||
}
|
||||
if not is_sidebar [)]
|
||||
})
|
||||
}
|
||||
let side_list(body) = if is_sidebar { list(body) } else { par(body) }
|
||||
for skill in item {
|
||||
side_list({
|
||||
[*#skill.name.at(lang)*]
|
||||
if is_sidebar [\ ] else [ (]
|
||||
for (i, v) in skill.items.enumerate() {
|
||||
[#v.at(lang)]
|
||||
if i < skill.items.len() - 1 {
|
||||
[, ]
|
||||
}
|
||||
}
|
||||
if not is_sidebar [)]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#let resume(contents, main: ("experience", "education"), sidebar: ("volunteering", "languages", "skills")) = {
|
||||
set text(lang: lang)
|
||||
set text(lang: lang)
|
||||
|
||||
let date_formatting = {
|
||||
if lang == "de" {
|
||||
"[day]. [month repr:long] [year]"
|
||||
} else {
|
||||
"[month repr:long] [day], [year]"
|
||||
}
|
||||
let date_formatting = {
|
||||
if lang == "de" {
|
||||
"[day]. [month repr:long] [year]"
|
||||
} else {
|
||||
"[month repr:long] [day], [year]"
|
||||
}
|
||||
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(date_formatting)]
|
||||
][
|
||||
#smallcaps[#contents.about.fullname]
|
||||
][
|
||||
#context counter(page).display()
|
||||
]
|
||||
],
|
||||
)
|
||||
}
|
||||
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(date_formatting)]
|
||||
][
|
||||
#smallcaps[#contents.about.fullname]
|
||||
][
|
||||
#context counter(page).display()
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
set par(justify: true)
|
||||
set par(justify: true)
|
||||
|
||||
header(contents.about)
|
||||
header(contents.about)
|
||||
|
||||
let body = {
|
||||
if "summary" in main and "summary" in contents {
|
||||
section(title:"", {
|
||||
contents.summary.at(lang)
|
||||
})
|
||||
}
|
||||
|
||||
if "experience" in main and "experience" in contents {
|
||||
let title = sel_word_lang(en:"Professional Experience", de:"Berufserfahrung")
|
||||
section(title: title)[]
|
||||
by_experience_type(experience: contents.experience, type: contents.experience_types)
|
||||
}
|
||||
|
||||
if "education" in main and "education" in contents {
|
||||
let title = sel_word_lang(en:"Education", de:"Ausbildung")
|
||||
section(title: title, entries:contents.thesis + contents.education)[]
|
||||
}
|
||||
|
||||
if "volunteering" in main and "volunteering" in contents {
|
||||
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
|
||||
section(title: title, entries:contents.volunteering)[]
|
||||
}
|
||||
|
||||
if "skills" in main and "skills" in contents {
|
||||
let title = sel_word_lang(en:"Qualifications", de:"Qualifikationen")
|
||||
section(title: title, {
|
||||
skill_item(item:contents.skills)
|
||||
})
|
||||
}
|
||||
|
||||
if "languages" in main and "languages" in contents {
|
||||
let title = sel_word_lang(en:"Languages", de:"Sprachen")
|
||||
section(title: title, {
|
||||
skill_item(item:contents.languages)
|
||||
})
|
||||
}
|
||||
let body = {
|
||||
if "summary" in main and "summary" in contents {
|
||||
section(
|
||||
title: "",
|
||||
{
|
||||
contents.summary.at(lang)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
let sidebar = {
|
||||
if "volunteering" in sidebar and "volunteering" in contents {
|
||||
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
|
||||
[== #title]
|
||||
for e in contents.at("volunteering") {
|
||||
[
|
||||
- *#e.title.at(lang)* (#e.date.at(lang))
|
||||
#par(e.bullets.at(0).at(lang)) \
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if "languages" in sidebar and "languages" in contents {
|
||||
let title = sel_word_lang(en:"Languages", de:"Sprachen")
|
||||
[== #title]
|
||||
skill_item(item:contents.languages, is_sidebar: true)
|
||||
[\ ]
|
||||
}
|
||||
|
||||
if "skills" in sidebar and "skills" in contents {
|
||||
let title = sel_word_lang(en:"Qualifications", de:"Kenntnisse")
|
||||
[== #title]
|
||||
skill_item(item:contents.skills, is_sidebar: true)
|
||||
}
|
||||
if "experience" in main and "experience" in contents {
|
||||
let title = sel_word_lang(en: "Professional Experience", de: "Berufserfahrung")
|
||||
section(title: title)[]
|
||||
by_experience_type(experience: contents.experience, type: contents.experience_types)
|
||||
}
|
||||
|
||||
let margin = 1pt
|
||||
grid(
|
||||
columns: (2fr, 1fr),
|
||||
block(outset: 0pt, inset: (top: 0.4 * margin, right: 0pt, rest: margin), stroke: none, width: 100%, {
|
||||
set block(above: 10pt)
|
||||
show heading.where(level: 1): it => style(s => {
|
||||
let h = text(size: 18pt, upper(it))
|
||||
let dim = measure(h, s)
|
||||
stack(
|
||||
dir: ltr,
|
||||
h,
|
||||
place(
|
||||
dy: 7pt,
|
||||
dx: 10pt,
|
||||
horizon + left,
|
||||
line(stroke: accent-color, length: 100% - dim.width - 10pt)
|
||||
),
|
||||
)
|
||||
})
|
||||
body
|
||||
}),
|
||||
align(right, block(fill: luma(250), width: 90%,
|
||||
if "education" in main and "education" in contents {
|
||||
let title = sel_word_lang(en: "Education", de: "Ausbildung")
|
||||
section(title: title, entries: contents.thesis + contents.education)[]
|
||||
}
|
||||
|
||||
if "volunteering" in main and "volunteering" in contents {
|
||||
let title = sel_word_lang(en: "Volunteer Work", de: "Ehrenamt")
|
||||
section(title: title, entries: contents.volunteering)[]
|
||||
}
|
||||
|
||||
if "skills" in main and "skills" in contents {
|
||||
let title = sel_word_lang(en: "Qualifications", de: "Qualifikationen")
|
||||
section(
|
||||
title: title,
|
||||
{
|
||||
skill_item(item: contents.skills)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if "languages" in main and "languages" in contents {
|
||||
let title = sel_word_lang(en: "Languages", de: "Sprachen")
|
||||
section(
|
||||
title: title,
|
||||
{
|
||||
skill_item(item: contents.languages)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
let sidebar = {
|
||||
if "volunteering" in sidebar and "volunteering" in contents {
|
||||
let title = sel_word_lang(en: "Volunteer Work", de: "Ehrenamt")
|
||||
[== #title]
|
||||
for e in contents.at("volunteering") {
|
||||
[
|
||||
- *#e.title.at(lang)* (#e.date.at(lang))
|
||||
#par(e.bullets.at(0).at(lang)) \
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if "languages" in sidebar and "languages" in contents {
|
||||
let title = sel_word_lang(en: "Languages", de: "Sprachen")
|
||||
[== #title]
|
||||
skill_item(item: contents.languages, is_sidebar: true)
|
||||
[\ ]
|
||||
}
|
||||
|
||||
if "skills" in sidebar and "skills" in contents {
|
||||
let title = sel_word_lang(en: "Qualifications", de: "Kenntnisse")
|
||||
[== #title]
|
||||
skill_item(item: contents.skills, is_sidebar: true)
|
||||
}
|
||||
}
|
||||
|
||||
let margin = 1pt
|
||||
grid(
|
||||
columns: (2fr, 1fr),
|
||||
block(
|
||||
outset: 0pt,
|
||||
inset: (top: 0.4 * margin, right: 0pt, rest: margin),
|
||||
stroke: none,
|
||||
width: 100%,
|
||||
{
|
||||
set block(above: 10pt)
|
||||
show heading.where(level: 1): it => style(s => {
|
||||
let h = text(size: 18pt, upper(it))
|
||||
let dim = measure(h, s)
|
||||
stack(
|
||||
dir: ltr,
|
||||
h,
|
||||
place(
|
||||
dy: 7pt,
|
||||
dx: 10pt,
|
||||
horizon + left,
|
||||
line(stroke: accent-color, length: 100% - dim.width - 10pt),
|
||||
),
|
||||
)
|
||||
})
|
||||
body
|
||||
},
|
||||
),
|
||||
align(
|
||||
right,
|
||||
block(
|
||||
fill: luma(250),
|
||||
width: 90%,
|
||||
{
|
||||
v(15pt)
|
||||
set block(inset: (left: 20 * margin, right: 20 * margin))
|
||||
|
@ -297,13 +326,12 @@
|
|||
set par(justify: false)
|
||||
align(right, block(it))
|
||||
}
|
||||
sidebar
|
||||
sidebar
|
||||
v(15pt)
|
||||
}))
|
||||
)
|
||||
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#resume(
|
||||
yaml("content.yml")
|
||||
)
|
||||
#resume(yaml("content.yml"))
|
||||
|
|
Loading…
Reference in a new issue