This is the most simple way to produce what you want without using a graphical interface. As mentioned by @ach in the comments, you should replace the $$
by \[
and \]
or \begin{equation}
and \end{equation}
.
I don't know if I understood you correctly, but here \myfrac allows you to set both thickness and length and distance from the fractional line as you wish.
\documentclass[12pt,addpoints]{exam}
\usepackage{amsmath}
\newcommand\myfrac[2]{\genfrac{}{}{2pt}{0}{#1}{\hspace*{10pt}#2\hspace*{10pt}}}
\begin{document}
\Huge
$A\genfrac{}{}{3pt}{0}{ a}{\hspace*{1cm}40\hspace*{1cm}}\cdot
\myfrac{a}{b}\cdot
\genfrac{}{}{3pt}{1}{ a}{40}$
$\myfrac{a}{40}$
\end{document}
Addendum.
You might want to use tikz
.
You can adjust the parameters as you see fit.
Note that the effects depend on the size of the font.
Also, a line that is too thick (>2pt) greatly increases the distance to the fractional line.
If you go in to see how tikz
works in this case, you can replace the \path
command with \draw
.
\documentclass[12pt,addpoints]{exam}
\usepackage{amsmath}
\usepackage{tikz}
\newcommand\myfrac[5]{%
\genfrac{}{}{#1}{0}{%
\begin{tikzpicture}[baseline=0pt]
\path[line width=0pt] (0,0) -- (0,#3) -- (#2,#3) -- (#2,0) -- (0,0);%
\node at (#2/2, #3/2) {$#4$};%
\end{tikzpicture}}
{%
\begin{tikzpicture}[baseline=-#3-#1]
\path[line width=0pt] (0,0) -- (0,#3) -- (#2,#3) -- (#2,0) -- (0,0);%
\node at (#2/2, #3/2) {$#5$};%
\end{tikzpicture}}
}
\begin{document}
\Huge
% the thickness of the fractional line
$$\myfrac{0.2pt}{0pt}{0pt}{a}{b}\cdot
\myfrac{1pt}{0pt}{0pt}{a}{b}\cdot
\myfrac{2pt}{0pt}{0pt}{a}{b}\cdot
\myfrac{4pt}{0pt}{0pt}{a}{b}$$
% the length of the fractional line
$$\myfrac{1pt}{20pt}{0pt}{a}{b}\cdot
\myfrac{1pt}{40pt}{0pt}{a}{b}\cdot
\myfrac{1pt}{60pt}{0pt}{a}{b}\cdot
\myfrac{1pt}{80pt}{0pt}{a}{b}$$
% the distance between the fractional line and the numbers
$$\myfrac{1pt}{0pt}{0pt}{a}{b}\cdot
\myfrac{1pt}{0pt}{40pt}{a}{b}\cdot
\myfrac{1pt}{0pt}{60pt}{a}{b}\cdot
\myfrac{1pt}{0pt}{90pt}{a}{b}$$
\end{document}
Note.
As for the distance from the fractional line according to @barbara beeton - this is a TeX
error. See her comment to answer.
Best Answer
The font parameters 8,9,10,11,12 determine the position of numerator and denominator see
What do different \fontdimen<num> mean
You can not draw the rule using different style unless you abandon the TeX fraction primitives alltogether and draw the rule by hand using tikz or similar. (the rule thickness is however settable).