Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing fraction bar thickness (LaTeX, amsmath)

513 views
Skip to first unread message

Michael Downes

unread,
Apr 16, 1996, 3:00:00 AM4/16/96
to
[Art Ogawa:]
> However there is a legitimate need for the ability to modify the width of
> the fraction bar, and more than one person has gone looking around in
> amsLaTeX for this functionality. Does it exist?

By `width' do you mean `rather than adjust the width to the max of
(numerator width, denominator width) use a specified width instead'? Or
do you mean the thickness of the bar, as for the TeX primitives \above
and \abovewithdelims? If the latter, the answer is yes.

As of version 1.2 (February 1995), the amsmath package provides a
\genfrac command through which all the generalized fraction primitives
of TeX are accessible, with a command syntax that is consistent with the
rest of LaTeX. \genfrac takes six arguments (two delimiters, rule
thickness spec, mathstyle override (numeric values 0-3 corresponding to
\displaystyle ... \scriptscriptstyle), numerator, denominator), where if
any of the first four arguments is empty, a default value will be used:
the value that would correspond to \over behavior.

Here is how \frac, \tfrac, and \binom might be defined.

\newcommand{\frac} [2]{\genfrac{} {} {} {} {#1}{#2}}
\newcommand{\tfrac}[2]{\genfrac{} {} {} {1} {#1}{#2}}
\newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{} {#1}{#2}}

\frac is actually defined somewhat differently by amsmath, but that is
just to gain a little execution speed since it is one of the commoner
math commands; functionally the actual definition is exactly equivalent
to the above form.

Thus, to answer your question, you can get any thickness that you want
for the fraction bar by using \genfrac instead of \frac and giving the
desired thickness in the third arg.

In versions 1.0 and 1.1 of amslatex, thickening the fraction bar was
done with an optional arg of the \frac command: \frac[1pt]{...}{...}
would produce a 1pt-thick bar.

If you thicken the fraction bar by a large amount, you will see
something that I think is theoretically speaking another design mistake
in TeX: the space around the fraction bar and the thickness of the bar
are linked, so changing the thickness of the bar to, say 3pt will also
enlarge the space around the bar proportionately, which is to say too
much. Practically speaking, however, this hardly matters since the
effect is relatively harmless for normal ranges of bar thickness, 1pt or
less.

Michael Downes

David Kastrup

unread,
Apr 17, 1996, 3:00:00 AM4/17/96
to
Michael Downes <M...@MATH.AMS.ORG> wrote:
>Here is how \frac, \tfrac, and \binom might be defined.
>
> \newcommand{\frac} [2]{\genfrac{} {} {} {} {#1}{#2}}
> \newcommand{\tfrac}[2]{\genfrac{} {} {} {1} {#1}{#2}}
> \newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{} {#1}{#2}}
>
>\frac is actually defined somewhat differently by amsmath, but that is
>just to gain a little execution speed since it is one of the commoner
>math commands; functionally the actual definition is exactly equivalent
>to the above form.

Well, looking into the source reveals:
\DeclareRobustCommand{\frac}[2]{{#1\@@over#2}}

Which means that AMSLaTeX uses *exactly* the construct which it
forbids all users to employ.

Which means that AMSLaTeX would be incompatible with any package
having similar design goals as AMSLaTeX. And this by choice.

--
David Kastrup, Goethestr. 20, D-52064 Aachen Tel: +49-241-72419
Email: d...@pool.informatik.rwth-aachen.de Fax: +49-241-79502

0 new messages