Grisely / packages

Packages for Typst.
Apache License 2.0
3 stars 4 forks source link

feat: new version that supports printing the full version of an acronym #4

Closed daniel-eder closed 1 month ago

daniel-eder commented 3 months ago

I added a function (and its plural version) to display the expanded / full form of an acronym, without messing with state.

Sometimes the expanded use of an acronym is useful to avoid constant repetition of the short form, in which case an explanation (expanded form + short form) is not needed.

#reset-acronym(...) almost allows this behaviour, but a) appends the short form as explanation and b) is less convenient as it requires two statements.

As such I would appreciate if the PR was accepted, as I currently use a modified version locally.

I am not sure about best practices, but I already placed it in a new version folder, so the changes to the file are a bit hard to trace. The concrete changes are:

#let acrfull(acr) = {
  //Intentionally display an acronym in its full form. Does not expand it and does not update state.
  [#display-def(plural: false, acr)]
}

#let acrfullpl(acr) = {
  //Intentionally display an acronym in its full form in plural. Does not expand it and does not update state.
  [#display-def(plural: true, acr)]
}
Grisely commented 1 month ago

Thanks for the PR. Sorry for the wait, I rarely come on GitHub. I will take a look as soon as possible.