summaryrefslogtreecommitdiff
path: root/resume-base.typ
blob: c8ae7ba8123f7906a5b8e113844e835fe92952ab (plain)
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
#let onepage = sys.inputs.at("onepage", default: "no") == "yes"
#let show-address = sys.inputs.at("address", default: "no") == "yes"

#let resume(
  name: none,
  legal-name: none,
  email: none,
  phone: none,
  website: none,
  address: none,
  description: none,
  keywords: (),
  text-base-size: 12pt,
  heading-color: black,
  text-color: black
) = {
  let section(title) = [
    #v(-4pt)
    #text(fill: heading-color, size: text-base-size * 1.4, weight: "regular")[#smallcaps[#title]]
    #v(-text-base-size * 1.3)
    #line(length: 100%, stroke: 0.5pt + heading-color)
  ]

  let entry(title, subtitle: none, date: "", bullets: ()) = [
    #box[
      #grid(
        columns: (auto, 1fr),
        [*#title*#if subtitle != none [\ #v(-6pt) #subtitle]], [#align(right)[#date]],
      )
      #v(1pt)
      #if bullets.len() > 0 [
        #v(-7pt)
        #list(
          marker: "--",
          ..bullets.map(item => [#par(justify: true)[#item]]),
        )
      ]
    ]
  ]

  let resume-title = name + "-- Resume"

  let apply = body => [
    #set document(
      title: resume-title,
      author: name,
      description: description,
      keywords: keywords,
    )

    #set page(
      margin: 0.25in,
      paper: "us-letter",
      height: if onepage { auto } else { 11in },
      fill: white,
    )
    #set text(font: "New Computer Modern", size: text-base-size, fill: text-color)
    // #set par(leading: 0.4em)

    #show heading.where(level: 1): it => [
      #section(it.body)
    ]
    #columns(2)[
      #text(size: text-base-size * 2.7, fill: heading-color)[#smallcaps[#name]]\
      #if show-address [
        #smallcaps[#address]\
        #if legal-name != none [#smallcaps[Legal name: #legal-name]]
      ] else [#v(-20pt)]
      #colbreak()
      #align(right)[
        #text(size: text-base-size * 1.4, fill: heading-color)[
          #link(website)[#website] | #link("mailto:" + email)[#email]\
          #link("tel:" + phone)[#phone]
        ]
      ]
    ]
    #body
  ]

  return (
    apply: apply,
    entry: entry
  )
}