[Tex/LaTex] How to sort a glossary by order of appearance

glossariessorting

In the glossaries package, how can I make the glossary print the entries by order of appearance?

Some context: I'm using the glossaries package to generate a symbol index, and I'm interested to see whether the order in which I introduce the notation makes sense.

Best Answer

I suspect the package option sort=use will do what you're after, i.e. write \usepackage[sort=use]{glossaries}. From the manual:

sort

This is a ⟨key⟩=⟨value⟩ option where the option can only have one of the following values:

  • standard: entries are sorted according to the value of the sort key used in \newglossaryentry (if present) or the name key (if sort key is missing);
  • def: entries are sorted in the order in which they were defined (the sort key in \newglossaryentry is ignored);
  • use: entries are sorted according to the order in which they are used in the document (the sort key in \newglossaryentry is ignored).

The default is sort=standard.

Related Question