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)
This commit is contained in:
Laurenz 2024-03-25 09:32:38 +01:00
parent 9b6fe813df
commit 79aa5a4ed9
No known key found for this signature in database
GPG key ID: E3D5C22DBA1A8C36

View file

@ -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)]
}
}
});