Fraction in LaTeX
A fraction is written as \frac{numerator}{denominator}. Inside a sentence LaTeX shrinks the fraction so it does not stretch the line; when you want full height, use \dfrac from the amsmath package.
Simple fraction
\frac{a}{b}Full height inside a line of text
$\dfrac{1}{2} mv^2$Nested fraction
\frac{1}{1 + \frac{1}{x}}Slashed fraction (in an exponent)
x^{1/2}Common mistakes
- Missing braces: \frac12 works for single digits, but \frac 10 2 does not.
- Using \dfrac in a superscript, where the fraction becomes too large. Write a/b there instead.
See also
Don't want to memorize commands?
Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.