How eras-hallow/mathtex works
MathTex is a small Luau library that parses a documented subset of LaTeX-inspired math syntax and renders it as native Roblox UI. The user-facing workflow is to call the public API with a parent, source, and options; the documented processing stages are lexing, parsing into an AST, layout, and rendering. Layout uses Roblox text measurement, and the native backend creates UI primitives. The README documents these relationships, but no source excerpts were provided, so internal call ownership and finer-grained data flow are not verified.
Main entry points: Parser.luau Parser · init.luau Public API · Lexer.luau Lexer · AST.luau Syntax tree
Components 10
Parsing
- Lexer
src/Lexer.luau - Parser
src/Parser.luau - Syntax tree
src/AST.luau - Symbol registry
src/Symbols.luau
Math Layout
- Layout engine
src/Layout.luau
Roblox Rendering
- Public API
src/init.luau - Native backend
src/Backends/Native.luau
Other components
- Library caller
- Roblox TextService
- Roblox UI parent
Connections 9
- Library caller → Public API: calls
README.md - Public API → Lexer: starts processing
README.md - Lexer → Parser: tokens to
README.md - Parser → Syntax tree: builds
README.md - Syntax tree → Layout engine: laid out by
README.md - Layout engine → Roblox TextService: measures text
README.md - Public API → Native backend: renders with
README.md - Native backend → Roblox UI parent: creates UI in
README.md - Parser → Symbol registry: uses commands
README.md