I'm trying to get the \ensuremath function to work within glossaries for the following:
\newglossaryentry{CSPB}{name={CSP\ensuremath{\parallel}B},
description={A hybrid formal language combining CSP and the B-Method},sort=CSPB}
However I get an error message:
! Incomplete \iffalse; all text was ignored after line 120.
If I take the \ensuremath{\parallel} out there is no problem.
Any ideas why this isn't working as the manual suggests?

\protect\parallel. – Stephan Lehmke Nov 20 '12 at 9:52\ensuremathis inappropriate here in any case, you would be better just to use$\parallel$. If you are in text mode this will do the right thing. If for some reason you were already in math mode theCSPwould have been set with an inappropriate font and having\ensurematharound the\parallelwould not fix that. – David Carlisle Nov 20 '12 at 10:12