# Conflict between flexisym and polynom packages

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}

• Another conflict of flexisym. Avoid it. – egreg Oct 1 '19 at 9:44
• @egreg it sounds there is a list of conflicts with flexisym – CroCo Oct 1 '19 at 9:48
• For some odd reason 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. – Phelype Oleinik Oct 1 '19 at 9:49
• flexisym is really just designed to underpin breqn and both packages are highly experimental and by design incompatible with most standard math layout macros. Are you sure you want to use flexisym? – David Carlisle Oct 1 '19 at 10:09
• @PhelypeOleinik it is ordinary so it can be made math-active with mathcode"8000 and given more specific definition than just the built in superscript processing. – David Carlisle Oct 1 '19 at 10:10

The flexisym package changes the category code of ^ and _ to 12, in order to make them math active.

The problem is that polynom uses the characters ^ and _ with their standard category code to do tests.

### Best solution

Forget about flexisym

### Working solution

Load polynom with the appropriate category code setup.

\documentclass{beamer}
\usepackage{amsmath}
\usepackage{flexisym}

\catcode^=12 \catcode_=12
\usepackage{polynom}
\catcode^=7 \catcode_=8

\begin{document}

\begin{frame}[fragile]
\begin{center}
\polyset{vars=s}
\polylongdiv{s^2+1}{s^2-3s+2}
\end{center}
\end{frame}

\end{document}


• Nice answer. The thing that I don't understand why the execution process hangs?! – CroCo Oct 2 '19 at 17:55
• @CroCo The polynom package is looking for a standard ^`, but it find a different brand of it. – egreg Oct 2 '19 at 19:27
• Is this a bug? It should at least show a warning. – CroCo Oct 2 '19 at 19:28
• @CroCo No, it's not a bug. It's flexisym's fault. – egreg Oct 2 '19 at 19:30
• From programming perspective, it shows a bad design by the package's writer. It shouldn't go on and on without stopping the process. It was actually a shot in the dark for me to notice this. – CroCo Oct 2 '19 at 19:35