Compare commits
No commits in common. "7e08008ffa1b820d5e396589f4bc1f0064979f1d" and "4e46b5efcc7c3b9472a4c4e6b2b15e28bae48993" have entirely different histories.
7e08008ffa
...
4e46b5efcc
@ -179,21 +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\",
|
|
||||||
label-suppliment: [Example]
|
|
||||||
)
|
|
||||||
|
|
||||||
As we have seen in @sorcerers, […].", addl-bindings: (neg: neg, sg: sg, pl: pl))
|
|
||||||
|
|
||||||
== Styling lines of a gloss
|
== Styling lines of a gloss
|
||||||
|
|
||||||
|
@ -34,10 +34,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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(
|
#let gloss(
|
||||||
header: none,
|
header: none,
|
||||||
@ -51,8 +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,
|
|
||||||
label-suppliment: [example],
|
|
||||||
|
|
||||||
item-spacing: 1em,
|
item-spacing: 1em,
|
||||||
gloss-padding: 2.0em, //TODO document these
|
gloss-padding: 2.0em, //TODO document these
|
||||||
@ -127,18 +121,13 @@
|
|||||||
|
|
||||||
style(styles => {
|
style(styles => {
|
||||||
block(breakable: breakable)[
|
block(breakable: breakable)[
|
||||||
#figure(
|
#stack(
|
||||||
kind: "ling-example",
|
|
||||||
supplement: label-suppliment,
|
|
||||||
numbering: it => [#gloss-count.display()],
|
|
||||||
stack(
|
|
||||||
dir:ltr, //TODO this needs to be more flexible
|
dir:ltr, //TODO this needs to be more flexible
|
||||||
left_padding,
|
left_padding,
|
||||||
[#gloss_number],
|
[#gloss_number],
|
||||||
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
||||||
align(left)[#gloss_items],
|
[#gloss_items]
|
||||||
),
|
)
|
||||||
) #if label != none {cmdlabel(label)}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user