Playing around with how a used abbreviations table might work

This commit is contained in:
Greg Shuflin 2023-07-05 21:12:52 -07:00
parent e61a58fac0
commit e837580f68
3 changed files with 112 additions and 7 deletions

View File

@ -0,0 +1,16 @@
#import "linguistic-abbreviations.typ": *
= A linguistics paper
== Abbreviations used in this document
#print_usage_chart
== The meat of the paper
The #p1 pronoun in English is "I".
The #p1 pronoun in Spanish is "yo"
The #p2 pronoun in Spanish is "tu"
The #ABL case exists in Latin.

View File

@ -4,3 +4,7 @@ default:
build-example: build-example:
typst compile leipzig-gloss-examples.typ typst compile leipzig-gloss-examples.typ
build-abbreviations-example:
typst compile abbreviations-used-example.typ

View File

@ -1,13 +1,98 @@
// See https://www.eva.mpg.de/lingua/resources/glossing-rules.php
#let standard_abbreviations = (
"1": "first person",
"2": "second person",
"3": "third person",
"A": "agent-like argument of canonical transitive verb",
"ABL": "ablative",
"ABS": "absolutive",
)
#let used_fields = (
"1": false,
"2": false,
"3": false,
"A": false,
"ABL": false,
"ABS": false,
)
#let used_abbreviations = state("used-abbreviations", used_fields)
#let print_usage_chart = {
locate(loc => {
let final_used_abbreviations = used_abbreviations.final(loc)
for (key, value) in final_used_abbreviations {
[#key was used: #value]
linebreak()
}
linebreak()
for (key, value) in final_used_abbreviations {
if value {
let desc = standard_abbreviations.at(key)
[#smallcaps(lower(key)) #h(2em) #desc]
linebreak()
}
}
})
}
#let fmnt = smallcaps([fmnt]) #let fmnt = smallcaps([fmnt])
/* //Appendix: List of Standard Abbreviations
Appendix: List of Standard Abbreviations
1 first person #let p1 = {
2 second person used_abbreviations.update(cur => {
3 third person cur.at("1") = true
A agent-like argument of canonical transitive verb cur
})
smallcaps[1]
}
#let p2 = {
used_abbreviations.update(cur => {
cur.at("2") = true
cur
})
smallcaps[2]
}
#let p3 = {
used_abbreviations.update(cur => {
cur.at("3") = true
cur
})
smallcaps[3]
}
#let A = {
used_abbreviations.update(cur => {
cur.at("A") = true
cur
})
smallcaps[A]
}
#let ABL = {
used_abbreviations.update(cur => {
cur.at("ABL") = true
cur
})
smallcaps[abl]
}
#let ABS = {
used_abbreviations.update(cur => {
cur.at("ABS") = true
cur
})
smallcaps[ABS]
}
/*
ABL ablative ABL ablative
ABS absolutive ABS absolutive
ACC accusative ACC accusative
@ -21,7 +106,7 @@ ART article
AUX auxiliary AUX auxiliary
BEN benefactive BEN benefactive
*/ */
#let A = smallcaps([a])
#let all = smallcaps([all]) #let all = smallcaps([all])
#let art = smallcaps([art]) #let art = smallcaps([art])