I'm occasionally using double accents on symbols, e.g. double hats, using wipet's code from this question.
I now found that these do not work in acronym environments (which I'd like to use to produce a list of symbols).
Here is a minimal example:
\documentclass{article}
\usepackage{acronym}
\def\measurehat#1{%
\setbox0=\vbox{$\hat{#1}\hfil\break$\null\par
\setbox0=\lastbox\unskip\unpenalty\global\setbox1=\lastbox}%
\setbox0=\hbox{\unhbox1 \unskip\unpenalty\unskip \global\setbox2=\lastbox}%
\setbox0=\vbox{\unvbox2 \setbox0=\lastbox}%
}
\def\doublehat#1{%
\measurehat{#1}\dimen0=\wd0 \measurehat{\kern0pt#1}%
\raise.35ex\rlap{\kern\dimexpr\dimen0-\wd0$\hat{\phantom{#1}}$}{\hat#1}%
}
\begin{document}
\section*{Works}
\begin{acronym}[MMM]
\setlength{\itemsep}{-\parsep}%
\acro{lambdahat}[{$\hat{\lambda}$}]{Lambda hat}
\acro{lambdatilde}[{$\tilde{\lambda}$}]{Lambda tilde}
\end{acronym}
\section*{Does not work}
\begin{acronym}[MMM]
\setlength{\itemsep}{-\parsep}%
\acro{lambdahathat}[{$\doublehat{\lambda}$}]{Lambda double hat}
\acro{lambdatilde}[{$\tilde{\lambda}$}]{Lambda tilde}
\end{acronym}
\end{document}
This produces
As you can see, the twice-behatted lambda is overlaid on the next symbol; the same problem does not happen with a regular behatted lambda.
I've looked at acronym's documentation, to no avail; I've no idea where to even start with this, and would appreciate any help from the resident wizards.


acrorather than the datedacronym. – egreg Sep 08 '22 at 14:05