Fractions and roots\frac

\fracCommand

Standard fractions in mathematical expressions, derivations, and formulas.

\frac{a}{b}
Available in
ams, base
Kind
prefix
Allowed mode
math
Frequency
38.65% of corpus formulasrank 1 of 263
Commonality
high
Renderer support
PackageMathJaxKaTeXXeTeX
amsMathJax: FullKaTeX: FullXeTeX: Full
baseMathJax: FullKaTeX: FullXeTeX: Full
About the test scope

Syntax#

\fracm{a}math contentm{b}math content

Argspec m m — two mandatory arguments. Same argspec in ams and base. Reading argspecs

Common tasks#

How to write a fraction with large operands#

Use \dfrac when the fraction should stay display-sized.

\dfrac{a}{b}

How to write a compact inline fraction#

\tfrac{a}{b}

How to write a nested fraction#

\frac{1+\frac{a}{b}}{1-\frac{a}{b}}

How to write a derivative as a fraction#

\frac{dy}{dx}

Examples#

base

\frac12

Package variants#

PackageSignatureAllowed modeNotes
amsm mmathStandard fractions in mathematical expressions, derivations, and formulas.
basem mmathUsed for fractions in mathematical expressions and derivations

In TeXForm#

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

Equivalent forms#

  • \genfrac{}{}{}{}{#1}{#2}exact

    This is the AMS mapping's fixed-parameter specialization of \genfrac with empty delimiters, empty thickness, and empty style.

  • a \over bapproximate

    \over is an infix primitive with different grouping scope; \frac is preferred in LaTeX

  • {a \over b}exact

    Primitive infix form (discouraged in modern LaTeX)

  • \dfrac{a}{b}approximate

    Forces display style

See also#

Test cases#

ams
InputCaseMathJaxKaTeXXeTeX
\frac{a}{b}Positive · baselinePassPassPass
\frac a{b}Positive · bare[0]PassPassPass
\frac{a}bPositive · bare[1]PassPassPass
base
InputCaseMathJaxKaTeXXeTeX
\frac{a}{b}Positive · baselinePassPassPass
\frac a{b}Positive · bare[0]PassPassPass
\frac{a}bPositive · bare[1]PassPassPass
All 21 in Fractions and roots