Technical writing

How to Write Math in Markdown

By KenRich ยท Last updated: October 1, 2026

Markdown can handle useful math notes when the formula, explanation, and preview stay close together. This guide shows a practical way to write equations for study notes, engineering drafts, product analysis, and technical docs.

The quick answer

Use inline math when the expression belongs inside a sentence. Use block math when the equation needs its own line and should be checked carefully.

In VeloWrite, write inline formulas with single dollar signs and block formulas with double dollar signs. The preview renders formulas with KaTeX, a fast TeX-compatible math renderer. KaTeX documents its supported functions and symbols in its official support table, so unsupported LaTeX commands should be simplified before sharing.

Inline and block math
Markdown input
The energy relation $E = mc^2$ is short enough for one sentence.

A longer equation is easier to review as a block:

$$a^2 + b^2 = c^2$$
Rendered preview

The energy relation $E = mc^2$ is short enough for one sentence.

A longer equation is easier to review as a block:

$$a^2 + b^2 = c^2$$

NoteUse inline math for small expressions and block math when the equation needs attention.

Choose inline or block math by reading flow

The choice is not only visual. Inline math keeps a small expression attached to the sentence. Block math tells the reader to stop and inspect the formula.

A useful rule: if you need to explain the formula after writing it, give it a block. If it only names a variable, unit, or short relationship, inline is usually enough.

Reading flow
Markdown input
Use $r$ for the monthly growth rate.

The projected value after $t$ periods is:

$$P_t = P_0(1+r)^t$$

This works when growth is compounded at the same rate each period.
Rendered preview

Use $r$ for the monthly growth rate.

The projected value after $t$ periods is:

$$P_t = P_0(1+r)^t$$

This works when growth is compounded at the same rate each period.

NoteThe source stays readable, and the preview gives the equation room.

What the common math characters mean

The source looks unfamiliar until each character has a job. `$` starts or ends math, `^` moves the next group up as a superscript, and `_` moves the next group down as a subscript. Use braces when the superscript or subscript has more than one character.

A backslash introduces a command. `\frac{a}{b}` makes a fraction, `\sqrt{x}` makes a root, and `\sum_{i=1}^{n}` makes a sum with lower and upper limits. Operators such as `\cdot` add a centered multiplication dot, while names such as `\alpha` and `\pi` produce Greek letters.

Build a formula in small steps. First check `$x^2$`, then `$x_i$`, then `$x_i^2$`. If the combined expression renders correctly, add the next command. This makes a missing brace or delimiter much easier to find.

Read the source step by step
Markdown input
Start with a variable: `$x$`

Add a superscript: `$x^2$`

Add a subscript and group the exponent: `$x_i^{10}$`

Add an operator: `$E = m \cdot c^2$`

Add a fraction: `$\frac{a+b}{c}$`
Rendered preview

Start with a variable: $x$

Add a superscript: $x^2$

Add a subscript and group the exponent: $x_i^{10}$

Add an operator: $E = m \cdot c^2$

Add a fraction: $\frac{a+b}{c}$

NotePreview each small change before combining it with the rest of the equation.

Explain variables near the equation

Most formula-heavy notes fail because the symbols are not explained where readers need them. Keep a short variable list close to the equation instead of assuming people will remember earlier definitions.

For classroom notes, define the variables before the example. For engineering notes, define the variables before the decision. For product analysis, define the variables before the conclusion.

Variable list
Markdown input
We estimate activated users from visitors and activation rate:

$$A = V \times r$$

| Symbol | Meaning |
| --- | --- |
| $A$ | Activated users |
| $V$ | Visitors |
| $r$ | Activation rate |
Rendered preview

We estimate activated users from visitors and activation rate:

$$A = V \times r$$

Symbol Meaning
$A$ Activated users
$V$ Visitors
$r$ Activation rate

NoteA small table is easier to reread than a paragraph full of repeated definitions.

Watch for the mistakes that break math preview

Most rendering problems come from small syntax mistakes: one missing closing dollar sign, an unclosed brace, a command that KaTeX does not support, or a dollar sign used for currency inside a normal sentence.

If a document mixes prices and formulas, write currency in words or escape the dollar sign when needed. Keep long formulas out of table cells unless the table is only a compact symbol reference.

Safer currency text
Markdown input
The price is USD 29 per year, not a math expression.

The annual revenue estimate is:

$$ARR = customers \times price$$
Rendered preview

The price is USD 29 per year, not a math expression.

The annual revenue estimate is:

$$ARR = customers \times price$$

NoteClear prose around formulas prevents accidental math parsing.

Use preview as a formula checker

Math preview is useful because it catches errors while you still see the source. Split view is the fastest mode for this: the left side keeps the Markdown, and the right side shows whether the formula, table, and surrounding explanation render correctly.

Before exporting or sharing a technical document, scan every block formula, every variable table, and every paragraph that uses inline math. A rendered formula should support the sentence, not hide a missing explanation.

Review checklist
Markdown input
## Math review

- [ ] Inline math is short
- [ ] Block formulas render correctly
- [ ] Variables are explained nearby
- [ ] Currency is not parsed as math
- [ ] The conclusion is written in plain language
Rendered preview

Math review

  • [ ] Inline math is short
  • [ ] Block formulas render correctly
  • [ ] Variables are explained nearby
  • [ ] Currency is not parsed as math
  • [ ] The conclusion is written in plain language

NoteA small review checklist catches the most common math-document mistakes.

How VeloWrite can help someone writing formulas

Today, VeloWrite helps by keeping the source and rendered result together. The web editor is useful for a quick formula check, while the desktop app is better for local study notes, research drafts, engineering docs, and documents that need history snapshots.

The next useful helpers are practical, not flashy: a math snippet menu for common expressions, a visible warning when a delimiter is unclosed, a small variable-table template, and export checks that compare the preview with PDF and HTML output.

Those helpers fit the preview direction because they improve normal Markdown writing. More advanced AI formula explanation or automatic derivation cleanup can wait for the Pro roadmap after the basic editing experience stays reliable.

Reusable math-note template
Markdown input
# Math Note

## Problem

State the problem in plain language.

## Formula

$$y = mx + b$$

## Variables

| Symbol | Meaning |
| --- | --- |
| $m$ | Slope |
| $b$ | Intercept |

## Conclusion

Write what the formula means for this document.
Rendered preview

Math Note

Problem

State the problem in plain language.

Formula

$$y = mx + b$$

Variables

Symbol Meaning
$m$ Slope
$b$ Intercept

Conclusion

Write what the formula means for this document.

NoteA template is often more helpful than a longer syntax chart.

Continue with VeloWrite

Try Math Preview

Read KaTeX Guide