---
title: "Math notation"
description: "KaTeX-powered LaTeX in Carina docs — inline, display, matrices, and complex AMS layouts."
source: https://carina.nebutra.com/reference/math/
---

# Math notation

> KaTeX-powered LaTeX in Carina docs — inline, display, matrices, and complex AMS layouts.

Carina docs render LaTeX with **[KaTeX](https://katex.org/)** at build time.

- **Inline:** wrap with single dollars — `$E = mc^2$` → $E = mc^2$
- **Display:** double dollars on their own lines
- **Escape hatch:** `<Math formula="..." />` for programmatic / very dense expressions

## Limits of KaTeX

  KaTeX covers the vast majority of AMS math used in engineering docs. It does **not** run a full TeX engine (no arbitrary packages, limited TikZ). If you hit an unsupported construct:

  1. Simplify the expression, or  
  2. Use a diagram (Mermaid) / figure for structure, or  
  3. Pre-render to SVG offline and embed with `<Frame>`.

  We intentionally did **not** ship full MathJax by default — it is heavier and rarely needed here.

## Authoring cheatsheet

| Need | Syntax |
| --- | --- |
| Inline | `$a_i$` |
| Display | `$$ … $$` on its own lines |
| Align | `\begin{aligned} … \end{aligned}` inside `$$` |
| Matrix | `\begin{pmatrix} … \end{pmatrix}` |
| Cases | `\begin{cases} … \end{cases}` |
| Component | `<Math formula={String.raw`…`} />` |

Dollar signs inside **code fences** are not math — they stay literal.

## Source of truth

- Rendering: KaTeX pipeline in `apps/docs` (Starlight + rehype)
- Authoring: `apps/docs/AUTHORING.md` · component `<Math>`
- Not a product feature of the runtime — docs-only

## Next

- [Authoring components](/reference/math/) stay here; product path starts at [Overview](/getting-started/introduction/)

---
Source: https://carina.nebutra.com/reference/math/
Markdown: https://carina.nebutra.com/reference/math/index.md
