# Bug Tracker

ID: 138 🔗 Closed (Not a Bug) glossaries-extra 1.41 Md Ayquassar 2019-11-05 18:27:06 Superfluous comma printed

## Report

Discussion: LaTeX Community Forum.

Let us save the source

\documentclass{book}
\usepackage[makeindex,nomain]{glossaries-extra}
\setglossarystyle{long3col}
\newcommand{\binding}[2]{#1\nolinebreak{\mapsto}\nolinebreak#2}
\newcommand{\finiteMap}[1]{\mathopen{\glsuseri{not:finiteMap}}#1\mathclose{\glsuserii{not:finiteMap}}}%%% Finite map, e.g., ⦃ x1↦a1, ... xn↦an ⦄.
\newglossary[nlg]{notation}{not}{ntn}{List of symbols}
\makeglossaries
\newglossaryentry{not:finiteMap}{type=notation, name={$$\{|\dotso|\}$$}, text={\{|\dotso|\}}, sort={finiteMap}, description={A finite map: $$\{| \binding{c_1}{s_1},\,\dotsc,\,\binding{c_n}{s_n}|\}$$ is a function that maps $$c_i$$ to $$s_i$$ for each $$i$$.},user1={\{|},user2={|\}}}
\begin{document}
$$\finiteMap{\binding{x}{a}}$$
\backmatter
\printglossaries
\end{document}

in mwe.tex and then run
pdflatex mwe & makeindex -s mwe.ist -t mwe.nlg -o mwe.not mwe.ntn

in a loop until no changes occur. Observe the needless comma in the list of symbols of the resulting PDF after the page number: "1,".

I expect that the last item does not have a comma after it. The bug occurs using the most recent versions (glossaries v4.43, glossaries-extra v1.41). Any bugfix? Thanks in advance.

### MWE

\documentclass{book}
\usepackage[makeindex,nomain]{glossaries-extra}
\setglossarystyle{long3col}
\newcommand{\binding}[2]{#1\nolinebreak{\mapsto}\nolinebreak#2}
\newcommand{\finiteMap}[1]{\mathopen{\glsuseri{not:finiteMap}}#1\mathclose{\glsuserii{not:finiteMap}}}%%% Finite map, e.g., ⦃ x1↦a1, ... xn↦an ⦄.
\newglossary[nlg]{notation}{not}{ntn}{List of symbols}
\makeglossaries
\newglossaryentry{not:finiteMap}{type=notation, name={$$\{|\dotso|\}$$}, text={\{|\dotso|\}}, sort={finiteMap}, description={A finite map: $$\{| \binding{c_1}{s_1},\,\dotsc,\,\binding{c_n}{s_n}|\}$$ is a function that maps $$c_i$$ to $$s_i$$ for each $$i$$.},user1={\{|},user2={|\}}}
\begin{document}
$$\finiteMap{\binding{x}{a}}$$
\backmatter
\printglossaries
\end{document}

## Evaluation

This isn't a bug. The entry hasn't been marked as used in the document so \glsaddallunused behaves the same as \glsaddall with the format (encap) set to glsignore. This essentially indexes the entry with \glsignore which ignores its argument so the location list is 1, \glsignore{1}. I recommend you add \glsunset{not:finiteMap} to the definition of \finiteMap if you want to use \glsaddallunused. (An alternative solution is to switch to bib2gls where you can use selection=all which doesn't add phantom locations.)

## Watch This Report

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

Name: (Optional.)