I use the xfrac
package to make nice-looking fractions and I encountered a problem with it. I use the babel
package to write my documents in Hebrew, and I found that using xfrac
inside an align*
environment causes the numerator and denominator to reverse:
The corresponding code:
\documentclass{article}
\usepackage[amsthm, libertine, varbb]{newtxmath}
\PassOptionsToPackage{no-math}{fontspec}
\usepackage[bidi=basic, layout=tabular, headfoot=hebrew]{babel}
\babelprovide[main, import, alph=letters, Alph=letters]{hebrew}
\babelprovide[import]{english}
\usepackage{amsmath}
\usepackage{xfrac}
\begin{document}
\begin{align*}
\sfrac{x}{y}
\end{align*}
\[ \sfrac{x}{y} \]
\end{document}
Commenting out the babel
setup produces the correct result:
How can I fix these fractions to work correctly with babel?