Create a backslash fraction using sfrac

fractionsxfrac

I tried to create a backslash fraction using sfrac, but the output looks like this:
sfrac attempt

\documentclass{article}
\usepackage{xfrac}

\begin{document}

$ \sfrac{A}[\backslash]{B} $

\end{document}

Any idea how can I fix this? (A should be under B)

Best Answer

Here's one way to do it, first reflect a normal \sfrac and then reflect both arguments.

\documentclass{article}
\usepackage{xfrac}
\newcommand*{\backfrac}[2]{\reflectbox{\sfrac{\reflectbox{\(#2\)}}{\reflectbox{\(#1\)}}}}
\begin{document}
    \(\backfrac{A}{B}\)
\end{document}

The result is enter image description here

Related Question