smart_latex 2.0.2
smart_latex: ^2.0.2 copied to clipboard
Self-contained Flutter LaTeX rendering with bundled KaTeX metrics, input repair, RTL-safe layout, and no extra math package.
2.0.2 - 2026-06-30 #
Fixed #
- Documentation and metadata polish for pub.dev analysis (CHANGELOG, doc comment formatting). No functional changes.
2.0.0 - 2026-06-28 #
Breaking / major #
- Self-contained now. The math engine (a layout-fixed copy of
flutter_math_fork, Apache-2.0) is bundled inside the package. You no longer
need to add
flutter_math_forkyourself or apply anydependency_overrides—flutter pub add smart_latexis all that's required. - The bundled engine fixes the upstream
RenderResetDimension does not meet its constraintslayout crash that affected\sqrtnested in\fracwith\left(...\right)delimiters.
See PATCHES.md for the exact changes made to the bundled engine.
1.0.0 - 2026-06-27 #
Initial release.
Widgets #
SmartLatexText— renders a string of mixed plain text and LaTeX. Supports inline ($...$,\(...\)) and display ($$...$$,\[...\]) math, RTL, selectable text, custom error builders, text scaling, and ahideTrailingIncompleteMathflag for streaming / animated text.SmartMath— renders a single LaTeX expression (no surrounding text).
Sanitizer #
sanitizeLatex()repairs common malformed LaTeX:- Double-backslash before command names (
\\right→\right). \sqttypo →\sqrt.- Persian / Arabic digits (۰–۹, ٠–٩) → ASCII.
- Persian decimal/thousands separators (
٫ ٬ ،). - Single-character
\text{0}wrappers → bare characters. - Unbalanced curly braces.
- Double-backslash before command names (
LatexSanitizeOptionslets you enable/disable each rule individually.