From 79aa5a4ed99ef16965363d481775e94d17a19712 Mon Sep 17 00:00:00 2001 From: C0ffeeCode Date: Mon, 25 Mar 2024 09:32:38 +0100 Subject: [PATCH] change: Acronym `pref` must be String: can be: - `normal` to show long (short) on first usage, - `short` to force short to be written first, or - `long` to force the long version to be shown (first) --- template.typ | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/template.typ b/template.typ index 5b8ac1d..ffb3aec 100755 --- a/template.typ +++ b/template.typ @@ -528,7 +528,8 @@ ] // `pref` if to prefer the long form -#let acro(short, pref: false, append: "") = { +// may be normal, short or long +#let acro(short, pref: "normal", append: "") = { let item = acronyms.at(short) locate(loc => { @@ -536,7 +537,7 @@ // Already used once if entries.len() > 0 { - if pref { + if pref == "long" { link(label(short))[#item#append] } else { link(label(short))[#short#append] @@ -544,10 +545,10 @@ // First usage } else { acroStates.update(e => {e.push(short); e;}); - if pref { - link(label(short))[#item#append (#short)] - } else { + if pref == "short" { link(label(short))[#short#append (#item)] + } else { + link(label(short))[#item#append (#short)] } } });