Compare commits
No commits in common. "393603ae2d2e673ca95ebca0413a803f9cf71b30" and "3882f4e791f6b5a6e3088ca0a415e7695160fe3a" have entirely different histories.
393603ae2d
...
3882f4e791
@ -179,20 +179,6 @@ standard Typst counter functions to control gloss numbering:
|
|||||||
translation: [There always is in us a will for a great happiness.],
|
translation: [There always is in us a will for a great happiness.],
|
||||||
)", addl-bindings: (gloss-count: gloss-count))
|
)", addl-bindings: (gloss-count: gloss-count))
|
||||||
|
|
||||||
References to individual examples can be achieved using the `label` argument and the referencing mechanism of Typst:
|
|
||||||
|
|
||||||
#codeblock(
|
|
||||||
"See @sorcerers:
|
|
||||||
|
|
||||||
#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]]),
|
|
||||||
translation: [and the sorcerers could not answer him],
|
|
||||||
label: \"sorcerers\",
|
|
||||||
)
|
|
||||||
|
|
||||||
As we have seen in @sorcerers, […].", addl-bindings: (neg: neg, sg: sg, pl: pl))
|
|
||||||
|
|
||||||
== Styling lines of a gloss
|
== Styling lines of a gloss
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#import "abbreviations.typ"
|
#import "abbreviations.typ"
|
||||||
|
|
||||||
#let gloss-count = counter("gloss_count")
|
#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) = {
|
#let build_gloss(item-spacing, formatters, gloss_line_lists) = {
|
||||||
assert(gloss_line_lists.len() > 0, message: "Gloss line lists cannot be empty")
|
assert(gloss_line_lists.len() > 0, message: "Gloss line lists cannot be empty")
|
||||||
@ -48,7 +47,6 @@
|
|||||||
additional-lines: (), //List of list of content
|
additional-lines: (), //List of list of content
|
||||||
translation: none,
|
translation: none,
|
||||||
translation-style: none,
|
translation-style: none,
|
||||||
label: none,
|
|
||||||
|
|
||||||
item-spacing: 1em,
|
item-spacing: 1em,
|
||||||
gloss-padding: 2.0em, //TODO document these
|
gloss-padding: 2.0em, //TODO document these
|
||||||
@ -123,18 +121,13 @@
|
|||||||
|
|
||||||
style(styles => {
|
style(styles => {
|
||||||
block(breakable: breakable)[
|
block(breakable: breakable)[
|
||||||
#figure(
|
#stack(
|
||||||
kind: "lingexample",
|
dir:ltr, //TODO this needs to be more flexible
|
||||||
supplement: [Example],
|
left_padding,
|
||||||
numbering: it => [#gloss-count.display()],
|
[#gloss_number],
|
||||||
stack(
|
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
||||||
dir: ltr, //TODO this needs to be more flexible
|
[#gloss_items]
|
||||||
left_padding,
|
)
|
||||||
[#gloss_number],
|
|
||||||
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
|
||||||
align(left)[#gloss_items],
|
|
||||||
),
|
|
||||||
) #if label != none {cmdlabel(label)}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user