From 68983e30b177228a74a5ad03d08befa02c302761 Mon Sep 17 00:00:00 2001 From: Meik Hellmund Date: Mon, 2 Mar 2026 14:41:05 +0100 Subject: [PATCH] typst macros added --- macros.typ | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 macros.typ diff --git a/macros.typ b/macros.typ new file mode 100644 index 0000000..54b160c --- /dev/null +++ b/macros.typ @@ -0,0 +1,23 @@ +#let Skylighting(fill: none, number: false, start: 1, sourcelines) = { + let blocks = [] + let lnum = start - 1 + let bgcolor = rgb("#f1f3f5") + for ln in sourcelines { + if number { + lnum = lnum + 1 + blocks = blocks + box(width: if start + sourcelines.len() > 999 { 30pt } else { 24pt }, text(fill: rgb("#aaaaaa"), [ #lnum ])) + } + blocks = blocks + ln + EndLine() + } + block(fill: bgcolor, width:100%, inset:(x:5pt, y:8pt), stroke:( left: 2pt + green), below:0pt, blocks) +} + + +#set math.mat(delim: "[") + +// now in index.qmd +//#set math.equation(numbering: none) +// not enough +//#let equation-numbering = it => { +// numbering(none, it) +//} \ No newline at end of file