From 1b5d0072897e5d0a42cfb77ffb815c8a4eaf94fb Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Thu, 12 Jun 2025 11:51:21 +0200 Subject: [PATCH] wip --- lib/general.typ | 20 ++++++++++++++++++++ lib/lib.typ | 1 + lib/matisse-thesis.typ | 8 ++++++-- lib/todos.typ | 18 +++++++++++++++--- template/main.typ | 2 +- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 lib/general.typ diff --git a/lib/general.typ b/lib/general.typ new file mode 100644 index 0000000..07b03a4 --- /dev/null +++ b/lib/general.typ @@ -0,0 +1,20 @@ + +// ------------ SYMBOLS/ABBREVIATIONS ------------ + +#let ie = [_i.e._,] +#let eg = [_e.g._,] +#let etc = [_etc._] +#let etal = [_et al._] + +// ------------ FORMATING ------------ + +#let paragraph(title) = [#title #h(1em)] + +#let epigraph(attribution, body) = align(right, box(width: 50%)[ + #set align(left) + #quote( + block: true, + attribution: attribution, + body + ) +]) diff --git a/lib/lib.typ b/lib/lib.typ index b371c94..7e37926 100644 --- a/lib/lib.typ +++ b/lib/lib.typ @@ -1,2 +1,3 @@ #import "matisse-thesis.typ": * #import "todos.typ": * +#import "general.typ": * diff --git a/lib/matisse-thesis.typ b/lib/matisse-thesis.typ index 695e22b..31985ea 100644 --- a/lib/matisse-thesis.typ +++ b/lib/matisse-thesis.typ @@ -2,7 +2,7 @@ #import "cover.typ": cover #import "abstracts.typ": abstracts -#import "todos.typ": todos +#import "todos.typ": todos, show-todos #let matisse-thesis( // English title, will be used for the document title metadata @@ -34,7 +34,11 @@ body ) = { - if draft { todos() } + if draft { + todos() + } else { + show-todos.update(false) + } // ---------- GENERAL ---------- diff --git a/lib/todos.typ b/lib/todos.typ index 13090d0..fd6934b 100644 --- a/lib/todos.typ +++ b/lib/todos.typ @@ -1,10 +1,22 @@ #let todo-list = state("todo-list",()) #let show-todos = state("show-todos", true) -#let todo(done: false, content) = context { - if (not done) and (show-todos.get()) { +#let todo(color: red, content) = context { + if show-todos.get() { let todonum = todo-list.get().len() + 1 - text(weight: "bold", fill: red, [TODO n°#todonum #label("todo-"+str(todonum)): #content]) + + box( + text(font: "DejaVu Sans Mono", white, size: .5em)[ + TODO #todonum #label("todo-"+str(todonum)) + ], + inset: 3pt, fill: color, + ) + text(weight: "bold", fill: color)[ + #box(text($triangle.filled.r$, size: .8em), baseline: -.8mm) + _ #content _ + #box(text($triangle.filled.l$, size: .8em), baseline: -.8mm) + ] + todo-list.update(x => x + (("todo-"+str(x.len()+1),x.len()+1, content),)) } } diff --git a/template/main.typ b/template/main.typ index 4239c2e..0dfcaf5 100644 --- a/template/main.typ +++ b/template/main.typ @@ -17,7 +17,7 @@ keywords-fr: keywords-fr, abstract-en: abstract-en, abstract-fr: abstract-fr, -draft: true, + draft: true, ) // Preamble