1

Preamble: Because this question is rather specific, I'd rather comment on either of the partial solutions I found so far. Unfortunately the reputation-limit keeps me from doing so, so here we go...

I am creating separate entries in both the glossary and the abbreviations with a single new command (by jules-randolph, original solution).

\newcommand*{\newdualentry}[5][]{%
  \newglossaryentry{main-#2}{name={#4},%
  text={#3\glsadd{#2}},%
  description={{#5}},%
  #1
  }%
  \newglossaryentry{#2}{
  type=\acronymtype,
  first={#4 (#3)},
  name={#3\glsadd{main-#2}},
  description={\glslink{main-#2}{#4}}
  }%
}

For reference, the call's signature is \newdualentry[⟨options⟩]{⟨label⟩}{⟨abbrv⟩}{⟨long⟩}{⟨description⟩}

Now I would like to Title Case the glossary entry's name as well as the acronym's description while keeping the text lowercase (unless defined otherwise).

Simply switching to glossaries-extra and adding a few configuration lines as in Nicola Talbot's solution did not do the trick.

Any ideas? Also, an opt-in (or opt-out) of Title Casing within the glossary/acronyms could be very useful.


Example: \newdualentry{lcit}{LCIT}{lower case in text}{description}

Currently, the following entries are created:

Glossary: lower case in text description

Acronym: LCIT lower case in text

Expected future behavior:

Glossary: Lower Case In Text description

Acronym: LCIT Lower Case In Text

2
  • I don't work with gloassaries, but regarding title case, could something from the titlecaps package help? See ctan.org/pkg/titlecaps Commented Apr 16, 2020 at 16:50
  • Thanks for your suggestion @steven. I tried using \titlecap and \capitalisewords in the new command for the acronym description and the glossary name (basically the occasions of {#4}). So far I didn't get it to work (and instead got different errors). One of the issues is that I'm not familiar with LaTeX macros at all, so it's a lot of try and error.
    – m3ph
    Commented Apr 17, 2020 at 10:23

2 Answers 2

1

I managed to solve the problem with just a minor modification to the code. In fact, I only added another parameter {#6} to the call which sets the text attribute of the entry. Now the name and the text attribute can have different content and it is therefore possible to capitalize the first letter of the name while the text can be all lowercase.

The call's signature has changed to \newdualentry[⟨options⟩]{⟨label⟩}{⟨abbrv⟩}{⟨long⟩}{⟨description⟩}{⟨text⟩}

The modified code:

\newcommand*{\newdualentry}[6][]{%
    \newglossaryentry{main-#2}{name={#4},%
        text={#6\glsadd{#2}},%
        description={{#5}},%
        #1
    }%
    \newglossaryentry{#2}{
        type=\acronymtype,
        first={#4 (#3)},
        firstplural={#4s (#3s)},
        name={#3\glsadd{main-#2}},
        description={\glslink{main-#2}{#6}}
    }%
}
0

I did something similar with a slight modification:

the parameters are: %\newdualentry[⟨options⟩]{⟨label⟩}{⟨abbrv⟩}{⟨name⟩}{⟨first⟩}{⟨description⟩} Notice the counting starts at the options:

  • #2 - Label
  • #3 - abbrv
  • #4 - name (aka what is shown in the glossary)
  • #5 - first or what is shown in the text
  • #6 - is the description
  {\newcommand*{\newdualentry}[6][]{%
  \newglossaryentry{main-#2}{name={#4} ({#3}),%
  text={#3\glsadd{#2}},%
  description={{#6}},%
  #1
  }%
  \newglossaryentry{#2}{
  type=\acronymtype,
  first={#5},
  name={#3\glsadd{main-#2}},
  description={\glslink{main-#2}{#4}}
  }%
}}

The difference being I wanted the acronym to show up in the glossary name in ().

Warning - for me the sort order on the glossary terms gets messed up with dual entry. I have some terms that are defined under \newglossaryentry and some under my dual entry type but the sort on glossary keeps them separated; acronym list sorts correctly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .