From c63864159a339c774ec805789b57942a85e72ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Fri, 10 Oct 2025 20:17:55 +0200 Subject: [PATCH] make abbreviations clickable --- template/abbreviations.typ | 5 +++-- template/classic/common.typ | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/template/abbreviations.typ b/template/abbreviations.typ index 96e714f..4058164 100644 --- a/template/abbreviations.typ +++ b/template/abbreviations.typ @@ -18,10 +18,11 @@ } "(" + abbrs.pairs().map((v) => { v.at(0) + ":\"" + v.at(1) + "\"" }).join(",") + ")" }); + let target_label = label("abbr_" + abbreviation); if type(text) != type(none) { - text + " (" + abbreviation + ")"; + link(target_label, text + " (" + abbreviation + ")"); } else { - abbreviation; + link(target_label, abbreviation) } } diff --git a/template/classic/common.typ b/template/classic/common.typ index f58dc5b..5a90288 100644 --- a/template/classic/common.typ +++ b/template/classic/common.typ @@ -400,7 +400,12 @@ gutter: 1em, ..abbrs.pairs().map((a) => { ( - align(left, block(text(a.at(0), weight: "bold"), width: max_abbr_width + 1em)), + align(left, { + [ + #block(text(a.at(0), weight: "bold"), width: max_abbr_width + 1em) + #label("abbr_" + a.at(0)) + ] + }), text(a.at(1)) ) }).flatten()