4

When I use a relation in math mode with the glossaries package, the output looks exactly the same as if typed directly. However, when using glossaries-extra, the spacing is incorrect. What can be the reason?

Example:

\documentclass{article}
\usepackage{glossaries}
\usepackage{glossaries-extra}

\newglossaryentry{eq}{name={eq},
symbol={=},
description={Quisque ullamcorper placerat ipsum.}}

\begin{document}
$ \alpha = \beta $

$ \alpha \glssymbol{eq} \beta $
\end{document}

enter image description here

When I comment the \usepackage{glossaries-extra} line, the spacing is correct:

enter image description here

3
  • glossaries does a lot stuff when processing \glssymbol and this hides the \mathrel. I'm not really surprised, more that it works with glossaries alone. Feb 9, 2019 at 19:27
  • 2
    wrapping a relation in braces makes it behave like an ordinary character with no spacing around it. try symbol={{}={}} to force the spacing. (answering in a comment because i can't test.) Feb 10, 2019 at 3:25
  • @barbarabeeton I've tried that and it works, thank you!
    – Fido
    Feb 14, 2019 at 16:45

1 Answer 1

0

The recommendation from Barabara Beeton solved the problem: the solution is to change the symbol definition from symbol={=} to symbol={{}={}} Complete code:

\documentclass{article}
\usepackage{glossaries}
\usepackage{glossaries-extra}

\newglossaryentry{eq}{name={eq},
symbol={{}={}},
description={Quisque ullamcorper placerat ipsum.}}

\begin{document}
$ \alpha = \beta $

$ \alpha \glssymbol{eq} \beta $
\end{document}
1
  • A drawback of this solution reveals when you want something like $\alpha\glssymbol{eq}_s \beta$.
    – ganganray
    Nov 23, 2023 at 8:36

You must log in to answer this question.

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