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

# Bug Tracker

ID 166🔗 2020-06-30 12:50:30 Open Sign in if you want to bump this report. glossaries 4.41 bad behaviour with negative spaces Mac OS Catalina 10.15.4

## Description

I have a glossary entry using a negative thinspace ("\!"), but it seems that makeglossaries is generating wrong code.

If a glossary entry has a negative thinspace (to fix the typesetting after a dash, as an example) when printing the previous entry, some residual text appears at the end of the definition.

Here is a minimal working example :

\documentclass[12pt,a4paper,twoside]{memoir}

\usepackage{lipsum}

\usepackage[acronym,toc]{glossaries}

\newglossaryentry{foo}{text=foo,name=Foo,description={This is foo}}
\newglossaryentry{footoo}{text={foo-too},name={Foo-\!Too},description={This is foo-too}}

\makeglossaries

\begin{document}

\lipsum[1]
\gls{foo}
\lipsum[1]
\gls{footoo}
\lipsum[1]

\printglossaries{}

\end{document}


In the glossary, at the end of the "Foo" line, there is a residual "Foo- ̈".I find [pre]Foo-\"\relax \glsresetentrylist[\pre] in the .gls file, which, once removed, cleans the output of pdflatex, but the root cause is likely in the glo file which replaces the "\!" with "\"!".

## MWE

\documentclass[12pt,a4paper,twoside]{memoir}

\usepackage{lipsum}

\usepackage[acronym,toc]{glossaries}

\newglossaryentry{foo}{text=foo,name=Foo,description={This is foo}}
\newglossaryentry{footoo}{text={foo-too},name={Foo-\!Too},description={This is foo-too}}

\makeglossaries

\begin{document}

\lipsum[1]
\gls{foo}
\lipsum[1]
\gls{footoo}
\lipsum[1]

\printglossaries{}

\end{document}


## Evaluation

Since the sort key hasn’t been set, its value is obtained from the name key Foo-\!Too. The exclamation mark is a makeindex special character (indicating a division in the hierarchical level). The special characters are usually internally escaped when an entry is defined, but in this case the exclamation mark isn’t detected as it’s part of a control sequence.

In this case, it’s better to set the sort key as there’s no benefit in including the typesetting markup, which will confuse the alphabetical sorting.

\newglossaryentry{footoo}{text={foo-too},sort={Foo-Too},name={Foo-\!Too},description={This is foo-too}}


I’ve changed the category from makeglossaries to glossaries, since it stems from glossaries not finding the ! within the control sequence \! when parsing the sort value.

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.