# Math Equations in Confluence: LaTeX & KaTeX via Markdown

September 24, 2026 ·

<!-- -->

5 min read

[NGPilot](https://ngpilot.com)

Ask an engineer to document an algorithm in Confluence and watch what happens to the math: `O(n log n)` typed as plain text, `x²` pasted from a character map, and — for anything real — a screenshot from an online equation editor, blurry and already out of date. Confluence has no native LaTeX support, so every formula becomes either a compromise or an image.

It does not have to. With a Markdown macro on the page, Confluence renders real LaTeX — inline `$...$`, display `$$...$$`, fenced blocks with full `align` environments — and the equation stays text: searchable, theme-consistent, editable in seconds. This guide gives you the syntax and copy-paste examples for all three routes.

**Quick answer:** To write math in Confluence, install [Enhanced Markdown for Confluence](https://marketplace.atlassian.com/apps/1237026/enhanced-markdown-for-confluence) and use its Markdown macro. Inline math goes in `$...$`, display equations in `$$...$$`, and fenced blocks — ` ```katex ` for fast CSS rendering or ` ```math ` for full LaTeX via bundled MathJax, including `\begin{align}` and AMS packages. All examples below are copy-paste ready. Free for up to 10 users.

## Why Equations-as-Images Fails Engineering Docs[​](#why-equations-as-images-fails-engineering-docs "Direct link to Why Equations-as-Images Fails Engineering Docs")

A screenshot of a formula is where documentation goes to die:

* **It is not text.** Search cannot find it, an AI assistant summarizing the space cannot read it, and a copy-paste into a ticket loses it.
* **It is instantly stale.** The doc changes, the screenshot does not. Nobody re-runs the export toolchain for a sign flip.
* **It looks wrong.** Different sizes, different fonts, white boxes on dark theme — every one a small tax on the reader's trust.

Rendered math fixes all three at once, because it is *typeset text*. The formula participates in the page — it inherits the theme, it edits like everything else, and `grep`-style tools (and LLMs) can see it.

## Inline Math — the $...$ Workhorse[​](#inline-math--the--workhorse "Direct link to Inline Math — the $...$ Workhorse")

Anything you would set in prose goes in single dollars. Here is a real spec sentence — paste it into the macro:

```
The p95 latency SLO is $300\,\text{ms}$ at the edge. The retry budget is

$2n + 1$ attempts per request, and the scheduler stays $O(n \log n)$

with $k$ workers.
```

Inline math typesets everywhere Markdown flows — sentences, **table cells**, list items, even headings. That last part is the spec-doc unlock: a requirements table can carry `$O(n \log n)$` or `$p < 0.05$` beside the prose with no images and no alignment hacks.

## Display Equations — $$...$$ for the One That Matters[​](#display-equations---for-the-one-that-matters "Direct link to Display Equations — $$...$$ for the One That Matters")

When the equation *is* the paragraph, double dollars center it. Say your section explains an availability SLO and what it implies:

```
A 99.9% availability SLO over a 30-day month allows



$$

2{,}592{,}000\,\text{s} \times (1 - 0.999) = 43.2\,\text{min}

$$



of total downtime — everything else in the section is about spending it well.
```

That paragraph renders as:

![Display equation rendered in Confluence: a 99.9% SLO allows 43.2 minutes of downtime per month](/assets/images/tex-display-budget-4608e6333762d243f26f1bcd6be4ccaa.svg)

Use display math for the one formula a section exists to explain, and keep it rare — a page where every line is a display equation reads like a textbook, not a spec.

## Fenced Blocks — KaTeX for Speed, MathJax for Full LaTeX[​](#fenced-blocks--katex-for-speed-mathjax-for-full-latex "Direct link to Fenced Blocks — KaTeX for Speed, MathJax for Full LaTeX")

For multi-line work, the macro takes fenced blocks, and the fence keyword chooses the engine:

| Fence                                   | Engine                    | Use when                                                   |
| --------------------------------------- | ------------------------- | ---------------------------------------------------------- |
| ` ```katex `                            | KaTeX (CSS-based)         | Instant rendering, everyday equations                      |
| ` ```math ` / ` ```tex ` / ` ```latex ` | MathJax (bundled, no CDN) | Full LaTeX grammar — `align`, AMS packages, exotic symbols |

The aligned derivation is the workhorse: an error-budget check after an incident. Paste this into a ` ```math ` fence:

```
\begin{align}

\text{monthly budget} &= 43.2\,\text{min} \quad (99.9\%\ \text{SLO}) \\

\text{Sep 18 outage} &= -31.6\,\text{min} \\

\text{remaining} &= 43.2 - 31.6 = 11.6\,\text{min} \\

\text{budget left} &\approx 27\% \;\Rightarrow\; \text{freeze risky deploys}

\end{align}
```

And here is that block rendered on the page:

![Aligned derivation rendered in Confluence: error budget after an outage, ending at a deploy freeze](/assets/images/tex-error-budget-09d50e5874b9cb9e1601a1b2c8a241ba.svg)

Every step on its own row, the relations running down one column — the derivation reads top-to-bottom like a whiteboard photo taken by someone organized. Swap in your own SLO numbers and it edits in plain text — no re-exporting anything when the outage math changes.

## Copy-Paste Starter Kit[​](#copy-paste-starter-kit "Direct link to Copy-Paste Starter Kit")

Three patterns that cover most engineering docs:

**SLO bound in a sentence** (inline): `Error rate stays below $0.1\%$ while the burn rate is $< 2\times$.`

**Model quality** (KaTeX fence) — precision and F1 for an eval report:

```
P = \frac{TP}{TP + FP} \qquad

F_1 = \frac{2 \cdot P \cdot R}{P + R}
```

![Precision and F1 formulas rendered in Confluence](/assets/images/tex-precision-f1-b279206279b4754fb608ffba3811f52a.svg)

**Aligned derivation** (MathJax fence): the error-budget block above — swap in your own numbers.

All three survive copy-paste between pages, which is more than any screenshot can say.

## Which Route for Which Equation?[​](#which-route-for-which-equation "Direct link to Which Route for Which Equation?")

| Need                                         | Syntax                | Renders via   |
| -------------------------------------------- | --------------------- | ------------- |
| Symbol in a sentence, table cell, or heading | `$...$`               | KaTeX inline  |
| The one centered formula of a section        | `$$...$$`             | KaTeX display |
| Multi-line derivation with aligned operators | ` ```math ` + `align` | MathJax       |
| Quick common equations, fastest render       | ` ```katex `          | KaTeX         |

The pattern to remember: dollars for prose, fences for blocks, `katex` for speed, `math` for the full LaTeX grammar. Install [Enhanced Markdown for Confluence](https://marketplace.atlassian.com/apps/1237026/enhanced-markdown-for-confluence), paste the `align` example into your next spec, and retire the screenshot pipeline.

## Related Guides[​](#related-guides "Direct link to Related Guides")

* [How to Write Markdown in Confluence](/blog/how-to-write-markdown-in-confluence.md) — the base syntax the math lives inside
* [Create Mermaid Diagrams in Confluence](/blog/create-mermaid-diagrams-confluence.md) — the same macro renders diagrams from fenced blocks
* [Enhanced Markdown for Confluence](/apps/enhanced-markdown-for-confluence.md) — full app details: split preview, tables, code, math

Try <!-- -->Enhanced Markdown for Confluence

Write Markdown with live split preview, Mermaid diagrams, KaTeX/LaTeX math, and 190+ code languages — all in one macro, free for up to 10 users.

[Get it on the Atlassian Marketplace](https://marketplace.atlassian.com/apps/1237026/enhanced-markdown-for-confluence?utm_source=ngpilot.com\&utm_medium=website\&utm_campaign=enhanced-markdown-for-confluence)

## Related guides

* [How to Create Mermaid Diagrams in Jira](/blog/how-to-create-mermaid-diagrams-jira.md)
* [Export Jira Issues to Excel or CSV](/blog/export-jira-issues-to-excel.md)
* [Bulk Download Jira Attachments](/blog/bulk-download-jira-attachments.md)
* [How to Migrate Confluence Content](/blog/how-to-migrate-confluence-content.md)
* [How to Add a Block Quote in Confluence](/blog/block-quote-confluence.md)

Explore NGPILOT[Browse Solutions](/solutions.md)[All Apps](/apps.md)[Atlassian Marketplace →](https://marketplace.atlassian.com/vendors/1226848/?utm_source=ngpilot.com\&utm_medium=blog\&utm_campaign=hub-links)

**Tags:**

* [confluence](/blog/tags/confluence.md)
* [markdown](/blog/tags/markdown.md)
* [latex](/blog/tags/latex.md)
* [katex](/blog/tags/katex.md)
* [mathjax](/blog/tags/mathjax.md)
* [math](/blog/tags/math.md)
* [how-to](/blog/tags/how-to.md)
* [engineering](/blog/tags/engineering.md)
