arsalan-anwari's picture
Sync themes from znote
9286790 verified
Raw History Blame Contribute Delete
3.2 kB
#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
}