From 7181717ba0e64b8ce08a5c45060ad58518315618 Mon Sep 17 00:00:00 2001 From: Maxime Augier Date: Fri, 21 Jun 2024 17:07:19 +0200 Subject: [PATCH] Better formatting for note blocks, vertical spacing after QCM --- exam/lib.typ | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/exam/lib.typ b/exam/lib.typ index dc8c7d1..6237a5f 100644 --- a/exam/lib.typ +++ b/exam/lib.typ @@ -49,6 +49,7 @@ } else { qcm_list } + v(1em) } @@ -122,10 +123,15 @@ #let reponse(a) = { let answ_block = block(width: 100%, inset: 1em, solution(a)); block(stroke: black, answ_block) - v(2em) + v(2em, weak: true) } -#let notes(n) = if enable_notes { text(fill: red, n) } else { none }; +#let notes(n) = if enable_notes { + block(fill: luma(230), radius: 1em, inset: 1em, text(fill: red, n)) + v(2em, weak: true) +} else { + none +}; // Question d'examen. Numérotée automatiquement, nombre de points optionnel // (défaut 1), bloc de réponse automatique si 2e argument présent @@ -135,10 +141,11 @@ context { qctr.step() } let num = context { qctr.display() }; - [#num) #q #pts] - if a.pos().len() > 0 { - reponse(a.pos().at(0)) - } + //v(2em, weak: true) + block(breakable: false, + [#num) #q #pts] + if a.pos().len() > 0 { + reponse(a.pos().at(0)) + } else { none }) }