I'm using the glossaries
package to create a glossary of mathematical symbols, but I can't get it to work with upright text in the symbols. I have tried using both \mathrm
and \textup
. It only seems to cause problems if there are two or more definitions that use upright text. Here is a MWE to illustrate the problem:
\documentclass{book}
\usepackage{glossaries}
\makenoidxglossaries
\newglossaryentry{x}
{
name={$\mathrm{x}$},
description={description},
}
\newglossaryentry{y}
{
name={$\mathrm{y}$},
description={description},
}
\begin{document}
\chapter{Example}
\gls{x}
\gls{y}
\printnoidxglossary
\end{document}
The result is a whole heap of Undefined control sequence
errors, as well as one Too many }'s
error. It works fine if I remove one of the definitions (and its reference), or if I remove at least one of the \mathrm
commands.
Is there a way to get math-mode, upright text to work nicely with glossaries
?