From db5c830b5aebe726a21abd985a3985c9a88e5fd2 Mon Sep 17 00:00:00 2001 From: Lyes Saadi Date: Thu, 26 Mar 2026 18:52:54 +0100 Subject: [PATCH] Stylistic changes --- lib.typ | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/lib.typ b/lib.typ index f594a81..edfa9ae 100644 --- a/lib.typ +++ b/lib.typ @@ -1,3 +1,4 @@ + #let signature(at: none, date: none, ..signatories) = { let answer = [ _Fait à_ ] @@ -15,16 +16,19 @@ answer += text(weight: "bold", date.display("[day]/[month]/[year]")) } - let grid-construction(s) = text(weight: "bold", s.at(0)) + "\n" + text(style: "italic", s.at(1)) - let g = signatories.pos().map(grid-construction) + let names-grid-construction(s) = text(weight: "bold", s.at(0)) + "\n" + text(style: "italic", s.at(1)) + let sign-grid-construction(s) = if (s.len() >= 3) { align(left, pad(5pt, s.at(2))) } else { [] } + let n = signatories.pos().map(names-grid-construction) + let s = signatories.pos().map(sign-grid-construction) - answer += grid(columns: (50%, 50%), rows: (100pt), ..g) + answer += grid(columns: (50%, 50%), rows: (auto, 70pt), ..n, ..s) block(answer, breakable: false) } #let template(body, title: "Title", subtitle: "Subtitle", logo: none, watermark: "", size: 10pt) = { - // Apparence du document + // Document appearence + set document(title: title + " ‑ " + subtitle) set page(columns: 2, margin: 1.5cm, numbering: "1/1") set page(background: rotate(-55deg, text(size: 50pt, rgb(0, 0, 0, 30))[*#watermark*])) @@ -34,6 +38,10 @@ set list(marker: sym.bar.h) + set enum(numbering: "(i)") + + show link: l => [#text(underline(l), fill: color.blue)] + // Style des titres let premier(.., last, format: "I") = numbering(format, last) + if last == 1 { super[er] } @@ -87,14 +95,20 @@ } } - // Début du document + // Start of the document place( top + center, scope: "parent", float: true, align(center)[ #if logo != none { - image(logo, height: 5em) + if type(logo) == str { + image(logo, alt: "Logo", height: 5em) + } else if type(logo) == content { + logo + } else { + panic("logo is not of type str or content") + } } #text(size: 2.5em, weight: "extrabold")[#title]