#let _glossaryDict = state("e8759020-8d68-4920-9ce6-246b09c3094b", none) #let setDefaults(defaults) = { _glossaryDict.update(dict => { for (term, explanation) in defaults.pairs() { dict.insert(term, explanation) } return dict }) } #let term(term, explanation) = { _glossaryDict.update(dict => { if dict == none { return ( "" + term: explanation, ) } dict.insert(term, explanation) return dict }) term } #let glossary() = { context { if _glossaryDict.get() == none { return } [ = Glossar] terms(tight: true) figure( table( columns: (1fr, 3fr), table.header([Begriff], [Bedeutung]), .._glossaryDict .get() .keys() .sorted(key: lower) .map(key => ( key, _glossaryDict.get().at(key), )) .flatten(), ), caption: [Glossar], ) } }