# glossaries-extra - wrong spacing around math relation

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}


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

• 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. – Ulrike Fischer Feb 9 at 19:27
• 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.) – barbara beeton Feb 10 at 3:25
• @barbarabeeton I've tried that and it works, thank you! – Fido Feb 14 at 16:45

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}