3

I have a glossary entry using a negative thinspace ("\!"), but it seems that makeglossaries is generating wrong code. I filed a bug report, but maybe there is a work-around?

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 Foo-\"\relax \glsresetentrylist 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 "\"!".

2
  • never used glossary, so it's a shot in the dark... have you tried name={Foo-{\!}Too} ?
    – Rmano
    Commented Jun 30, 2020 at 12:01
  • 4
    ! has a special meaning in working with indexing programmes (which makeglossasries uses behind the scenes), perhaps you should give it a different name.
    – daleif
    Commented Jun 30, 2020 at 12:08

2 Answers 2

4

The character ! has a special meaning in indexing programmes (which makeglossaries uses behind the scenes). I don't think any of them look to see if the ! is "escaped". Instead I'd suggest giving \! a different name and then use that.

This seems to work

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

\usepackage{lipsum}

\usepackage[acronym,toc]{glossaries}
\let\ts\!


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

\makeglossaries


\begin{document}

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

\printglossaries{}

\end{document}
1
  • 2
    Works like a charm. Thanks.
    – Clément
    Commented Jun 30, 2020 at 12:25
1

daleif's answer is correct. However, if you only need this once in your document and prefer not to create a new macro for that purpose, you can also just insert manual kerning:

\newglossaryentry{footoo}{text={foo-too},name={Foo-\kern-.1667emToo},description={This is foo-too}}
1
  • 1
    I have multiple entries that require this typesetting, so I'll go with the macro. Thanks for giving a look at the issue though.
    – Clément
    Commented Jun 30, 2020 at 12:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .