From e837580f689af210342998f568bce30b376e8364 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 5 Jul 2023 21:12:52 -0700 Subject: [PATCH] Playing around with how a used abbreviations table might work --- abbreviations-used-example.typ | 16 ++++++ justfile | 4 ++ linguistic-abbreviations.typ | 99 +++++++++++++++++++++++++++++++--- 3 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 abbreviations-used-example.typ diff --git a/abbreviations-used-example.typ b/abbreviations-used-example.typ new file mode 100644 index 0000000..cf09bba --- /dev/null +++ b/abbreviations-used-example.typ @@ -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. diff --git a/justfile b/justfile index 8655db5..f10a8e7 100644 --- a/justfile +++ b/justfile @@ -4,3 +4,7 @@ default: build-example: typst compile leipzig-gloss-examples.typ + + +build-abbreviations-example: + typst compile abbreviations-used-example.typ diff --git a/linguistic-abbreviations.typ b/linguistic-abbreviations.typ index 5c4e370..c5f8609 100644 --- a/linguistic-abbreviations.typ +++ b/linguistic-abbreviations.typ @@ -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]) -/* -Appendix: List of Standard Abbreviations +//Appendix: List of Standard Abbreviations -1 first person -2 second person -3 third person -A agent-like argument of canonical transitive verb +#let p1 = { + used_abbreviations.update(cur => { + cur.at("1") = true + 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 ABS absolutive ACC accusative @@ -21,7 +106,7 @@ ART article AUX auxiliary BEN benefactive */ -#let A = smallcaps([a]) + #let all = smallcaps([all]) #let art = smallcaps([art])