Plural acronyms #30
Unanswered
dylanirion
asked this question in
Q&A
Replies: 1 comment
-
Hi,
Thanks for the appreciation!
This feature has been on my todo-list for quite some time...
Short answer: currently, no, there is no elegant way to pluralize acronyms.
The problem is that you will want to pluralize only some acronyms, not all of them; a style function was supposed to be used by all acronyms in a document. So we need to know for which occurrence we should pluralize, that is, to add some parameter.
The legacy markup `\acr{KEY}` uses a custom parsing, which is really not robust.
I was hoping that the new, Quarto-powered, shortcode markup `{{< acr KEY >}}` would allow me to add several new features that depend on parameters. They do simplify the parsing (for example, `{{< acr KEY pluralize >}}` is trivial to handle), but I cannot control when they are executed, which messes up the list of acronyms generation.
Until Quarto solves this on their end, I think I'll just have to update my parser to have something like `\acr{KEY}{pluralize}`.
Oct 16, 2024 10:05:52 Dylan Irion ***@***.***>:
…
Thank you for a great addition to the quarto ecosystem!
I think a useful addition might be to allow "pluralizing" acronyms, unless it's already possible and I've missed it?
Is there a more elegant solution than something like below?
*styles["long-short-plural"] = function(acronym, insert_links, is_first_use)
local text
if is_first_use then
text = acronym.longname .. (string.sub(acronym.longname, -1) == "s" and "es" or "s" ) .. " (" .. acronym.shortname .. "s" .. ")"
else
text = acronym.shortname .. (string.sub(acronym.longname, -1) == "s" and "es" or "s" )
end
return create_element(text, acronym.key, insert_links)
end
*
Happy to submit a PR if you think this is worthwhile!
—
Reply to this email directly, view it on GitHub[#30], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AGZR5IIHOKMJCJEEPKR5NMLZ3YM6BAVCNFSM6AAAAABQA3GIGCVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGMZDKMZYHA].
You are receiving this because you are subscribed to this thread.
[Tracking image][https://github.com/notifications/beacon/AGZR5IOEMSIMXHV5G326FE3Z3YM6BA5CNFSM6AAAAABQA3GIGCWGG33NNVSW45C7OR4XAZNKIRUXGY3VONZWS33OVJRW63LNMVXHIX3JMTHAA36GZQ.gif]
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for a great addition to the quarto ecosystem!
I think a useful addition might be to allow "pluralizing" acronyms, unless it's already possible and I've missed it?
Is there a more elegant solution than something like below?
Happy to submit a PR if you think this is worthwhile!
Beta Was this translation helpful? Give feedback.
All reactions