diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-20 17:46:35 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-20 17:47:33 +0100 |
| commit | d8522a98c6a1db7a4b240c4d36cfadb59e22304e (patch) | |
| tree | a3e8b83534d94cdcee6d6ec7e79eb8bfdcadd4b9 /typst/callout | |
| parent | 24179eaf99387417dd618b42a7b3b55414ef7da6 (diff) | |
feat(typst): callouts
also fix package hierarchy
Diffstat (limited to 'typst/callout')
| -rw-r--r-- | typst/callout/1.0.0/lib.typ | 70 | ||||
| -rw-r--r-- | typst/callout/1.0.0/typst.toml | 7 |
2 files changed, 77 insertions, 0 deletions
diff --git a/typst/callout/1.0.0/lib.typ b/typst/callout/1.0.0/lib.typ new file mode 100644 index 0000000..5add04a --- /dev/null +++ b/typst/callout/1.0.0/lib.typ @@ -0,0 +1,70 @@ +#let emptyblock((fontcolor, bgcolor), content) = { + set par( + leading: 0.75em, + first-line-indent: 0em, + spacing: 1.3em, + ) + set text(fill: fontcolor) + block( + width: 100%, + inset: 1.5em, + radius: 0.5em, + breakable: false, + fill: bgcolor, + content + ) +} + +#let callout(icon, title, title_content, colors, content) = { + emptyblock(colors)[ + #text(size: 1.25em)[#icon~ #strong(title)] + + #content + ] +} + +#let warning(body) = { + 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", + (rgb("#2AA63D"), rgb("#DBFCE7"), rgb("#7AF0A8")), + body) +} + +#let defn(body) = { + callout( + $Delta$, + "Définition", + title, + (oklch(20%, 20%, 247deg), oklch(75%, 25%, 247deg, 40%)), + body, + ) +} + +#let props(body) = { + callout( + $Pi$, + "Proposition", + title, + (oklch(20%, 20%, 247deg), oklch(85%, 10%, 247deg, 50%)), + body, + ) +} + +#let thm(body) = { + callout( + $Tau$, + "Théorème", + title, + (oklch(20%, 20%, 220deg), oklch(80%, 25%, 220deg, 40%)), + body, + ) +} diff --git a/typst/callout/1.0.0/typst.toml b/typst/callout/1.0.0/typst.toml new file mode 100644 index 0000000..be0b876 --- /dev/null +++ b/typst/callout/1.0.0/typst.toml @@ -0,0 +1,7 @@ +[package] +name = "callout" +version = "1.0.0" +entrypoint = "lib.typ" +authors = ["Anhgelus Morhtuuzh"] +license = "MIT" +description = "My callouts" |
