How to test a LaTeX notes app with eight formulas
You have a page of equations to write up tonight, and the notes app on your phone says it supports LaTeX. That phrase covers four different implementations, and the gap between them shows up on the third formula.
x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}
The bar sits between the two parts, not beside them.Paste eight test formulas into the app and look at what comes back. Nested fractions, a sum with its limits above and below, a pmatrix, stretchy brackets, an align block, a cases split, a \def macro and an \ce chemistry string separate a real LaTeX notes app from one that draws a few inline fractions. Flat text or an uneditable picture is a fail.
Paste these eight formulas and read what comes back
The check takes under a minute and needs no account. Copy the block below into a new note in whatever app you are judging, one snippet at a time or all at once, and compare the result against the line that follows each snippet. Every snippet here is valid LaTeX that KaTeX renders, so a failure is the app rather than the input.
LATEX SELF-TEST FOR A NOTES APP
Paste one block at a time. Compare against the CORRECT line.
1. NESTED FRACTIONS
\frac{1}{1 + \frac{1}{1 + \frac{1}{x}}}
CORRECT: three stacked fraction bars, each inner one shorter and set in
a smaller size than the bar outside it.
2. OPERATOR WITH LIMITS
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
CORRECT: in display mode the n=1 and the infinity sit directly under and
over the sigma, not to its right, and the sigma is taller than the text
around it.
3. MATRIX ENVIRONMENT
\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} =
\frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
CORRECT: two rows, round brackets grown to the full height of the
matrix, and the -1 raised at the top right of the closing bracket.
4. STRETCHY DELIMITERS
\left( \sum_{i=1}^{n} a_i b_i \right)^2 \le
\left( \sum_{i=1}^{n} a_i^2 \right) \left( \sum_{i=1}^{n} b_i^2 \right)
CORRECT: every bracket grown to the height of the sum it holds, and both
brackets in a pair drawn at the same height.
5. ALIGNMENT
\begin{align}
(a+b)^2 &= a^2 + 2ab + b^2 \\
(a-b)^2 &= a^2 - 2ab + b^2
\end{align}
CORRECT: one block of two lines whose equals signs sit in the same
column.
6. CASE SPLIT
f(x) = \begin{cases}
x^2 & \text{if } x \ge 0 \\
-x^2 & \text{if } x < 0
\end{cases}
CORRECT: a single brace spanning both rows, upright roman text in the
two conditions, and the conditions in a column of their own.
7. MACRO DEFINITION
\def\dd#1{\mathrm{d}#1}
\int_0^1 x^2 \dd{x} = \frac{1}{3}
CORRECT: the macro expands, so an upright d appears before the x, with 0
and 1 on the integral sign.
8. CHEMISTRY
\ce{H2SO4 + 2NaOH -> Na2SO4 + 2H2O}
CORRECT: subscript digits, upright element symbols rather than italic
variables, and a full reaction arrow.
AFTER THE EIGHT
- Put the caret inside a rendered formula and select one character. If
you cannot, the formula is a picture.
- Switch the system to dark mode. A formula that stays black has a light
background baked into it.
- Set the note to its largest font size. A picture goes soft. A typeset
formula stays sharp. Download text fileRead the failures rather than the successes. Snippet 1 tells you whether the app does typesetting or string substitution. Snippet 3 and snippet 6 are where a renderer built on a short substitution table stops. Snippet 7 is the line between a LaTeX parser and a LaTeX-looking display, because an app that ignores \def prints the literal text or throws a parse error. Snippet 8 needs mhchem, a package layered on the core math grammar, so an app can pass the first seven and still fail the last one.
Four things an app can mean by LaTeX support
Two apps can both print LaTeX on their feature page and behave nothing alike. Each of the four implementations below fails in a way you can see from the outside, without reading anyone’s source code.
| Level | How it works | How to spot it | Where it bites |
|---|---|---|---|
| Inline subset | A short substitution table covers fractions, superscripts and Greek letters between dollar signs | Snippet 3 comes back with the word pmatrix still visible, or as one run-on line | The first matrix, integral or case split you write down |
| Rendered image | The LaTeX goes to a converter and returns a bitmap or an SVG placed in the note | You cannot put the caret inside the formula, and the image goes soft at a larger font size | Dark mode leaves black glyphs on a dark page, and an edit means retyping the source |
| Browser engine | A hidden WebView runs KaTeX or MathJax in JavaScript | The first formula of a session appears a beat after the rest of the note | 50–150 MB RAM for the WebView, and startup latency before that first formula |
| Native engine | TeX box-and-glue rules run in the app’s own code with no browser in the loop | Formulas draw as the row scrolls into view and change color with the system appearance | Coverage becomes the open question instead of speed, so run the eight snippets anyway |
The figures in the third row come from the SwaTex README, which describes the usual cross-platform arrangement as a hidden WebView eating 50–150 MB RAM, startup latency before the first formula, no offline guarantee. That is the price of reusing a JavaScript library the app did not write. The fourth level costs far more to build and takes the browser out of the page.
What a native typesetting engine does differently
Phrase renders math with SwaTex, a KaTeX-compatible math rendering engine in pure Swift, with no JavaScript, no WebView and no DOM. It is MIT-licensed, public at github.com/PhraseHQ/SwaTex, and a ground-up Swift port of RaTeX, the Rust KaTeX-compatible math renderer. SwaTex renders every formula in Phrase’s AI notes. Its layout engine drives TeX’s box-and-glue rules from the bundled KaTeX font metrics, not from platform text APIs, so output matches KaTeX and RaTeX glyph-for-glyph.

