Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 13 down vote accepted

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} 
share|improve this answer
    
Ok, that is a unexpected but very good solution. Thank you –  Felipe Aguirre Aug 19 '12 at 13:12
    
@FelipeAguirre: Why unexpected? ;-) –  Marco Daniel Aug 19 '12 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? –  Felipe Aguirre Aug 19 '12 at 14:23
    
@FelipeAguirre: I think it's a great idea. –  Marco Daniel Aug 19 '12 at 15:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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