# Dealing with math acronyms from acro package in math mode

I'm using acro package for my acronyms. Some of the acronyms are equation variables, so I'd like tu use them in math mode. The problem is when I use the acronym in math mode, I get the error Missing \endgroup inserted. This is me trying to use $\acs{de}=. How can I use acronyms written between $ $ \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{acro} \usepackage{blindtext} \DeclareAcronym{de}{ short=$d_{e}$, long=especific diameter } \begin{document} \printacronyms This is me trying to use$\acs{de}=12$\end{document}  ## 1 Answer @clemens Solved the problem, I just used \ensuremath command \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{acro} \usepackage{blindtext} \DeclareAcronym{de}{ short=\ensuremath{d_{e}}, long=especific diameter } \begin{document} \printacronyms This is me trying to use$\acs{de}=12\$
\end{document}