I have created a new command for the glossarie-package. Especcially for symbols...
\newcommand*{\nsymbol}[4]{\newglossaryentry{#1}{
type=symbols,
name={#2},
description={\nopostdesc},
symbol={{#3}},
user1={#4},
sort={#1}}}
The main issue here (i guess) the following line works fine, but the second one gives me an 'Undefiened Control Sequence' and I can't determine whats the problem.
\nsymbol{abc}{alphabet}{$A_.{bc}$}{$\si{cm}$}
\nsymbol{abc}{alphabet}{$A_.{bc}$}{$\si{\metre}$}
I can only guess, but it seems the newcommand doesnt work quite well with siunitx, since the error says something like:
! Undefined control sequence. \@glo@useri ->$\si {\metre }$ l.38 ...alphabet}{$A_.{bc}$}{$\si{\metre}$}
Where there is a space between '\si' and '{\metre}', maybe this is the problem... It doesn't make any difference in, whether its mathmode or not. Thanks in advance, its probably stupid, but I would appreciate any helpful answer.
EDIT:that's kind of a minimal example, not quite sure, what's the problem here, so I copied a lot.
\documentclass{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[locale=DE]{siunitx}
\sisetup{detect-mode = false,
detect-family=true,
mode=math,
% output-decimal-marker={,},
binary-units=true,
group-separator={\,},group-minimum-digits=3%
}
% upright indices-shortcut
\mathcode`\.="8000
\begingroup\lccode`~=`.
\lowercase{\endgroup\def~}#1{\mathrm{#1}}
\usepackage{hyperref}
\usepackage[acronym, symbols, nomain, toc]{glossaries}
\usepackage{booktabs}
\usepackage{tabu}
%%% new glossary styl
\newglossarystyle{symblongtabu}{
\renewenvironment{theglossary}{
\begin{longtabu}spread 0pt[l]{ccc<{\strut}l}
}{
\end{longtabu}}
\renewcommand*{\glsgroupheading}[1]{}
\renewcommand*{\glsgroupskip}{}
\renewcommand*{\glossaryheader}{
\toprule
\bfseries Formelzeichen & \bfseries Bezeichnung &
\bfseries Einheit & \bfseries Seite(n)
\tabularnewline\midrule\endhead
\bottomrule\endfoot}
\renewcommand*{\glossentry}[2]{
\glsentryitem{##1}
% Entry number if required
\glstarget{##1}{\glossentrysymbol{##1}} &
\glossentryname{##1} &
\glsentryuseri{##1} &
##2\tabularnewline}}
\makenoidxglossaries
%%% newsymb macro
\newcommand*{\nsymbol}[4]{\newglossaryentry{#1}{
type=symbols,
name={#2},
description={\nopostdesc},
symbol={{#3}},
user1={#4},
sort={#1}}}
\defglsentryfmt[symbols]{\ifmmode
\glssymbol{\glslabel}
\else
\glsgenentryfmt~\glsentrysymbol{\glslabel}
\fi}
%%% entries
\nsymbol{abc}{alphabet}{$A_.{bc}$}{$\si{cm}$}
\nsymbol{abc1}{alphabet1}{$A_.{bc1}$}{$\si{\metre}$}
\begin{document}
\printnoidxglossary[type = symbols, style = symblongtabu]
\gls{abc} \\
\gls{abc1}
\end{document}
\documentclass
and ending with\end{document}
. Try\SI{}{\metre}