Void Linux workstation powered by niri, Fish and NeoVim. Contains scripts, browser extensions, custom XBPS packages, and typst plugins. git.anhgelus.world/anhgelus/dotfiles
void niri fish neovim nvim vim dotfiles linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(typst): callouts

also fix package hierarchy

+119 -7
+30 -3
typst/README.md
··· 3 3 The version of these scripts will always be `1.0.0`, because using anything else looks like to be too complicated for 4 4 anything. 5 5 6 - ## `template.typ` 6 + ## `template` 7 7 8 - This template requires: 8 + This package requires: 9 9 - `Inter` as the sans-serif font; 10 10 - `PT Astra Serif` as the serif font; 11 11 - `FiraCode Nerd Font Mono` as the monospace font. 12 12 13 - These can be freely used. 14 13 I may add an option to modify this. 14 + 15 + It is the template that I use everywhere. 16 + It can be freely used. 15 17 16 18 Import it and load it with: 17 19 ```typ ··· 27 29 page_title: "Page title :D", 28 30 ) 29 31 ``` 32 + 33 + ## `callout` 34 + 35 + This package contains my callouts. 36 + 37 + List of callouts: 38 + - `warning` 39 + - `defn` (definition) 40 + - `props` (proposition) 41 + - `thm` (théorème, which is theorem in French) 42 + 43 + Import it and load it with: 44 + ```typ 45 + // import the script from the local repo 46 + // if you have modified the repo name, replace `@local` with their name 47 + #import "@local/callout:1.0.0": * 48 + ``` 49 + 50 + You can use any callouts with 51 + ```typ 52 + #defn[ 53 + Let $f$ a function where: 54 + $ forall x in RR, f(x) = x^2 $ 55 + ] 56 + ```
+70
typst/callout/1.0.0/lib.typ
··· 1 + #let emptyblock((fontcolor, bgcolor), content) = { 2 + set par( 3 + leading: 0.75em, 4 + first-line-indent: 0em, 5 + spacing: 1.3em, 6 + ) 7 + set text(fill: fontcolor) 8 + block( 9 + width: 100%, 10 + inset: 1.5em, 11 + radius: 0.5em, 12 + breakable: false, 13 + fill: bgcolor, 14 + content 15 + ) 16 + } 17 + 18 + #let callout(icon, title, title_content, colors, content) = { 19 + emptyblock(colors)[ 20 + #text(size: 1.25em)[#icon~ #strong(title)] 21 + 22 + #content 23 + ] 24 + } 25 + 26 + #let warning(body) = { 27 + callout( 28 + emoji.warning, 29 + "Attention", 30 + title, 31 + (oklch(25%, 35%, 52.55deg), oklch(68.9%, 44%, 52.55deg, 15%)), 32 + body, 33 + ) 34 + } 35 + 36 + #let solution(body) = { 37 + callout(emoji.checkmark.box, "Solution", 38 + (rgb("#2AA63D"), rgb("#DBFCE7"), rgb("#7AF0A8")), 39 + body) 40 + } 41 + 42 + #let defn(body) = { 43 + callout( 44 + $Delta$, 45 + "Définition", 46 + title, 47 + (oklch(20%, 20%, 247deg), oklch(75%, 25%, 247deg, 40%)), 48 + body, 49 + ) 50 + } 51 + 52 + #let props(body) = { 53 + callout( 54 + $Pi$, 55 + "Proposition", 56 + title, 57 + (oklch(20%, 20%, 247deg), oklch(85%, 10%, 247deg, 50%)), 58 + body, 59 + ) 60 + } 61 + 62 + #let thm(body) = { 63 + callout( 64 + $Tau$, 65 + "Théorème", 66 + title, 67 + (oklch(20%, 20%, 220deg), oklch(80%, 25%, 220deg, 40%)), 68 + body, 69 + ) 70 + }
+7
typst/callout/1.0.0/typst.toml
··· 1 + [package] 2 + name = "callout" 3 + version = "1.0.0" 4 + entrypoint = "lib.typ" 5 + authors = ["Anhgelus Morhtuuzh"] 6 + license = "MIT" 7 + description = "My callouts"
+5 -4
typst/template.typ typst/template/1.0.0/lib.typ
··· 1 1 #let doc(authors: (), page_title: [], doc) = { 2 + // style 2 3 set text( 3 4 font: "Inter", 4 5 size: 11pt, 5 6 ) 6 7 set par( 7 8 leading: 1em, 8 - first-line-indent: 1em, 9 + //first-line-indent: (amount: 1em, all: true), 9 10 spacing: 2em, 10 11 ) 11 12 set heading(numbering: "1.") ··· 16 17 // Retrieve the document 17 18 // element's title property. 18 19 context { 19 - emph([ 20 + emph[ 20 21 #document.title - #authors.first().name 21 - ]) 22 + ] 22 23 } 23 24 ), 24 25 numbering: "1", 25 - margin: (x: 2.85cm), 26 + margin: (x: 3.5cm), 26 27 ) 27 28 28 29 show heading: set par(leading: 0.75em)
+7
typst/template/1.0.0/typst.toml
··· 1 + [package] 2 + name = "template" 3 + version = "1.0.0" 4 + entrypoint = "lib.typ" 5 + authors = ["Anhgelus Morhtuuzh"] 6 + license = "MIT" 7 + description = "My custom template"