aboutsummaryrefslogtreecommitdiff
path: root/typst/callout/1.0.0/lib.typ
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-02-17 12:02:36 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-02-17 12:02:36 +0100
commit6b2d702ec50c30c93430d49251428d0ff37b9314 (patch)
treec531fc636612f757fa94819053e3ceaac011c68a /typst/callout/1.0.0/lib.typ
parentfc62ca86ac5ee648391ce6453be850e1e73bf6a9 (diff)
feat(typst): proof callout
Diffstat (limited to 'typst/callout/1.0.0/lib.typ')
-rw-r--r--typst/callout/1.0.0/lib.typ34
1 files changed, 26 insertions, 8 deletions
diff --git a/typst/callout/1.0.0/lib.typ b/typst/callout/1.0.0/lib.typ
index 18185be..07c136e 100644
--- a/typst/callout/1.0.0/lib.typ
+++ b/typst/callout/1.0.0/lib.typ
@@ -15,9 +15,11 @@
)
}
-#let callout(icon, title, title_content, colors, content) = {
+#let title(content) = text(size: 1.15em, strong(content))
+
+#let callout(icon, title_content, colors, content) = {
emptyblock(colors)[
- #text(size: 1.15em)[#icon~ #strong(title)]
+ #text(size: 1.15em)[#icon~ #strong(title_content)]
#content
]
@@ -27,23 +29,24 @@
callout(
emoji.warning,
"Attention",
- title,
(oklch(25%, 35%, 52.55deg), oklch(68.9%, 44%, 52.55deg, 15%)),
body,
)
}
#let solution(body) = {
- callout(emoji.checkmark.box, "Solution",
+ callout(
+ emoji.checkmark.box,
+ "Solution",
(rgb("#2AA63D"), rgb("#DBFCE7"), rgb("#7AF0A8")),
- body)
+ body,
+ )
}
#let defn(body) = {
callout(
$Delta$,
"Définition",
- title,
(oklch(20%, 20%, 247deg), oklch(75%, 25%, 247deg, 40%)),
body,
)
@@ -53,7 +56,6 @@
callout(
$Pi$,
"Proposition",
- title,
(oklch(20%, 20%, 247deg), oklch(85%, 10%, 247deg, 50%)),
body,
)
@@ -63,8 +65,24 @@
callout(
$Tau$,
"Théorème",
- title,
(oklch(20%, 20%, 220deg), oklch(80%, 25%, 220deg, 40%)),
body,
)
}
+
+#let proof(body) = {
+ set par(
+ leading: 0.5em,
+ first-line-indent: 0em,
+ spacing: 1.2em,
+ )
+ set text(size: 0.9em, fill: luma(70))
+ block(
+ stroke: (left: 1pt + black),
+ inset: 1em,
+ )[
+ #title("Preuve")
+
+ #body
+ ]
+}