typst-community / glossarium

Glossarium is a simple typst glossary.
MIT License
42 stars 11 forks source link

Commands for capitalizing first letter #48

Open vmichals opened 4 months ago

vmichals commented 4 months ago

Thank you for this cool package.

I have a feature request: The latex glossaries package has the commands \Gls and \Glspl that capitalize the first letter, which is very useful if an entry is used at the beginning of a sentence. Would it be possible to add corresponding functions in glossarium?

I tried to write a function that calls gls() and modifies the first letter, but couldn't figure out how to access the string in the returned content object. AFAIK, Typst doesn't offer a built-in function like upper() that only capitalizes the first letter.

slashformotion commented 3 months ago

I tried adding the "title" method to strings to implement this exact behavior (see https://github.com/typst/typst/pull/1809).

I will look at this a second time and try to get it merged.