File size: 3,202 Bytes
9286790
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#let ink = rgb("#1f2937")
#let brand = rgb("#1e3a8a")
#let soft = rgb("#d7dee8")
#let quiet = rgb("#6b7280")
#let sans = ("Segoe UI", "Helvetica Neue", "Arial", "Libertinus Serif")
#let today = datetime.today().display("[day padding:none] [month repr:long] [year]")

#let base(body) = {
  set text(font: sans, size: 10.5pt, fill: ink, lang: "en")
  set par(justify: true, leading: 0.7em, spacing: 1.2em)
  set table(stroke: 0.5pt + soft, inset: 7pt)
  show heading: set text(fill: brand)
  show heading: set block(above: 1.6em, below: 0.8em)
  show table.cell.where(y: 0): strong
  body
}

#let report(title: "Title", subtitle: none, author: none, date: today, body) = {
  show: base
  set page(
    paper: "a4",
    margin: (x: 2.5cm, top: 3cm, bottom: 2.5cm),
    header: context if counter(page).get().first() > 1 {
      text(size: 9pt, fill: brand, title)
      h(1fr)
      text(size: 9pt, fill: quiet, date)
      v(-0.6em)
      line(length: 100%, stroke: 0.5pt + soft)
    },
    footer: context align(right, text(size: 9pt, fill: quiet, counter(page).display("1 / 1", both: true))),
  )
  set heading(numbering: "1.1")
  block(width: 100%, below: 2.5em)[
    #rect(width: 3cm, height: 4pt, fill: brand)
    #text(size: 26pt, weight: "bold", fill: brand, title)
    #if subtitle != none [\ #text(size: 14pt, subtitle)]

    #text(size: 10pt, fill: quiet, (author, date).filter(part => part != none).join[ · ])
  ]
  body
}

#let memo(to: "Recipient", from: "Sender", subject: "Subject", date: today, body) = {
  show: base
  set page(paper: "a4", margin: 2.5cm)
  text(size: 22pt, weight: "bold", fill: brand, tracking: 2pt)[MEMO]
  v(0.5em)
  grid(
    columns: (auto, 1fr),
    gutter: 0.8em,
    strong[To], to,
    strong[From], from,
    strong[Date], date,
    strong[Subject], subject,
  )
  line(length: 100%, stroke: 1pt + brand)
  v(0.5em)
  body
}

#let letter(
  sender: [Your name \ Street 1 \ City],
  recipient: [Recipient \ Street 2 \ City],
  subject: "Subject",
  date: today,
  closing: "Kind regards,",
  name: "Your name",
  body,
) = {
  show: base
  set page(paper: "a4", margin: (x: 2.5cm, y: 3cm))
  align(right, text(size: 9.5pt, fill: quiet, sender))
  v(1.5em)
  block(recipient)
  v(1.5em)
  align(right, date)
  block(above: 1.5em, below: 1.5em, text(weight: "bold", fill: brand, subject))
  body
  block(above: 2.5em, closing)
  block(above: 3.5em, name)
}

#let slides(title: "Title", subtitle: none, author: none, date: today, body) = {
  show: base
  set text(size: 20pt)
  set par(justify: false)
  set page(
    paper: "presentation-16-9",
    margin: (x: 2cm, top: 2cm, bottom: 1.8cm),
    footer: context text(size: 11pt, fill: quiet)[#title #h(1fr) #counter(page).display()],
  )
  show heading.where(level: 1): it => {
    pagebreak(weak: true)
    block(below: 1em, text(size: 30pt, weight: "bold", fill: brand, it.body))
  }
  show heading.where(level: 2): set text(size: 22pt)
  page(fill: brand, footer: none, align(horizon)[
    #set text(fill: white)
    #text(size: 40pt, weight: "bold", title)
    #if subtitle != none [\ #text(size: 24pt, subtitle)]

    #text(size: 16pt, (author, date).filter(part => part != none).join[ · ])
  ])
  body
}