Bug Tracker 
| ID | 166🔗 |
|---|---|
| Date: | 2020-06-30 12:50:30 |
| Status | Closed (Fixed) |
| Category | glossaries |
| Version | 4.41 |
| Summary | bad behaviour with negative spaces |
| OS | Mac OS Catalina 10.15.4 |
Sign in to subscribe to notifications about this report.
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
Download (390B)
\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.
Fixed in v4.47
Comments
0 comments.
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=166
