Introduction

Welcome back to Writing Math in LaTeX! In the first two lessons of this course, you learned how to enter math mode and how to write subscripts and superscripts. With those tools in hand, you are already capable of expressing a wide range of notation. Now, in this third lesson — the halfway point of the course — we turn to one of the most recognizable structures in all of mathematics: fractions. By the end of this lesson, you will know how to typeset fractions with the \frac command, nest fractions within fractions, mix fractions into larger expressions, and understand how their appearance changes between inline and display modes.

Why Fractions Need Special Treatment
The \frac Command
Inline Versus Display Fractions
Nested Fractions
Fractions in Compound Expressions
Common Mistakes to Avoid
Conclusion and Next Steps

In this lesson, we explored the \frac command and its two required arguments for building fractions in LaTeX. We compared how fractions render in inline versus display mode, practiced nesting one fraction inside another, and saw how fractions combine naturally with subscripts, superscripts, and other terms in larger expressions. Careful brace management is the key skill here, especially as nesting depth increases.

Now it is time to put these ideas into practice. Head over to the exercises, where you will build fractions from the ground up — starting with simple ratios, comparing inline and display rendering, and working your way to nested, compound expressions. In the next lesson, we will move on to square roots, adding yet another essential piece to your math typesetting toolkit.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal