Compare commits
3 Commits
v0.2.0
...
references
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e08008ffa | ||
|
|
7774532264 | ||
|
|
4e46b5efcc |
@@ -4,10 +4,12 @@
|
||||
creating interlinear morpheme-by-morpheme glosses according to the [Leipzig
|
||||
glossing rules](https://www.eva.mpg.de/lingua/pdf/Glossing-Rules.pdf).
|
||||
|
||||
Run `typst compile leipzig-gloss-examples.typ` in the root of the repository to
|
||||
# Documentation
|
||||
|
||||
Run `typst compile documentation.typ` in the root of the repository to
|
||||
generate a pdf file with examples and documentation. This command is also
|
||||
codified in the accompanying [justfile](https://github.com/casey/just) as `just
|
||||
build-example`.
|
||||
build-doc`.
|
||||
|
||||
The definitions intended for use by end users are the `gloss` and
|
||||
`numbered-gloss` functions, and the `abbreviations` submodule.
|
||||
|
||||
@@ -179,6 +179,21 @@ standard Typst counter functions to control gloss numbering:
|
||||
translation: [There always is in us a will for a great happiness.],
|
||||
)", 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
|
||||
|
||||
|
||||
@@ -34,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,
|
||||
@@ -47,6 +51,8 @@
|
||||
additional-lines: (), //List of list of content
|
||||
translation: none,
|
||||
translation-style: none,
|
||||
label: none,
|
||||
label-suppliment: [example],
|
||||
|
||||
item-spacing: 1em,
|
||||
gloss-padding: 2.0em, //TODO document these
|
||||
@@ -121,13 +127,18 @@
|
||||
|
||||
style(styles => {
|
||||
block(breakable: breakable)[
|
||||
#stack(
|
||||
dir:ltr, //TODO this needs to be more flexible
|
||||
left_padding,
|
||||
[#gloss_number],
|
||||
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
||||
[#gloss_items]
|
||||
)
|
||||
#figure(
|
||||
kind: "ling-example",
|
||||
supplement: label-suppliment,
|
||||
numbering: it => [#gloss-count.display()],
|
||||
stack(
|
||||
dir: ltr, //TODO this needs to be more flexible
|
||||
left_padding,
|
||||
[#gloss_number],
|
||||
gloss-padding - left_padding - measure([#gloss_number],styles).width,
|
||||
align(left)[#gloss_items],
|
||||
),
|
||||
) #if label != none {cmdlabel(label)}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user