Glossarium: How to print capitalized glossary entries?

Hi everyone,

I am currently using glossary for a project of mine. The capitalization via the @key syntax works really well. The issue is printing the glossary list.

Suppose I’ve got an entry like this:

  (
    key: "sandbox",
    short: "sandbox",
    plural: "sandboxes",
    description: "....",
  ),

Now using it via @sandbox and @Sandbox works, but the glossary list prints it in lowercase (same as “short”). If i defined a captialized Sandbox, the @ syntax for lower and uppercase breaks.

Now I tried to use a custom user-print-title function and that works for capitalizing the entries, BUT some of my entries are names such as “gVisor” here I do NOT want to capitalize it. What are my options here? I do not know if I am missing something, because it does not seem like anyone else had this problem. I think the option to maybe define a display property with the entry would be great.

Best,
Paul

Hi @Paul1, happy to help you with glossarium (I am the maintainer). If you can provide an example that reproduces the issue it would be helpful.

As it is without seeing your custom user-print-title function, all I can recommend is the following.

#let default-print-title(entry) = {
  let second-letter = entry.at("short").at(2)
  if second-letter != upper(second-letter) { // 
    ... // do stuff
  }
}

If there is no generic rule you can apply, then I would recommend using the custom attribute to hold a true/false value (or a dictionary) so that you can check that value in your custom function.

This attribute was introduced in glossarium@0.5.7 by @ToppDev. See for example

#let entry-list = (
  (
    key: "c",
    short: $c$,
    description: "Speed of light in vacuum",
    custom: (unit: "m s^-1", other: 1),
  ),
)
#register-glossary(entry-list)
#show: make-glossary

- gls-custom: #context gls-custom("c", ctx: false)
- member access: #context gls-custom("c", ctx: false).unit
1 Like