After isolating the problem, an aberrant behavior shows up if flexisym and polynom packages are added in beamer. The execution process jams indefinitely without any sign of errors. The following minimal working example elucidates the issue.
\documentclass{beamer}
\usepackage{amsmath,polynom}
\usepackage{flexisym}
\begin{document}
\begin{frame}[fragile]
\begin{center}
\polyset{vars=s}
\polylongdiv{s^2+1}{s^2-3s+2}
\end{center}
\end{frame}
\end{document}
flexisym
. Avoid it.flexisym
flexisym
makes^
an ordinary (i.e., not a superscript) character, but\polylongdiv
expects otherwise. Reverting the catcode of^
seems to work:\usepackage{flexisym}\AtBeginDocument{\catcode
\^=7 }. Not using
flexisym` as egreg suggested seems a better idea.