While the OP has indicated that he cannot accept this answer because of the packages it uses, I will present it nonetheless to show a practical application of my roundrule.sty
package. It is not found on CTAN, but only at the bottom of this answer: Is there such a thing as a `\mathrule`? (rounded endcaps).
Using that package and this MWE below, I first give the OP's original answer (\thickfracA
). I then give my answer that only works in \displaystyle
, known as \thickfracB
. Finally, I give an answer that works across math styles, as \thickfracC
.
\documentclass[9pt]{article}
\usepackage{extsizes}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{stackengine,scalerel,roundrule}
\stackMath
% \frac overwrite
\newcommand{\thickfracA}[2]{\genfrac{}{}{0.8pt}{0}{#1}{#2}}
% DISPLAYSTYLE ONLY
\newcommand\thickfracB[2]{%
\setstackgap{S}{2.5pt}%
\setbox0=\hbox{\stackon{#1}{#2}}%
\mkern2.4mu%
\raisebox{\dimexpr.5\ht\strutbox-.5\dp\strutbox}{\stackunder{%
\stackon{\roundrule[-.4pt]{\wd0}{.8pt}}{#1}%
}{%
#2%
}}%
\mkern2.4mu%
}
% ANY MATHSTYLE
\newcommand\thickfracC[2]{\ThisStyle{%
\setbox1=\hbox{$\SavedStyle($}%
\setstackgap{S}{2.5\LMpt}%
\setbox0=\hbox{\stackon{\SavedStyle#1}{\SavedStyle#2}}%
\mkern2.4mu%
\raisebox{\dimexpr.5\ht1-.5\dp1}{\stackunder{%
\stackon{\roundrule[-.4\LMpt]{\wd0}{.8\LMpt}}{\SavedStyle#1}%
}{%
\SavedStyle#2%
}}%
\mkern2.4mu%
}}
\newcommand\bigfrac[3][2.0pt]{%
{\thickfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}}}
\let\oldfrac\frac
\let\frac\bigfrac
% \frac overwritten
\begin{document}
\centering
ORIGINAL\let\thickfrac\thickfracA
\thispagestyle{empty}
\[
x =\frac{\frac{a}{b}}{c} - \frac{d}{\frac{e}{1+\frac{f}{g} } } + \frac{h}{i}
\]
displaystyle ONLY\let\thickfrac\thickfracB
\[
x =\frac{\frac{a}{b}}{c} - \frac{d}{\frac{e}{1+\frac{f}{g} } } + \frac{h}{i}
\]
ANY MATHSTYLE\let\thickfrac\thickfracC
\[
\scriptstyle
x =\frac{\frac{a}{b}}{c} - \frac{d}{\frac{e}{1+\frac{f}{g} } } + \frac{h}{i}
\]
\end{document}
Here is the zoom on the \displaystyle
answer.
\mathrule
at tex.stackexchange.com/questions/161297/…