From 184c03b204e8e7d77e8651fa7b391c88d5195a3b Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Mon, 1 Sep 2025 10:28:09 +0200 Subject: [PATCH] add code line number --- lib/matisse-thesis.typ | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/matisse-thesis.typ b/lib/matisse-thesis.typ index 2590eb2..555fde6 100644 --- a/lib/matisse-thesis.typ +++ b/lib/matisse-thesis.typ @@ -179,7 +179,19 @@ // ---------- LISTING ---------- show raw.where(block: true): it => { - block(radius: 1em, fill: luma(240), inset: 1em, width: 80%, { + // Line number, not verry good (cannot copy code whitout line number) + // see https://github.com/typst/typst/issues/344 + show raw.line: line => { + if line.number < 10 { + text(fill: gray)[~#line.number] + } else { + text(fill: gray)[#line.number] + } + h(1em) + line.body + } + + block(radius: 1em, fill: luma(240), inset: 1em, width: 90%, { set align(left) it })