Add feuille_presences.typ

This commit is contained in:
Félix Piédallu 2026-01-29 16:38:59 +01:00
parent 569f6210bc
commit 9e8088ac2b

55
feuille_presences.typ Normal file
View file

@ -0,0 +1,55 @@
#let feuille_presences(
background: rgb("f4f1eb"),
company-details: none,
title: "",
margin: 2.1cm,
vertical-center-level: 2,
signataires: (),
body
) = {
set text(font: "Fira Sans")
// accomodate for page header, can't measure?
let real_margin_top = margin + 2cm
let page_header = [
#text(size: 9.2pt, company-details)
]
set page(
flipped: true,
fill: background,
margin: (top: real_margin_top, rest: margin),
header: page_header,
)
show heading.where(level: 1): set align(center)
show heading.where(level: 2): set align(center)
[= #title]
[== Registre des Présences]
v(2em)
let total_parts = 0
let total_voix = 0
table(
columns: (1fr, 1fr, 1fr, 1fr),
rows: (auto, auto),
align: horizon,
stroke: 0.8pt,
inset: 8pt,
table.header(
[Nom, Prénom], [Nombre d'Actions], [Nombre de Voix], [Signature],
),
..for sign in signataires {
total_parts = total_parts + int(sign.parts)
total_voix = total_voix + int(sign.voix)
([#sign.name], [#sign.parts], [#sign.voix], box(height: 60pt),)
},
table.header(
[Total], [#total_parts], [#total_voix], []
),
)
}