Skip to content
Open in Anthropic

Texpr - Roadmap

Goal: Copy-paste LaTeX from academic sources and it just works.


Current State (v0.2.0)

✅ What Works

Parsing & Evaluation:

  • Basic arithmetic, fractions, powers, roots
  • 40+ mathematical functions (trig, hyperbolic, reciprocal, logarithmic, rounding)
  • Complex number transcendental evaluation (sin, cos, tan, exp, ln for complex inputs)
  • Symbolic differentiation with full calculus rules
  • Symbolic integration (basic patterns)
  • Numerical integration (Simpson's Rule)
  • Matrix operations (determinant, inverse, transpose, trace)
  • Summation (\sum), product (\prod), limit (\lim)
  • Definite and indefinite integrals
  • Multi-integrals (\iint, \iiint), closed integrals (\oint)

LaTeX Notation:

  • Greek letters (lowercase, UPPERCASE, variants: \alpha, \Gamma, \varepsilon)
  • Font commands (\mathbf, \mathcal, \mathrm, \boldsymbol)
  • Delimiter sizing (\left, \right, \big, \Big, etc.)
  • Spacing commands (\,, \;, \quad - ignored for evaluation)
  • Partial derivatives (\partial), gradient (\nabla)
  • Angle brackets (\langle, \rangle), set membership (\in)
  • Blackboard bold (\mathbb{R})
  • Comparison operators (\leq, \geq, \neq)

Academic Paper Compatibility (Tested):

  • Heisenberg Uncertainty Principle
  • Schrödinger Equation (time-dependent and time-independent)
  • Maxwell's Equations (Gauss's Law, Ampère's Law)
  • Navier-Stokes Equation
  • Fourier Transform definition
  • Cauchy-Schwarz Inequality
  • Einstein Field Equations
  • Normal distribution PDF

Test Coverage: 1,874 tests passing


Known Gaps

The following are known limitations discovered through testing:

1. Evaluation Limitations (Not Parsing)

ExpressionCan ParseCan EvaluateNotes
\nabla{x^2 + y^2}Concrete expressions with explicit vars
\nabla f (bare symbol)Symbolic only; no structure to differentiate
\oint E \cdot dALine/surface integrals are symbolic only
Tensor notation (R_{\mu\nu})Parsed as subscripted variable
Set notation (x \in \mathbb{R})Parsed but not evaluated as constraint

2. Previously Missing LaTeX Commands ✅ Fixed

All commands below now parse successfully:

CommandDescriptionStatus
\mapsto (↦)Maps to arrow
\Rightarrow (⇒)Double arrow
\approx (≈)Approximately equal
\propto (∝)Proportional to
\subset, \subseteqSubset notation
\cup, \capSet union/intersection
\forall, \existsQuantifiers
\dot{x}, \ddot{x}Time derivatives
\bar{x}Mean notation

3. Syntax Variations ✅ Fixed

The following syntax variations are now automatically handled:

Academic LaTeXLibrary SupportNotes
\frac12 (braceless)✅ WorksParses as \frac{1}{2}. Ambiguous cases like \frac123 error with clear message
sin(x) (no backslash)✅ WorksRecognized when followed by (. Without (, remains as implicit mult
e^{ix}✅ WorksImplicit multiplication inside exponents is handled

Roadmap

Phase 1: Parsing Completeness

Goal: Any valid mathematical LaTeX from a textbook or paper parses successfully.

TaskStatusDescription
Add \approx, \bar, \dot, \ddotCommon in physics papers
Add \Rightarrow, \Leftarrow, \LeftrightarrowLogic notation
Add \forall, \existsQuantifiers (parse as symbols)
Add \subset, \subseteq, \supsetSet notation
Add \cup, \cap, \setminusSet operations
Add \propto, \mapstoRelation symbols
Test with 50+ real academic paper excerptsValidate "just works" claim

Phase 2: Common Use Case Evaluation

Goal: Expressions that can be numerically evaluated, are.

TaskStatusDescription
Unicode input supportAccept , , , π directly
Improved implicit multiplication heuristicse^{ix} works, braces required for multi-char exponents
Better error messages for evaluation failures"Cannot evaluate gradient symbolically"

Phase 3: Developer Experience

Goal: Easy integration and debugging.

TaskStatusDescription
JSON AST exportFor debugging and tooling
MathML exportFor web display
SymPy exportFor Python interoperability

Non-Goals

The following are explicitly not goals for this library:

  1. Full Computer Algebra System (CAS) - We do pattern-based simplification, not canonical forms
  2. Symbolic tensor calculus - Parsing tensor notation is supported; evaluation is not
  3. Proof verification - Logic symbols are parsed but not reasoned about
  4. Typesetting - Community already had it, we fill the gap with evaluation

How to Contribute

  1. Find a LaTeX expression from an academic paper that fails to parse
  2. Open an issue with the exact expression
  3. We'll add support and tests

Phase 4: Performance & Optimization

Goal: Ensure 60fps performance on mobile devices.

TaskStatusDescription
Standardized ComparisonCross-language comparison (Dart/JS/Python)
AOT Compilation Profile📋Verify performance in release builds
WebAssembly (Wasm)📋Investigate compiling to Wasm for web apps
Parallel Evaluation📋Evaluate independent sub-expressions in isolates

Last Updated: 2026-01-04

Made with ❤️ by TeXpr, Docs Inspired by ElysiaJS