
The best Latex editor ▋
LaTeX Tutorial — Lesson 3
Typesetting Math and Tables in LaTeX
Lesson 3: Typesetting Math and Tables in LaTeX
One of the biggest reasons people use LaTeX is its outstanding support for mathematical notation and structured tables. From basic equations to complex formulas and perfectly aligned tables, LaTeX gives you powerful tools to format technical content with precision and elegance.
In this lesson, you’ll learn:
How to write math formulas using math mode
How to format inline and display equations
How to build clean, readable tables using the
tabular
environment
Writing Math in LaTeX
LaTeX uses math mode to typeset formulas. There are two types of math environments:
Inline Math
Used when math appears in the middle of a sentence.
Output: Einstein said E = mc² in his paper.
Wrap the formula in single dollar signs $...$
to render inline.
Display Math
Used when you want to show a formula on its own line, centered and (optionally) numbered.
This displays the famous identity centered on the page. You can also use $$...$$
(an older syntax), or the equation
environment for numbered equations:
You can reference this equation later using:
Math Syntax and Examples
Symbol | Syntax | Output |
---|---|---|
Fractions |
| ½ |
Square root |
| √x |
nth root |
| ⁿ√x |
Superscript |
| x² |
Subscript |
| x₁ |
Combined |
| x²_avg |
Summation |
| ∑ₙ₌₁^∞ n⁻² |
Integral |
| ∫₀¹ x² dx |
Greek letters |
| α, β, π |
Need special symbols? You can find comprehensive symbol sheets online or use tools like Detexify to draw a symbol and get its command.
Creating Tables in LaTeX
LaTeX’s tabular
environment lets you define rows and columns for precise tables.
Basic Table
How It Works:
\begin{tabular}{|c|c|c|}
→ Creates a table with 3 centered columns (c
) and vertical lines (|
)Cells in each row are separated by
&
Each row ends with
\\
\hline
adds horizontal lines
You can change column alignment by replacing c
with:
l
→ left-alignedr
→ right-aligned
Remove |
and \hline
if you prefer no borders.
Table with Header
Use
\textbf{}
for bold headers. Escape the dollar sign as\$
if you’re not in math mode.
Table with Caption and Label
To reference a table and add a caption, wrap it in the table
environment:
\caption{...}
adds a numbered caption under the table\label{...}
lets you reference it later:"See Table~\ref{tab:menu} for the price list."
[h]
suggests placing the table “here” (LaTeX may move it for layout reasons)
Tips for Table Alignment
Each row must have the same number of columns (same number of
&
)\hline
is optional — use it for visual clarityTo nest math inside a table, wrap it in
$...$
like:$x^2$
For larger tables, packages like
tabularx
,longtable
, orbooktabs
can help (covered in advanced lessons)
Recap
In this lesson, you learned how to:
Use inline and display math modes
Format fractions, roots, exponents, Greek letters, and more
Number and reference equations with
\label
and\ref
Build basic tables with borders, headers, and references
Practice by adding a formula and a small table to your Crixet document. Try combining both in one document — maybe a list of formulas in a table?
Up Next
In Lesson 4, we’ll learn how to format and style your document — customizing fonts, adding spacing, aligning content, and more. These tools will help make your document not just functional, but beautiful.
Let’s move on!