Tutorials

LaTeX Syntax Guide: A Beginner's Introduction to Formula Typesetting

A beginner-friendly LaTeX tutorial covering math formulas, subscripts, superscripts, fractions, matrices, Greek letters, and how to use LaTeX directly inside Mind Elixir mind maps.

Published on June 24, 2026
8 min read
The Mind Elixir Team
LaTeXMathTypesettingTutorialKaTeX

LaTeX is one of the most widely used typesetting systems in academia, especially for mathematical notation. Whether you're writing a paper, organizing lecture notes, or recording formulas in a mind map, knowing basic LaTeX syntax will make your content more professional and readable.

This guide starts from the very basics and walks you through the core LaTeX syntax step by step.

1. The Basics: Inline and Display Formulas

There are two ways to render LaTeX formulas:

  • Inline formulas are embedded within text, wrapped in single $. For example, $E = mc^2$ renders as E=mc2E = mc^2.
  • Display formulas stand alone on their own line, centered, and wrapped in double $$. For example:
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$

This renders as:

ex2dx=π\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}

Inline formulas flow naturally within sentences. Display formulas are best for standalone expressions that deserve emphasis.

2. Superscripts and Subscripts

Superscripts and subscripts are the most common math formatting needs:

  • Superscript with ^: $x^2$ renders as x2x^2
  • Subscript with _: $a_n$ renders as ana_n
  • Wrap multiple characters in curly braces: $x^{2n+1}$ renders as x2n+1x^{2n+1}
  • Use both together: $a_i^2$ renders as ai2a_i^2

Common Examples

Input Result Description
$x^2$ x2x^2 Squared
$a_{i,j}$ ai,ja_{i,j} Double subscript
$e^{-x^2}$ ex2e^{-x^2} Negative exponent
$10^{3}$ 10310^{3} Scientific notation

3. Fractions and Roots

  • Fraction: $\frac{numerator}{denominator}$. For example, $\frac{a}{b}$ renders as ab\frac{a}{b}.
  • Square root: $\sqrt{content}$. For example, $\sqrt{x^2 + y^2}$ renders as x2+y2\sqrt{x^2 + y^2}.
  • Nth root: $\sqrt[n]{x}$ renders as xn\sqrt[n]{x}.

Fractions can be nested: $\frac{1}{1+\frac{1}{x}}$ renders as 11+1x\frac{1}{1+\frac{1}{x}}.

4. Greek Letters

Greek letters are ubiquitous in math and physics. In LaTeX, they are written as a backslash followed by the letter name:

Lowercase

Syntax Letter Syntax Letter
\alpha α\alpha \beta β\beta
\gamma γ\gamma \delta δ\delta
\epsilon ϵ\epsilon \theta θ\theta
\lambda λ\lambda \mu μ\mu
\pi π\pi \sigma σ\sigma
\phi ϕ\phi \omega ω\omega

Uppercase

Uppercase Greek letters are typically capitalized: $\Gamma$, $\Delta$, $\Theta$, $\Lambda$, $\Sigma$, $\Phi$, $\Omega$.

5. Summation, Integrals, and Limits

Summation

$$\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n$$

This renders as:

i=1nxi=x1+x2++xn\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n

Integrals

$$\int_a^b f(x) \, dx$$

This renders as:

abf(x)dx\int_a^b f(x) \, dx

Multiple integrals: $\iint$ (double), $\iiint$ (triple), $\oint$ (contour).

Limits

$$\lim_{x \to \infty} \frac{1}{x} = 0$$

This renders as:

limx1x=0\lim_{x \to \infty} \frac{1}{x} = 0

Products and Conditional Sums

  • Product: $\prod_{i=1}^{n} a_i$
  • Conditional sum: $\sum_{\substack{i=1 \\ i \neq k}}^{n} x_i$

6. Common Math Symbols

Relation Symbols

Syntax Symbol Syntax Symbol
\leq \leq \geq \geq
\neq \neq \approx \approx
\equiv \equiv \sim \sim
\in \in \subset \subset

Operators

Syntax Symbol Syntax Symbol
\times ×\times \div ÷\div
\pm ±\pm \mp \mp
\cdot \cdot \nabla \nabla

Arrows

Syntax Symbol
\rightarrow or \to \to
\leftarrow \leftarrow
\Rightarrow \Rightarrow
\Leftrightarrow \Leftrightarrow

7. Matrices

Matrices use the matrix, pmatrix (parentheses), or bmatrix (brackets) environments:

$$\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}$$

This renders as:

[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}

Determinants use vmatrix:

$$\begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc$$

This renders as:

abcd=adbc\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc

8. Piecewise Functions and Systems of Equations

Use the cases environment for piecewise functions or systems of equations:

$$f(x) = \begin{cases}
x^2 & \text{if } x \geq 0 \\
-x^2 & \text{if } x < 0
\end{cases}$$

This renders as:

f(x)={x2if x0x2if x<0f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x^2 & \text{if } x < 0 \end{cases}

The \text{} command inserts plain text inside a formula.

9. Standard Functions and Operators

LaTeX provides dedicated commands for common math functions, ensuring they appear in upright (roman) type rather than italics:

Syntax Result Syntax Result
\sin sin\sin \cos cos\cos
\log log\log \ln ln\ln
\exp exp\exp \max max\max
\min min\min \det det\det

Compare: $sin x$ (wrong, italic) vs $\sin x$ (correct, upright).

10. Scaling Delimiters

Parentheses, brackets, and other delimiters can be automatically sized using \left and \right:

$$\left( \frac{a}{b} \right)^2$$

This renders as:

(ab)2\left( \frac{a}{b} \right)^2

Available delimiters: ( ), [ ], \{ \}, |, \|.

11. Accents and Annotations

  • Accents: $\hat{x}$ (x^\hat{x}), $\bar{x}$ (xˉ\bar{x}), $\vec{v}$ (v\vec{v}), $\dot{x}$ (x˙\dot{x})
  • Brace annotations: $\overbrace{a+b+c}^{total}$, $\underbrace{a+b+c}_{three terms}$

12. Chemical Formulas (mhchem Extension)

If your renderer supports mhchem (such as KaTeX with the mhchem plugin), you can easily typeset chemical formulas using \ce{}:

  • Molecular formulas: $\ce{H2O}$, $\ce{CO2}$
  • Reaction equations: $\ce{2H2 + O2 -> 2H2O}$
  • Ions: $\ce{SO4^2-}$

Using LaTeX in Mind Elixir

All of the syntax above works directly inside Mind Elixir mind map nodes. Mind Elixir has a built-in KaTeX rendering engine and the mhchem chemistry plugin — just wrap your formulas in $ or $$ within any node text.

This means you can:

  • Organize lecture notes by writing formulas directly in nodes, no screenshots or handwriting needed
  • Build math knowledge maps, structuring theorems and derivations clearly in a mind map
  • Record chemical reaction equations quickly using mhchem syntax
  • Model engineering or physics problems, visualizing key formulas and parameter relationships

The tree structure of mind maps is a natural fit for showing hierarchical knowledge, and LaTeX support upgrades your mind maps from "text outlines" to "academic-grade knowledge cards."

Try creating a new node in Mind Elixir and typing $E = mc^2$ — see for yourself.