This is a continuation of my question question.
For a given code I would like to add symbol. For example:
\mathgloss{m}{mass}{kg}
MWE:
\documentclass{report}
\usepackage{enumitem}
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}
\makeglossaries
\newcommand{\mathgloss}[2]{%
\newglossaryentry{#1}{name={#1},description={#2}}%
\begin{description}[labelwidth=3em]%
\item[\gls{#1}]#2%
\end{description}%
}
\begin{document}
Consider the equation
\begin{equation}
e = m * c^2
\end{equation}
in which
\mathgloss{e}{energy}
\mathgloss{m}{mass}
\mathgloss{c}{speed of light}
\printglossaries
\end{document}
I tried writing ("a blind shot"):
\newcommand{\mathgloss}[3]{%
\newglossaryentry{#1}{name={#1},description={#2},symbol={#3}}%
\begin{description}[labelwidth=3em]%
\item[\gls{#1}]#2 #3%
\end{description}%
}
...but I missed the target.
File ended while scanning use of \mathgloss \input{chapters/}