# Non-commutative fractions

There are symbols for non-commutative fractions? I know \holter and \polter (see here), but they are very ugly (lateral lines are too long for my taste)

Edit: By non-comutative fraction I mean a division in non-commutative contest; for example in a non-commutative multiplicative group, we have two possible division, namely ab^{-1} and b^{-1}a, hence, in order to distinguish them, we cannot write \frac ab, but \holter ab or \polter ab.

• Welcome to TeX.SX! Can you point to where we can find \holter and \polter? Jan 23, 2014 at 14:13
• A mathematical question : what are non-commutative fractions ? Jan 23, 2014 at 14:14
• I find \holter and \polter here ftp.uniroma2.it/TeX/info/symbols/comprehensive/symbols-a4.pdf at page 63 Jan 23, 2014 at 14:16
• @FabioLucchini I'd stick to ab^{-1} and a^{-1}b. But that's me. Jan 23, 2014 at 14:35
• I would say there's quite a bit wrong with the settings of \holter and \polter; it uses the array environment and \multicolumn to do its job and the vertical spacing is cramped. If this notation is actually ever used, it needs a better implementation. Jan 23, 2014 at 14:53

Here are provided settable versions of \holter and \polter. The settable parameters include \strutheight, the height (+depth) of the strut, \strutdepth, the depth of the strut, \strutpad, the extra length added to the horizontal rule relative to the longest argument, and \strutrule, the thickness of the rule lines. I made the rule heights a fixed length, but if you would prefer the \strutheight and \strutdepth to be matched to the argument heights and depths, that could be done, as well.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\stackMath
\newlength\strutrule
\def\strutheight{2.7ex}
\def\strutdepth{-.8ex}
\setlength\strutrule{.1ex}
%
% http://tex.stackexchange.com/questions/145306/cramped-style-again-working-simple-code
\def\cramped#1{%
}
\def\xolterstrut{\rule[\strutdepth]{\strutrule}{\strutheight}}
\newlength\xolterlen
\newcommand\holter[2]{%
\setlength\xolterlen{\maxof{\widthof{$#1$}}{\widthof{$#2$}}}%
\stackon[-.8\strutrule]{%
\stackanchor[-.8\strutrule]{\rule{\xolterlen}{\strutrule}}{%
\makebox[\xolterlen]{$\cramped{#2}$}\xolterstrut}%
}{\xolterstrut\makebox[\xolterlen]{$#1$}}%
}
\newcommand\polter[2]{%
\setlength\xolterlen{\maxof{\widthof{$#1$}}{\widthof{$#2$}}}%
\stackon[-.8\strutrule]{%
\stackanchor[-.8\strutrule]{\rule{\xolterlen}{\strutrule}}{%
\xolterstrut\makebox[\xolterlen]{$\cramped{#2}$}}%
}{\makebox[\xolterlen]{$#1$}\xolterstrut}%
}
\begin{document}
$x = \holter{abcg}{deg}$,
$y = \polter{abcg}{deg^2}$
\end{document}


I'm afraid that elegance is out of the question, with symbols like those.

\documentclass{article}
\usepackage{mathtools}

\newcommand{\holter}[2]{%
\mathinner{
\sbox0{$\textstyle\,\cramped{#2}\,$}%
\sbox2{\copy0\vrule height\ht\strutbox}
\raise\dimexpr-\ht2-\dp2-2pt+\fontdimen22\textfont2\relax\vbox{
\offinterlineskip
\ialign{%
##\cr
\vrule\hfil$\textstyle\,#1\,\mathstrut$\hfil\cr
\vrule height 1pt\hfil\cr
\noalign{\hrule}
\hfil\vrule height1pt\cr
\hfil\box0\hfil\vrule height\ht\strutbox\cr
\hfil\vrule height1pt\cr
}
}%
}
}

\newcommand{\polter}[2]{%
\mathinner{
\sbox0{$\textstyle\,\cramped{#2}\,$}%
\sbox2{\copy0\vrule height\ht\strutbox}
\raise\dimexpr-\ht2-\dp2-2pt+\fontdimen22\textfont2\relax\vbox{
\offinterlineskip
\ialign{%
##\cr
\hfil$\textstyle\,#1\,\mathstrut$\hfil\vrule\cr
\hfil\vrule height1pt\cr
\noalign{\hrule}
\vrule height1pt\hfil\cr
\vrule height\ht\strutbox\hfil\box0\hfil\cr
\vrule height1pt\hfil\cr
}
}%
}
}

\begin{document}
$\frac{g}{g}\holter{a}{b}\holter{g}{g}\quad\polter{a}{b}\quad\holter{x}{y^2}$
\end{document}


The fraction is meant to show that the fraction line is vertically placed at the correct position.