[Tex/LaTex] How to type B\A like faktor, a quotient group

amsmathmath-mode

i'm in groups theory, just defined A/B a group quotien and I wanna do the same but with A at top-right and B at bottom-left, here's my code:

\documentclass{article}
\usepackage{faktor} 
\usepackage{amsmath} 
\usepackage{amssymb}

\begin{document}

 I'm defining something: 

\begin{itemize} 

\item[$-$]$\faktor{G}{H}:=\faktor{G}{\sim}=\text{ set definition}$ 

\item[$-$] what i want %something like B\A
\end{itemize}

\end{document}

Best Answer

I've just modified the definition from the source file a bit (it's short enough). That provides the new command \mfaktor to achieve your aim.

mfaktor

\documentclass{article}
\usepackage{faktor}\usepackage{amsmath}\usepackage{amssymb}

\makeatletter
\DeclareRobustCommand*{\mfaktor}[3][]
{
   { \mathpalette{\mfaktor@impl@}{{#1}{#2}{#3}} }
}
\newcommand*{\mfaktor@impl@}[2]{\mfaktor@impl#1#2}
\newcommand*{\mfaktor@impl}[4]{
   \settoheight{\faktor@zaehlerhoehe}{\ensuremath{#1#2{#3}}}%
   \settoheight{\faktor@nennerhoehe}{\ensuremath{#1#2{#4}}}%
      \raisebox{-0.5\faktor@zaehlerhoehe}{\ensuremath{#1#2{#3}}}%
      \mkern-4mu\diagdown\mkern-5mu%
      \raisebox{0.5\faktor@nennerhoehe}{\ensuremath{#1#2{#4}}}%
}
\makeatother

\begin{document}

I'm defining something: \begin{itemize} \item[$-$]$\faktor{G}{H}:=\faktor{G}{\sim}=\text{ set definition}$ \item[$-$] what i want something like B\ A \end{itemize}

$\mfaktor{B}{A}$

\end{document}