2

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 Answers1

4

@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}

enter image description here

  • Hey Daniel, here $d_e$ shown by \printacronyms will not be a bold symbol. But by default if we use any acronym (without \ensuremath{}) in our document and use \printacronyms, short form of that acronyms will be shown in bold character in list of acronyms. So, short form of few acronym (without \ensuremath{}) will be in bold and few with \ensuremath{} will not be in bold. How to print all the short forms shown in list of acronyms in bold characters. – Keerthi vasan May 11 '20 at 06:26