Math rendering
ScaiWave renders math via KaTeX anywhere markdown does — chat bubbles, note preview, and a live in-editor preview while you're typing.
Delimiters#
Four supported delimiters; pick whichever fits:
| Delimiter | Mode | Example |
|---|---|---|
$…$ |
Inline | $E = mc^2$ |
$$…$$ |
Display (centred, large) | $$\int_0^\infty x\,dx$$ |
\(…\) |
Inline (LaTeX-style) | \(\sum_i x_i\) |
\[…\] |
Display (LaTeX-style) | \[\frac{a}{b}\] |
Where it works#
- Chat bubbles — type math in the composer; renders on send.
- Note preview — same.
- In-editor live preview — while typing math in a note, the rendered equation appears in place. Move the cursor into the range → back to source mode for editing. Move out → back to rendered.
Inline-vs-display disambiguation#
$ is ambiguous with dollar amounts. ScaiWave applies the standard
rule:
$5isn't math — a digit follows immediately.$ 5isn't math — a space follows immediately.$x$is math — neither.
So It costs $5 to $10 renders as written; the variable $x$ is positive renders the x as math.
Markdown interactions#
A common gotcha with math in markdown: underscores. $x_1$ is math
($x_1$); but markdown wants _1_ to be italic. ScaiWave extracts
math from the source before markdown sees it, then re-injects the
rendered HTML — so $x_1$ always renders correctly, regardless of
whether your renderer would have eaten the underscores.
Copy-paste round-trip#
Right-click any rendered equation → Copy as source. The underlying TeX comes back. KaTeX annotates the rendered output with the original source so this works even after copy-pasting through non-ScaiWave intermediaries.
Error tolerance#
KaTeX is configured with throwOnError: false. A syntax error in
your math renders the source as a red error box but doesn't break
the surrounding content.
trust: false — \href, \includegraphics, and similar commands
that could exfiltrate URLs are disabled. Plain math is fine.
Examples#
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Code-fence interaction#
Math inside fenced code blocks is not rendered. Use a fence when you want the literal source:
1 2 3 | |