Latest news 2021-06-05: New blog post: Dickimaw Books Site Account.

Bug Tracker

ID 138🔗
Date: 2019-11-05 18:27:06
Status Closed (Not a Bug)
Category glossaries-extra
Version 1.41
Summary Superfluous comma printed

Sign in to subscribe to notifications about this report.

Description

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

Download (778B)

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

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:

You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

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

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

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=138