Coverage is 1007 of 1008 entries in the official KaTeX support table. That set includes the environments pmatrix, align, cases and CD, along with stretchy delimiters, accents and macros such as \def, \newcommand and \expandafter. Chemistry is full mhchem support via \ce and \pu, from a state-machine port verified byte-identical to RaTeX on a 253-case corpus. Proof trees use bussproofs-style prooftree for inference rules and sequent calculi. Snippets 3, 5, 6, 7 and 8 above all sit inside that set.
The speed numbers below were measured against the Rust reference engine on identical corpora, same machine, median of 3 runs, with all 2,541 golden formulas bit-exact between the engines. Every number is reproducible with the commands in the repository’s BENCHMARKS.md.
| Workload | RaTeX (Rust) | SwaTex |
|---|---|---|
| parse to layout to display list | 41.4 µs/formula | 12.5 µs/formula (3.3×) |
| PNG batch, 100 formulas @40px 2× | ~200 µs/formula | 34 µs effective (parallel, 5.9×) |
| Repeated formula, editor cache hit | 41.4 µs | 105 ns (~390×) |
| Editor scroll | No equivalent figure | 0 glyph rasterization (updateLayer) |
Parity is checked rather than asserted. The repository ships scripts/diff_layout.py, which diffs the LayoutDump tool against RaTeX’s layout binary over the 1000+-formula golden corpus, and the test suite ports RaTeX’s own lexer, parser, environment, mhchem and layout tests across to Swift. Drawing a formula is half of the editor problem. The block still needs an accurate height and has to survive view reuse, which is the subject of how a formula block gets its height and of keeping the calculation beside the explanation.
Once the note exists, ask the assistant to build an artifact from it. With Pro, Phrase turns a note into slide decks, pages, dashboards, flashcards, quizzes and mind maps, and a page of worked derivations is a natural source for a quiz or a set of flashcards. The same applies to notes from a lecture with equations in it.
The one entry SwaTex does not render
The missing entry is \includegraphics, the one exception in the 1008, and KaTeX itself gates that command behind trust. The command pulls an external image into a formula, so upstream treats it as a permission question rather than a typesetting one. Four \html* commands render their content and drop DOM-only attributes, because a native renderer has no DOM for those attributes to describe.
1007 of 1008 entries in KaTeX’s support table
- Rendered1003
- Rendered without DOM-only attributes (the four \html* commands)4
- Not rendered: \includegraphics, which KaTeX also keeps behind trust1
- The deployment floor is iOS 18, macOS 15, tvOS 18, watchOS 11 and visionOS 2, set by Synchronization.Mutex. Apps targeting older OS versions cannot adopt SwaTex yet.
- Native Apple platforms only. There are no React Native, Flutter or Web wrappers.
- A few behaviours diverge from RaTeX on purpose, each pinned by a regression test. An unterminated \verb and x\limits^2 are parse errors instead of being silently accepted.
- Deeply nested input is guarded by a recursion count and stack headroom, which produces a parse error and never a crash. Hostile input should still be length-limited by the host app.
This page leaves two things out. Handwritten math is a different problem, because Phrase takes typed, recorded and imported material rather than ink. Diagrams and code blocks are a separate question from formulas, and the two engineering write-ups linked above describe how both sit in the same editor.
Keep one more pair of facts apart. SwaTex builds for macOS 15, while the Phrase Mac app needs macOS 26 or later. An engine that compiles for a platform says nothing about which systems an app supports. Phrase runs on iPhone, iPad and Mac, with an Apple Watch app for recording, and renders formulas with SwaTex on each.


For the study side of a formula-heavy page, work through how a note becomes a flashcard deck with a set of derivations you have already written out.
Questions about LaTeX in a notes app
Can you do math in Apple Notes? Run the self-test in the app you already have instead of trusting a claim written a year ago. Apple documents what Notes does on its own support pages, and the answer moves between iOS releases. Snippet 1 and snippet 3 settle it in about ten seconds.
Can I write LaTeX equations in Apple Notes? Typing LaTeX and rendering LaTeX are two separate questions. Any app will hold the characters \frac{a}{b} as text. What counts is whether a horizontal bar appears with a above it and b below it, which is what snippet 1 checks.
What should a note taking app with LaTeX support handle? Use the KaTeX support table as the shared yardstick, since it is public and has 1008 entries. An app that covers environments, stretchy delimiters, macros and mhchem is working from the same grammar as the reference implementations. An app that covers inline fractions is doing something much smaller.
Does a math notes app need a network connection to draw a formula? It depends on the level. A converter that returns an image needs the round trip, and a WebView engine carries a startup cost before the first formula. SwaTex parses and lays out in the app’s own code, with no browser in the loop.
Sources & editorial notes
Sources were checked on September 25, 2026. Steps for Apple features follow Apple’s current documentation, linked below. The conditions change with each iOS release.
- SwaTex: KaTeX-compatible math rendering engine in pure Swift Coverage of 1007 of 1008 KaTeX entries, the \includegraphics exception, mhchem via \ce and \pu, the benchmark table, and the deployment floors. Checked 2026-09-20.
- KaTeX: supported functions and the support table The 1008-entry table the coverage figure counts against, and the trust gate on \includegraphics.
- mhchem for MathJax: the \ce and \pu syntax The chemistry syntax used in snippet 8 of the self-test.
Published by Eversight, the makers of Phrase. Our editorial approach · Suggest a correction
