I would like my glossaries
entries to be sorted by alphabetical order, and, if some entries have identical sort keys, by the order they are called in the text. Any way to do this ?
Here is the MWE, with the two entries div
and commut
exhibiting identical sort keys.
\documentclass[]{article}
\usepackage[
nogroupskip,
% xindy,
]{glossaries}
% I compile with xindy, but I do not think it is relevant here.
% xindy -L english -C utf8 -I xindy -M % -t %.glg -o %.gls %.glo
\newglossaryentry{div}
{ name={\ensuremath{\protect\vec{\nabla}.}},
description={Divergence operator},
sort={0}
}
\newglossaryentry{commut}
{ name={\ensuremath{\protect[~,~]}},
description={Commutator},
sort={0}
}
\newglossaryentry{b0}
{ name={\ensuremath{\protect\vec{B}_0}},
description={Static magnetic field},
sort={B0}
}
\makeglossaries
\begin{document}
Text.\gls{div} \gls{commut} \gls{b0}
\printglossaries
\end{document}
Here, for example, the commutator do not appear in the glossary. I would like to have it appearing after the divergence operator despite their identical sorting keys.