iowo/docs/template.typ

61 lines
1.1 KiB
Text
Raw Normal View History

// would also be interesting to try out IBM Plex Mono/Sans sometime
#let atk = "Atkinson Hyperlegible"
#let fonts = (
main: (font: atk, size: 12pt),
title: (font: atk, size: 20pt),
subtitle: (font: atk, size: 10pt),
heading: (font: "Montserrat", weight: "regular"),
)
2024-01-01 22:34:34 +00:00
#let conf(
title: none,
subtitle: none,
doc,
2024-01-01 22:34:34 +00:00
) = {
set page(
numbering: "1 / 1",
margin: 3.25cm,
header: locate(loc => {
datetime.today().display()
if counter(page).at(loc).first() > 1 {
// on all pages other than the first, the title is useful to have at hand
h(1fr)
title
}
}),
)
set text(..fonts.main)
set heading(numbering: "A.1")
show heading: it => text(..fonts.heading, it)
show raw.where(block: true): box.with(
fill: luma(95%),
inset: 1.25em,
radius: 0.75em,
width: 45em,
)
show raw.where(block: false): box.with(
fill: luma(95%),
outset: (y: 0.25em),
inset: (x: 0.15em),
radius: 0.25em,
)
// document title
if title != none {
align(
right,
text(..fonts.title, title)
+ v(-12pt)
+ text(..fonts.subtitle, subtitle)
)
2024-01-01 22:34:34 +00:00
v(0.25cm)
}
2024-01-01 22:34:34 +00:00
// content itself
2024-01-01 22:34:34 +00:00
doc
}