2

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} 
10
  • Another conflict of flexisym. Avoid it.
    – egreg
    Commented Oct 1, 2019 at 9:44
  • @egreg it sounds there is a list of conflicts with flexisym
    – CroCo
    Commented Oct 1, 2019 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. Commented Oct 1, 2019 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? Commented Oct 1, 2019 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. Commented Oct 1, 2019 at 10:10

1 Answer 1

3

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}

enter image description here

8
  • Nice answer. The thing that I don't understand why the execution process hangs?!
    – CroCo
    Commented Oct 2, 2019 at 17:55
  • @CroCo The polynom package is looking for a standard ^, but it find a different brand of it.
    – egreg
    Commented Oct 2, 2019 at 19:27
  • Is this a bug? It should at least show a warning.
    – CroCo
    Commented Oct 2, 2019 at 19:28
  • @CroCo No, it's not a bug. It's flexisym's fault.
    – egreg
    Commented Oct 2, 2019 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
    Commented Oct 2, 2019 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .