Markdown Math Formulas: LaTeX Syntax, Symbols, and Examples
Type formulas in MarkIOY’s source pane and check the result immediately in the visual pane. Start with the two delimiters, then build up LaTeX commands, structure, and a dependable way to debug them.
Need headings, lists, links, and the rest of the format first? Read the Markdown guide.
$...$ for inline math and $$...$$ for a standalone formula. Math is a Markdown extension, so display depends on the renderer. MarkIOY previews common LaTeX expressions with KaTeX: edit the source, then confirm the result in the visual pane.Choose the right math delimiters and layout
Inline math belongs inside a sentence, so it works well for variables, short equations, and a few symbols. Block math occupies its own paragraph, which makes fractions, integrals, matrices, and multi-line content easier to read. Put each block delimiter on its own line and leave a blank line around the block when you can.
The area of a circle is $A = \pi r^2$.The area of a circle is .
$$
\int_a^b f(x)\,\mathrm{d}x = F(b) - F(a)
$$Do not put a formula inside backticks or a fenced code block; that displays the source literally. MarkIOY reliably recognizes $...$ and $$...$$. It does not treat \(...\), \[...\], or a bare \begin{...} as math.
Build expressions with exponents, fractions, and roots
| Purpose | Write | What it does |
|---|---|---|
| Superscript | x^2, x^{n+1} | Use braces whenever the exponent has more than one character |
| Subscript | a_i, a_{i,j} | _ creates a subscript; group multi-character indexes |
| Fraction | \frac{a}{b} | One braced group for the numerator and one for the denominator |
| Root | \sqrt{x}, \sqrt[n]{x} | Put an optional root index in brackets and the radicand in braces |
| Binomial coefficient | \binom{n}{k} | Shows the conventional choose notation |
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$Braces {} group multiple characters. Think of x^n+1 as (x^n)+1; write x^{n+1} when the whole n+1 must be the exponent.
Use symbols, functions, and sets semantically
A backslash \ starts a LaTeX command. If another letter immediately follows a command name, insert a space or braces when needed so it is not read as one longer command.
| Category | Useful commands | Typical use |
|---|---|---|
| Greek letters | \alpha \beta \gamma \theta \lambda \pi \sigma | Parameters, angles, probabilities, and sums |
| Uppercase Greek | \Gamma \Delta \Theta \Lambda \Pi \Sigma \Omega | Sets, changes, and matrices |
| Operators and relations | \times \cdot \div \pm \ne \le \ge | Arithmetic, signs, and comparisons |
| Sets and logic | \in \notin \subseteq \mathbb{R} \forall \exists | Membership, real numbers, and quantifiers |
| Arrows and reasoning | \to \Rightarrow \iff | Limits, implication, and equivalence |
| Functions and operators | \sin \cos \log \ln \max \operatorname{Var} | Upright function names and custom word operators |
$$
\sum_{i=1}^{n}\alpha_i = 1, \qquad
\lim_{x\to0}\frac{\sin x}{x} = 1, \qquad
\int_0^1 x^2\,\mathrm{d}x = \frac{1}{3}
$$Prefer semantic commands such as \sin rather than typing sin. For a multi-letter operator of your own, use \operatorname{Var}(X) to preserve upright letters and natural spacing.
Control brackets, text, and spacing
Plain parentheses are fine for small content. When an expression grows vertically, pair \left and \right to stretch the delimiters. Braces are grouping characters in LaTeX, so write \{ and \} when you want visible braces.
$$
\left(\frac{a}{b}\right), \qquad
\left\{x \middle| x > 0\right\}, \qquad
\langle u, v \rangle
$$Use \text{if } for short prose in a formula, and \mathrm{d}x for an upright unit or differential. These spacing commands cover most situations:
| Command | Effect | Common use |
|---|---|---|
\, | Small space | x\,\mathrm{d}x in an integral |
\; | Wider space | A light separation inside an expression |
\quad, \qquad | Large spaces | Place several expressions side by side |
\! | Negative space | Fine adjustment only; use sparingly |
Write matrices, cases, and aligned equations
Put larger structures inside $$...$$. In matrices and cases, & separates columns and \\ starts a new row; keep the same column count in each row. For several lines of algebra, use aligned and place &= at each equals sign.
$$
A = \begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
$$$$
f(x) = \begin{cases}
x^2, & \text{if } x \ge 0 \\
-x, & \text{if } x < 0
\end{cases}
$$$$
\begin{aligned}
y &= mx+b \\
&= m(x-x_0)+y_0
\end{aligned}
$$Use aligned rather than align: align does not render in current MarkIOY. Break long equations and wide matrices into readable parts, then check them again on mobile and in exported PDF.
Handle escaping, compatibility, and current limits
Both Markdown and LaTeX assign special meanings to characters, so distinguish ordinary text from formula content. Braces usually group content inside a formula, while a dollar sign in prose can accidentally form math when it is paired with a later $.
| You need to show | Recommended source | Why |
|---|---|---|
| A literal price | The price is \$100 | $100$ is interpreted as math |
| Visible braces | \{x \in \mathbb{R}\} | {} normally groups formula content |
| Percent, hash, ampersand | \%, \#, \& | LaTeX commands display the literal characters |
| A backslash | \backslash | Avoids starting an unintended command |
| A dollar sign inside math | $\text{USD }100$ | The dollar-delimited parser cannot handle a $ inside formula content, even \$ |
\tag, \label, \ref, or \ce as portable features. A \newcommand can work within the formula that defines it, but it is not retained by the next formula. For sharing, export HTML/PDF or preview again in the final destination.Use a stable workflow and fix errors quickly
- Wrap the smallest possible expression in
$...$or$$...$$, then add commands gradually - Group multi-character exponents, indexes, numerators, denominators, and radicands with braces
- Use
alignedfor long equations; give every matrix row the same number of&separators - Check the visual preview after each change, then verify the exported HTML/PDF or final publishing platform
- Keep the Markdown source instead of preserving the formula only as an image
The formula is displayed as plain text
Make sure it is enclosed by $...$ or $$...$$, not backticks or a code fence. \(...\) and \[...\] are not parsed as math in MarkIOY.
The preview is incomplete or red
Check that dollar signs, braces, and \begin{...}/\end{...} pairs all match. In matrices and cases, make sure each row has the same number of & separators. MarkIOY keeps an invalid formula visible instead of interrupting editing, so you can fix the source directly.
The formula works in MarkIOY but not where I share it
Math is a Markdown extension, and renderers vary by platform and configuration. If the destination has no math support, send the exported HTML/PDF or verify the syntax there first.
Try a formula in MarkIOY
Open source view and paste any example from this guide. The visual document updates immediately. When you are done, download Markdown or standalone HTML, or print and save as PDF.
Open MarkIOY Web →