27

Based on the following answer, How shall I define plural form of glossaries?

Two separate acronym list using package glossaries

For example,

\newglossaryentry{LED}
{
  name={LED},
  description={light emitting diode},
  first={\glsentrydesc{LED} (\glsentrytext{LED})},
}

The first instance in plural form should print

light emitting diodes (LEDs).

Second instance of plural form should print

LEDs

3rd instance of singular form should print

LED

and so on ...

.

cosmicraga
  • 2,630
  • 1
    What about plural={LEDs}, in your newglossaryentry to be used as \glsp{LED}? Not tested but that is the normal way. Maybe you should have a look on acronym lists in the package: http://www.ctan.org/pkg/glossaries – LaRiFaRi Aug 15 '13 at 16:48

1 Answers1

43

The only way I know is to define the \newglossaryentry as:

\newglossaryentry{LED}
{
  name={LED},
  description={light emitting diode},
  first={\glsentrydesc{LED} (\glsentrytext{LED})},
  plural={LEDs},
  firstplural={\glsentrydesc{LED}s (\glsentryplural{LED})}
}

and then use \glspl{LED} when you want the plural form, \gls{LED} when you want the singular form.

EDIT

I've discovered the command \glsentrydescplural, which prints the contents of the descriptionplural field.

So the above can also be rewritten in a more consistent form as:

\newglossaryentry{LED}
{
  name={LED},
  description={light emitting diode},
  first={\glsentrydesc{LED} (\glsentrytext{LED})},
  plural={LEDs},
  descriptionplural={light emitting diodes},
  firstplural={\glsentrydescplural{LED} (\glsentryplural{LED})}
} 
karlkoeller
  • 124,410