mirror of
https://github.com/C0ffeeCode/typst-dhbw-technik-template.git
synced 2025-12-28 13:22:20 +01:00
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:
parent
9b6fe813df
commit
79aa5a4ed9
1 changed files with 6 additions and 5 deletions
11
template.typ
11
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)]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue