Payload LogoOctree

Fractions in LaTeX: Complete Guide to Mathematical Notation

Date Published

Fractions in LaTeX

Writing fractions in LaTeX is essential for any mathematical document. Here's everything you need to know.

Basic Fractions with \frac

The standard fraction command:

$\frac{numerator}{denominator}$

Examples:

$\frac{1}{2}$ — one half

$\frac{a}{b}$ — a over b

$\frac{x + 1}{x - 1}$ — expressions

Display Style Fractions (\dfrac)

For larger, more readable fractions:

$\dfrac{1}{2}$

Use \dfrac when fractions appear too small in inline math or subscripts.

Comparison:

$\frac{1}{2}$ vs $\dfrac{1}{2}$

The dfrac version is larger and clearer.

Text Style Fractions (\tfrac)

For smaller fractions in display equations:

$\tfrac{1}{2}$

Useful when you want compact fractions in display mode.

Continued Fractions (\cfrac)

For nested fractions that extend:

$\cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \cdots}}}$

The \cfrac command properly centers numerators in continued fractions.

Nested Fractions

Fractions within fractions:

$\frac{\frac{a}{b}}{\frac{c}{d}} = \frac{ad}{bc}$

For clarity, consider using:

$\frac{a/b}{c/d}$ — slash notation inside

Binomial Coefficients

Using \binom:

$\binom{n}{k} = \frac{n!}{k!(n-k)!}$

Examples:

$\binom{5}{2} = 10$

$\binom{n}{0} = 1$

Partial Fractions

Common in calculus:

$\frac{1}{x^2-1} = \frac{1}{2(x-1)} - \frac{1}{2(x+1)}$

Fractions with Radicals

$\frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2}$

$\frac{a}{\sqrt{b}} = \frac{a\sqrt{b}}{b}$

Slashed Fractions

For inline use, sometimes slashes work better:

$1/2$ — simple slash

$a/b$ — variables

Use the nicefrac package for better-looking slashed fractions:

$\nicefrac{1}{2}$

Common Fraction Formulas

Quadratic Formula

$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$

Derivative Definition

$f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$

Euler's Identity

$e^{i\pi} + 1 = 0$ (no fractions, but iconic!)

Probability

$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$

Styling Tips

Larger Fractions in Display

Use \displaystyle:

$\displaystyle \frac{1}{2}$

Smaller Fractions Inline

Use \textstyle:

$\textstyle \frac{1}{2}$

Spacing Around Fractions

Add space with \, or \;:

$x \, \frac{a}{b} \, y$

Common Mistakes

Wrong: $\frac12$ (missing braces)

Right: $\frac{1}{2}$

Wrong: Nested fractions getting too small

Fix: Use \dfrac for inner fractions

Write Fractions with Octree

Octree makes fractions easy:

- Smart autocomplete for \frac - Real-time preview - AI suggests proper styling - Export perfect PDFs

Try it at https://useoctree.com