6

There is a problem with using the package permute with glossaries.

A minimal working example: (by the way a minimal working example to show how an "index of notation" can be created)

\documentclass{article}
\usepackage{permute}
\usepackage[style=long3colheader]{glossaries}

\newglossaryentry{root}{name=\ensuremath{\sqrt{(12)}},description={a square root}}

%% uncomment the following line and the problem appears
%\newglossaryentry{permutation}{name=\ensuremath{\pmt{(12)}},description={a permutation}}

\makeglossaries
\begin{document}
Permutations in the text work well $\pmt{(123)(45)}$.
\glsaddall
\printglossary
\end{document}

If the Perl script "makeglossaries" is available, run this with:

pdflatex filename
makeglossaries filename
pdflatex filename

Uncommenting the line in the source code leads to:

! Undefined control sequence.
\pmt@GetPrintArgs #1->\let \pmt@order [...]

Is there a possibility to use \pmt in the glossary? Using the package option sanitize=none does not help. Enclosing \pmt{...} with \protect did not help.

The solution is simply, as egreg pointed out, to write

\protect\pmt{...}

without braces. Note that \protect{\pmt{...}} with braces does not help.

One
  • 1,485

1 Answers1

5

Just add \protect in front of \pmt:

\newglossaryentry{permutation}{
  name=\ensuremath{\protect\pmt{(12)}},
  description={a permutation}
}
egreg
  • 1,121,712
  • That's it. Thanks! The problem was that \protect must be used without braces. I've included the answer above. – One Aug 01 '12 at 20:30