Skip to content

TeXpr

Math, parsed from LaTeX syntax.

A type-safe Dart library that turns \frac{d}{dx} strings into evaluated results. Symbolic calculus, linear algebra, boolean logic, and matrices included.

Get Started
dart pub add texpr

Everything you need

From basic arithmetic to symbolic differentiation, texpr handles the heavy lifting of mathematical parsing.

Native LaTeX Evaluation

Don't convert LaTeX to Dart by hand. Write standard LaTeX notation and let the texpr evaluate the expression tree for you. Supports unicode symbols like , , and .

Texpr.evaluate(r"\sum_{i=0}^{n} i^2", {"n": 10})

Dart 3 Type Safety

Returns sealed classes. Handle Numeric, Complex, or Matrix results safely.

Symbolic Calculus

Compute derivatives and gradients (\nabla) automatically using built-in algebraic rules.

Linear Algebra

Determinants, inverses, and matrix arithmetic. Just type \begin{pmatrix}...

Implicit Syntax

Understands human math like 2πr² or sin 2x without needing explicit * symbols.

Logic & Conditions

Boolean algebra support (\land \lor \neg) and comparisons. Perfect for evaluating piecewise functions or domain constraints like x > 0.

// Example: Piecewise logic
f(x) = \begin{cases} x^2 & x < 0 \\ x & x \ge 0 \end{cases}

Made with ❤️ by TeXpr, Docs Inspired by ElysiaJS