diff --git a/documentation.typ b/documentation.typ index 39fb0c3..9c2ad42 100644 --- a/documentation.typ +++ b/documentation.typ @@ -187,9 +187,10 @@ References to individual examples can be achieved using the `label` argument and #numbered-gloss( header: [Middle Welsh; modified from _Grammatical number in Welsh_ (1999) by Silva Nurmio (§~2.1.1)], source: ([ac], [ny], [allvs], [y], [dewinyon], [atteb], [idav]), - morphemes: ([and], [#neg], [be_able.#smallcaps[pret].3#sg], [#smallcaps[def]], [sorcerer.#pl], [answer.#smallcaps[inf]], [to.3#sg.#smallcaps[m]]), + morphemes: ([and], [#neg], [be_able.#smallcaps[pret].3#sg], [#smallcaps[def]], [sorcerer.#pl], [answer.#smallcaps[inf]], [to.3#sg.#smallcaps[m]]), translation: [and the sorcerers could not answer him], - label: \"sorcerers\", + label: \"sorcerers\", + label-suppliment: [Example] ) As we have seen in @sorcerers, […].", addl-bindings: (neg: neg, sg: sg, pl: pl)) diff --git a/leipzig-gloss.typ b/leipzig-gloss.typ index 38dc50a..d0b5895 100644 --- a/leipzig-gloss.typ +++ b/leipzig-gloss.typ @@ -1,7 +1,6 @@ #import "abbreviations.typ" #let gloss-count = counter("gloss_count") -#let cmdlabel = label // a workround so we can use `label` as a variable name #let build_gloss(item-spacing, formatters, gloss_line_lists) = { assert(gloss_line_lists.len() > 0, message: "Gloss line lists cannot be empty") @@ -35,6 +34,10 @@ } } +// a workround so we can use `label` as a variable name where it is shadowed by the function param `label` +// Once typst version 0.12 with https://github.com/typst/typst/pull/4038 is released we should be able +// to replace this workaround with `std.label` +#let cmdlabel = label #let gloss( header: none, @@ -49,6 +52,7 @@ translation: none, translation-style: none, label: none, + label-suppliment: [example], item-spacing: 1em, gloss-padding: 2.0em, //TODO document these @@ -124,8 +128,8 @@ style(styles => { block(breakable: breakable)[ #figure( - kind: "lingexample", - supplement: [Example], + kind: "ling-example", + supplement: label-suppliment, numbering: it => [#gloss-count.display()], stack( dir: ltr, //TODO this needs to be more flexible