Write maths in your notes with $ and $$

Loam typesets maths where you write it. Put TeX between dollar signs, and when the cursor moves away the formula turns into proper notation. The note stays plain text, so the source is still there when you export it. Rendering uses KaTeX, and it works in the desktop app, the web app and the iPhone, iPad and Android apps.

Inline formulas

Wrap a formula in single dollar signs inside a sentence:

The period of a pendulum is $T = 2\pi\sqrt{L/g}$, and its energy is $E = mc^2$ at rest.

Move the cursor into a formula and its TeX appears so you can edit it. Move away and it renders again.

Loam only treats $ as maths when it looks like maths, so prices are safe. A formula needs no space just inside either dollar sign, and the closing $ can’t be followed by a digit. That means It costs $5 now and $10 later stays ordinary text. If a dollar sign ever gets read as maths by mistake, put a backslash in front of it (\$) and it prints as a plain dollar sign.

Display equations

For an equation on its own line, put $$ on a line by itself, write the formula below it, and close with another $$ line:

$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

Both $$ markers need a line of their own. A one-line $$ x^2 $$ is not display maths and stays as text.

While the cursor is inside the block, the TeX stays visible with the result drawn underneath, so you can adjust it and watch the equation change. Move out and the equation replaces the source. If you turn off Hide Markdown in Settings › Editor, the source stays visible and the equation sits below it.

Several lines work too. Use aligned to line up the equals signs:

$$
\begin{aligned}
\bar{x} &= \frac{1}{n}\sum_{i=1}^{n} x_i \\
s^2 &= \frac{1}{n-1}\sum_{i=1}^{n} (x_i - \bar{x})^2
\end{aligned}
$$

The TeX you will use most

You want You type
A fraction \frac{a}{b}
A power x^2, or x^{10} for several characters
A subscript x_i, or x_{max}
A square root \sqrt{x}
A sum \sum_{i=1}^{n} x_i
An integral \int_0^1 x^2\,dx
A Greek letter \alpha, \pi, \Delta
Words inside a formula \text{rate}
A matrix \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

KaTeX covers most everyday TeX maths commands, and its documentation lists every function it supports.

A worked example

Here is a short lab note that mixes prose, a display equation and numbers:

# Pendulum lab

Period of a simple pendulum: $T = 2\pi\sqrt{L/g}$

Solving for gravity:

$$
g = \frac{4\pi^2 L}{T^2}
$$

With $L = 0.50$ m and $T = 1.42$ s, $g \approx 9.79$ m/s².

Tag it #physics/labs and it sits with your other lab notes. Link it from a course note with [[Pendulum lab]], and when you’re online the lab note’s Linked from list shows that course note.

On a phone or tablet

You type the same characters. Neither the formatting toolbar on a computer nor the format bar above a phone keyboard has a maths button, so the dollar signs and backslashes come from your keyboard. On most phone keyboards the backslash is on the symbols page.

What publishing does

A published note is a read-only web page, and it shows maths as source. An inline formula appears as code, and a $$ block appears as a code block, so readers see the TeX rather than a typeset equation. Keep that in mind before you publish a note full of equations. Publishing is a Loam Pro feature, and only the note’s owner can turn it on.

Maths is free on every plan. Loam Pro adds sync across devices, collaboration, full version history, AI agents and publishing.