I use glossaries to display a global symbol list but also local one for each equation. The first userkey is used to add the physical unit. But some smybols (like efficiencies or proportions) don't require a unit. I marked these with a dash. In the global list of symbols this looks fine (like the one at COP).
But for the local one (due to using a diffrent style) it looks kinda silly.
So my wish is to drop the in - if the \glsuerkeyi equals -. I have a command which is placed inside the glossarystyle to produce the entries :
%glossarystyle uses tabular
\newcommand{\itemss}[2]{\glstext*{#1} & #2 in \glsuseri*{#1} \\}
So I guess this command needs to be renewed conditionally for each entry. I found this (How to check if a macro value is empty or will not create text with plain TeX conditionals?) helpful post.
But I have quite a few things I'm not sure about:
a) Can the command even be renewed inside the glossaries environment and if yes can it be redefined for each entry?
b) I'm not sure which solution from the other post to apply. Since I got tokens, printed out text and I do not want to check for emtpy strings, and so on.
I would really appreciate if you could point me in the right direction.
Edit: I think i got it partially figured out. Using etoolboxes \ifstrequal might be a solution:
\newglossarystyle{tabx4col}{%
% put the glossary in a longtable environment:
\renewenvironment{theglossary}%
{\vspace{-1.7em}
\begin{longtable}{@{}p{0.15\textwidth}@{}p{0.1\textwidth}@{}p{0.60\textwidth}@{}p{0.15\textwidth}@{}}}%
{\end{longtable}}%
% Set the table's header:
\renewcommand*{\glossaryheader}{}%
% No heading between groups:
\renewcommand*{\glsgroupheading}[1]{}%
% Main (level 0) entries displayed in a row:
\ifstrequal{\glsentryuseri{##1}}{-}{
\renewcommand*{\glossaryentryfield}[5]{%
\glstarget{##1}{##2}% Name
& \glsentryuseri{##1}% Units
& ##3% Description
& ##5% Page list
\\% end of row
}%
}{
\renewcommand*{\glossaryentryfield}[5]{%
\glstarget{##1}{##2}% Name
&
& ##3% Description
& ##5% Page list
\\% end of row
}%
}
% Sub entries treated the same as level 0 entries:
%\renewcommand*{\glossarysubentryfield}[6]{%
%\glossaryentryfield{##2}{##3}{##5}{##6}}%
%% Nothing between groups:
%\renewcommand*{\glsgroupskip}{}%
}
I'm not sure if \glsentryuseri{##1} is the right entry to check and I think it always get compared to the actual text inside the first pair of brackets, in this case \glsentryuseri{##1}. It would need to be expanded somehow.
Edit: Created MWE (https://gist.github.com/tairun/5648781)

glossariespackage (http://www.ctan.org/pkg/glossaries). In my eyes its the best tool to create any kind of "index". Highly customizable with your own styles. Multiple glossaries and as I recently learned you can even create a glossary per chapter/section/environment whatever you like. – Sensei May 25 '13 at 09:35& \def\tempa{-}\edef\tempb{\glsentryuseri{##1}}\ifx\tempa\tempb\else\glsentryuseri{##1}\fi% Units<- it's your unit line. – Marco Daniel May 25 '13 at 11:47?ee0(questionamark + its identifier. – Sensei May 25 '13 at 11:59