3

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

  • 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
  • 1
    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
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.