I'm curently trying to write a simple commutative diagram through xypic, which works on one of my files, but I can't make it work on a new one :
\documentclass{article}
\usepackage[french]{babel}
\usepackage{xypic}
\begin{document}
$$\xymatrix@!0 @R=2pc @C=3pc { \mathcal{E}_1 \ar[rr]&& \mathcal{E}_2}$$
\end{document}
LaTeX tells me \mathcal is not accepted out of math mode, but I can't add $ inside xypic brackets and it does not seem that there is an equivalent of mathcal out of math mode. It seems to trigger an error because of the babel package, as it works well when i remove it. Still even putting xy package before or after, i get the error. Any hint on how to fix this?

\[...\]instead of$$...$$(see here). – Sandy G May 03 '22 at 16:20@!0? – Sigur May 03 '22 at 21:36