12

I am using glossaries package and I encountered a problem in the symbol field. When I define it as $m=1$ I get the following error message:

! Missing $ inserted.
<inserted text> 
                $
l.6 \end{theglossary}
                     \glossarypostamble

After carefull analysis I discovered that if I remove the equal sign =, everything works perfectly. But I have to use the equal sign... Is there an alternative symbol for the equal sign?

If I change the field symbol from $m=1$ to $m *(alternative equal sign)* 1$, my glossary should compile correctly.

Here is a MWE, change the symbol field and you'll see the magic... (output after the MWE)

\documentclass{scrartcl}
\usepackage{glossaries}
\makeglossaries

\newglossaryentry{vacuous}
{
    name={vacuous},
    description={A mass whose bla bla bla},
    symbol=$m=1$,
}

\begin{document}

\gls{vacuous}

\glossarystyle{index}  % chose style here
\printglossary[type=main]

\end{document}  

enter image description here

1 Answer 1

14

The equal sign isn't directly the problem. The option symbol get his meaning by the key. If a key has a special symbol or something like this you must use extra curly brackets to protect the argument:

symbol={$m=1$},

You see it's the same matter as you uses for name or description.

Here the mwe:

\documentclass{scrartcl}
\usepackage{glossaries}
\makeglossaries

\newglossaryentry{vacuous}
{
    name={vacuous},
    description={A mass whose bla bla bla},
    symbol={$m=1$},
}

\begin{document}

\gls{vacuous}

\glossarystyle{index}  % chose style here
\printglossary[type=main]

\end{document} 
4
  • Ok, that is a unexpected but very good solution. Thank you Commented Aug 19, 2012 at 13:12
  • @FelipeAguirre: Why unexpected? ;-) Commented Aug 19, 2012 at 13:32
  • 1
    Because I was sure that the problem was the glossaries package, but it turned out to be me the problem :D I actually was thinking about changing the title and rephrase the question. After your answer I fill it'll be more constructive for the community if I change it. What do you think? Commented Aug 19, 2012 at 14:23
  • @FelipeAguirre: I think it's a great idea. Commented Aug 19, 2012 at 15:13

You must log in to answer this question.

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