add definition to first abbreviation instance

This commit is contained in:
2025-09-23 22:36:31 +02:00
parent 89ab7ef100
commit 5e7007abd7
2 changed files with 10 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#import "template/template.typ": * #import "template/template.typ": *
#show: tultemplate.with( #show: tultemplate.with(
"classic", "fm", "en", "classic", "fm", "cs",
title: "Návod na použití Typst TUL šablony", title: "Návod na použití Typst TUL šablony",
author: "Ondřej Mekina", author: "Ondřej Mekina",
) )

View File

@@ -11,11 +11,19 @@
); );
} }
abbrs.insert(abbreviation, text); abbrs.insert(abbreviation, text);
} else {
if type(text) != type(none) {
panic("redefinition of abbreviation '" + abbreviation + "'");
}
} }
"(" + abbrs.pairs().map((v) => { v.at(0) + ":\"" + v.at(1) + "\"" }).join(",") + ")" "(" + abbrs.pairs().map((v) => { v.at(0) + ":\"" + v.at(1) + "\"" }).join(",") + ")"
}); });
if type(text) != type(none) {
text + " (" + abbreviation + ")";
} else {
abbreviation; abbreviation;
} }
}
#let abbrlist() = { #let abbrlist() = {
let abbreviations = abbreviations.final(); let abbreviations = abbreviations.final();