You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need more control over when the first entry is printed.
For example, you use an acronym in a figure in short form, but still want the next appearance to be the long form. The Latex package solves this by providing a macro. I think something similar to that by adding another optional argument ignore-use could be useful.
I think an option for make-glossary to make the long form print for the first appearance optional would be great, too.
And last, I think options should be provided to filter acronyms that are used only a single time. I'm not sure on the details of this one yet though.
I can try to implement these myself, but I first wanted to hear your thoughts.
The text was updated successfully, but these errors were encountered:
For example, you use an acronym in a figure in short form, but still want the next appearance to be the long form.
if you want to force the short-form you should be able to use
#gls(key, long: false) // short+suffix
I think an option for make-glossary to make the long form print for the first appearance optional would be great, too.
I actually have a working version of this in my fork, but I haven't had the time to discuss this (I'll create an issue).
And last, I think options should be provided to filter acronyms that are used only a single time.
If by that, you mean counting the back-references to each acronym, then it is already possible using the internal API. Something like this maybe:
#import"@preview/glossarium:0.4.0": count-refs, __glossary_entries#context {
// All entries counts
let entries = __glossary_entries.get()
for (key, e) in entries {
str(e.key) + " " + str(count-refs(e))
linebreak()
}
linebreak()
// Single-use
let single_use_entries = entries.values().filter(e => count-refs(e) == 1)
for e in single_use_entries {
str(e.key) + " " + str(count-refs(e))
linebreak()
}
}
If you have time, I think @slashformotion wouldn't refuse any contribution to the documentation or the user API!
quachpas
changed the title
More control over single usage and first print in long form
options to filter acronyms that are used only a single time
Oct 1, 2024
Sometimes you need more control over when the first entry is printed.
For example, you use an acronym in a figure in short form, but still want the next appearance to be the long form. The Latex package solves this by providing a macro. I think something similar to that by adding another optional argument
ignore-use
could be useful.I think an option for make-glossary to make the long form print for the first appearance optional would be great, too.
And last, I think options should be provided to filter acronyms that are used only a single time. I'm not sure on the details of this one yet though.
I can try to implement these myself, but I first wanted to hear your thoughts.
The text was updated successfully, but these errors were encountered: