Use _compose helper function

This commit is contained in:
Joscha 2024-12-13 20:39:11 +01:00
parent c1e61d251f
commit 9842070869

View file

@ -1,3 +1,8 @@
#let _compose(..args) = {
assert(args.pos().len() > 0, message: "args required")
args.pos().slice(0, -1).rev().fold(args.pos().at(-1), (x, f) => f(x))
}
///////////// /////////////
// "Enums" // // "Enums" //
///////////// /////////////
@ -20,15 +25,11 @@
set par(leading: 5pt) set par(leading: 5pt)
// Weird vertical text in the bottom left // Weird vertical text in the bottom left
place( _compose(
bottom + left, place.with(bottom + left, dx: -6mm, dy: -1mm),
dx: -6mm, rotate.with(-90deg, origin: bottom + left),
dy: -1mm, text.with(size: 6pt, tracking: 3.1pt),
rotate( "K_PSE_PB_AZDoku_01_04-20",
-90deg,
origin: bottom + left,
text(size: 6pt, tracking: 3.1pt, "K_PSE_PB_AZDoku_01_04-20"),
),
) )
// Main box // Main box
@ -40,31 +41,23 @@
inset: 0mm, inset: 0mm,
)[ )[
// Logo // Logo
#place( #_compose(
top + left, place.with(top + left, dx: 9.5mm, dy: 3.5mm),
dx: 9.5mm, image(width: 29mm, "kit_logo.svg"),
dy: 3.5mm,
image("kit_logo.svg", width: 29mm),
) )
// Heading // Heading
#place( #_compose(
top + left, place.with(top + left, dx: 78mm, dy: 9mm),
dx: 78mm, text.with(weight: "bold", size: 14pt, fill: _kit_green),
dy: 9mm, [Arbeitszeitdokumentation],
text(
weight: "bold",
size: 14pt,
fill: _kit_green,
)[Arbeitszeitdokumentation],
) )
// Page number // Page number
#place( #_compose(
bottom + right, place.with(bottom + right, dx: -15mm, dy: -1.5mm),
dx: -15mm, text.with(size: 9pt),
dy: -1.5mm, [Seite 1 von 1],
text(size: 9pt)[Seite 1 von 1],
) )
// Main content // Main content
@ -112,10 +105,10 @@
[], [],
align(right)[ align(right)[
*Monat / Jahr:* #h(6mm) *Monat / Jahr:* #h(6mm)
#_underlined( #_compose(
align(center)[ _underlined,
#box(width: 21mm)[#month] / #box(width: 21mm)[#year] align.with(center),
], [#box(width: 21mm)[#month] / #box(width: 21mm)[#year]],
) )
], ],
@ -135,22 +128,18 @@
[*OE:*], _underlined(box(width: 100%)[#department]), [*OE:*], _underlined(box(width: 100%)[#department]),
[*Vertraglich vereinbarte Arbeitszeit:*], [*Vertraglich vereinbarte Arbeitszeit:*],
[ [
#_underlined( #_compose(
align(center)[ _underlined,
#h(4mm) align.with(center),
#box(width: 10mm)[#monthly_hours] [#h(4mm) #box(width: 10mm)[#monthly_hours] Std. #h(4mm)],
Std.
#h(4mm)
],
) )
#h(1fr) #h(1fr)
*Stundensatz:* *Stundensatz:*
#h(4mm) #h(4mm)
#_underlined( #_compose(
align(center)[ _underlined,
#box(width: 18mm)[#hourly_wage] align.with(center),
*€* [#box(width: 18mm)[#hourly_wage] *€*],
],
) )
], ],
), ),