Analysis updated 2026-05-18
Render LaTeX math formulas natively in a SwiftUI app without loading a web view.
Display math inline inside a custom text editor built with UIKit or AppKit.
Export a formula as an SVG string or a PNG image for use elsewhere.
Render chemistry equations or proof trees alongside standard math notation.
| phrasehq/swatex | arinltte/latte | videlalvaro/inference-school | |
|---|---|---|---|
| Stars | 171 | 174 | 176 |
| Language | Swift | Swift | Swift |
| Setup difficulty | easy | easy | hard |
| Complexity | 3/5 | 1/5 | 5/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Xcode 16.3+ and targets recent OS versions like iOS 18 and macOS 15.
SwaTex is a library that renders LaTeX math formulas, the kind used in scientific papers and textbooks, directly on Apple platforms in pure Swift code. Most tools that display math on the web or in apps do it by loading a browser engine or a JavaScript library behind the scenes, which costs memory and adds a delay before the first formula shows up. SwaTex instead reimplements the same rendering pipeline as KaTeX, a popular JavaScript math renderer, as native Swift, so it runs directly on iOS, macOS, tvOS, watchOS, and visionOS without a hidden web view. It supports nearly all of KaTeX's formula syntax, covering fractions, radicals, integrals, matrices, accents, and custom macros, along with chemistry notation through the mhchem extension and proof trees used in logic and math papers. The project was built by the team behind an app called Phrase, where it renders math formulas inside the app's AI-generated notes, and it was ported from an earlier Rust version of the same renderer called RaTeX. Developers install it through Swift Package Manager and can use it a few different ways: as a SwiftUI view that displays a formula inline with surrounding text, as a UIKit or AppKit view meant for use inside text editors, or as a lower-level engine that produces an SVG string or a PNG image directly. The library is designed with editors in mind, meaning it caches the layout of formulas it has already rendered once, so redrawing the same formula again during scrolling is very fast and avoids doing the expensive layout work twice. The project includes benchmark comparisons against the original Rust engine, showing it renders and lays out formulas faster in most cases while producing pixel-identical output on its test set of formulas. It requires a fairly recent version of Xcode and targets recent versions of Apple's operating systems. One known gap is that it does not support the includegraphics command, matching a restriction KaTeX itself also applies. It is released under the MIT license.
A pure Swift library that renders LaTeX math formulas natively on Apple platforms, matching KaTeX's output without a hidden web view.
Mainly Swift. The stack also includes Swift, SwiftUI, UIKit.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.