Incompatible glue units error using \implies and \iff in Beamer

beamermath-modespacing

I'm experiencing some strange behavior with Beamer.

\documentclass{beamer}
\begin{document}

\begin{frame}
  $\alert<1>{\implies}$
  %% \alert<1>{$\implies$}         % Works!
  %% $\alert<1>{\Longrightarrow}$  % Works!
  %% \alert<1>{$\iff$}             % Works!
\end{frame}

\end{document}

The previous code will raise an error:

! Incompatible glue units.

\reset@color ->\beamer@lastskip =\lastskip
\edef \beamer@lastskiptexta {\the…

l.9 \end{frame}

I have the same issue with $\alert<1>{\iff}$. But all of the other commented options work smoothly. Which is the relevant difference between \implies and \Longrightarrow here? In any casse, the PDF output looks fine to me.

I'm running pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian), packed with Debian Testing.

Best Answer

\implies has an explicit \; in its definition which adds a muskip length which is incompatible with standard skip (length) commands. You can hide that with an extra set of braces

\documentclass{beamer}
\begin{document}

\begin{frame}
  $\alert<1>{{\implies}}$
  %% \alert<1>{$\implies$}         % Works!
  %% $\alert<1>{\Longrightarrow}$  % Works!
  %% \alert<1>{$\iff$}             % Works!
\end{frame}

\end{document}
Related Question