Mathematical Typesetting
How to Write Fractions in LaTeX
LaTeX excels at typesetting mathematical fractions. Here are the different commands for various contexts.
Basic Fraction
Use \frac{numerator}{denominator}:
$\frac{1}{2}$
$\frac{x+1}{x-1}$
$\frac{a^2 + b^2}{c^2}$Display Style Fraction
Use \dfrac for larger fractions (needs amsmath package):
\usepackage{amsmath}
$\dfrac{1}{2}$ % larger than \fracText Style Fraction
Use \tfrac for smaller fractions in display equations:
\[ \tfrac{1}{2} + \tfrac{1}{3} = \tfrac{5}{6} \]Nested Fractions
Fractions can be nested inside each other:
$\frac{1}{1 + \frac{1}{x}}$💡 Tips
- •Use \dfrac in displayed equations for better readability
- •For inline fractions like ½, consider 1/2 or the nicefrac package
- •Avoid deeply nested fractions—they become hard to read
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free