Bug Tracker

ID:138 🔗
Status:Closed (Not a Bug)
Category:glossaries-extra
Version:1.41
Submitted by:Md Ayquassar
Date:2019-11-05 18:27:06
Summary: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
\glsaddallunused
\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
\glsaddallunused
\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.)

I've added a more detailed explanation in the linked post.

Add comment or return to search results.

Watch This Report

If you would like to be notified whenever updates are made to this report, please fill in your email address in the box below and click on "Notify Me of Changes" button. (Please ensure the address is valid.) Your details won't be passed on to third parties in line with this site's Privacy Policy.

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).

(Optional.)
E mail:
Confirm E mail:
Confirm Bug ID:

To unsubscribe from all notifications use the notifications page.

Comment

You can append a comment to the report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.

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).

(Optional. If provided, it will be shown with the comment.)
Confirm Bug ID:

You can use the following markup:

[pre]Displayed verbatim[/pre]
[tt]monospace text[/tt]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

Click on the Preview button to preview the message.

Return to search results.