In the AI-for-research era, GPT and friends answer math questions in Markdown. Android had no clean reader that renders all four common TeX/LaTeX math delimiter styles — so this simple app now exists.
A minimal Android markdown reader (with light editing) built for mathematicians. It renders TeX/LaTeX math correctly in all four common delimiter styles:
Inline: $x_i$ and \(u \in C^k\)
Display: $$...$$ and \[ ... \]Most Android markdown editors either render no math at all, or break on real
mathematical documents: the markdown parser runs first and eats
\(...\) / \[...\] backslashes (CommonMark escape rules) and mangles
_-containing formulas like $\bar{\mu}_{n}$ into emphasis spans before
any math renderer sees them.
MathMD extracts math segments before markdown parsing (a
protection/placeholder pass), so all four delimiter styles survive intact.
The pass is written in TypeScript and covered by a regression suite
(including $\{x\}$, inline pairs, $W^{1,p}_0(\Omega)$, and code
spans/fences that must stay literal).
- Four math delimiter styles, rendered by bundled KaTeX (fully offline)
- Edit / Preview flip toggle; configurable startup mode
- In-document search with match highlighting and next/previous navigation, working in both the editor and the rendered preview
- New blank document; open via system file picker or "Open with…" from other apps; save in place or as a copy
- Light/dark/system theme; per-pane font family and editor font size
- Fixed line width in characters (optional): the page wraps once at that
column and the default zoom fits it exactly to the screen (no horizontal
panning); pinch-zoom scales the whole page uniformly — zooming past the
fit level enables global horizontal panning, wrap never changes.
Over-wide formulas scroll horizontally under a line-pinned
\tag - No network permission usage for the preview; the WebView is asset-sandboxed
- No accounts, no telemetry, no ads
There is deliberately no currency special-casing. Every unescaped $
interacts with the math pass: two unescaped $ pair into a formula no
matter what sits between them (I have $12 and he have $23 renders
12 and he have as math), and only a lone $ with no partner stays
literal.
All dedicated dollar signs must therefore be written escaped (\$) or
inside code spans — a literal $ is never safe.
Requirements: JDK 17, Android SDK (platform 37 + build-tools 36), Node 20+.
# Preview pipeline (TypeScript → assets) + regression tests
(cd tools && npm install)
./scripts/build-preview.sh
node tools/mdtest/run.js
# Android app
gradle :app:assembleDebug # APK: app/build/outputs/apk/debug/app/— Android app (Kotlin, Jetpack Compose, Material 3)tools/preview-src/— math-protection scanner + render pipeline (TypeScript)tools/mdtest/— node regression harness for the preview pipelinedocs/— architecture decision record, research notes, signing setupscripts/— esbuild bundle step, keystore generator
- KaTeX (MIT) — math rendering
- markdown-it (MIT) — markdown parsing
- Material Symbols glyph paths (Apache-2.0) — icons
- Definitely a vibe coding result: every line of this repository was written by an AI agent; the human owner designed, tested on real hardware, and directed ~15 review rounds.
MIT — see LICENSE.
0 comments
log in to comment.