val_latex_flutter 0.1.2 copy "val_latex_flutter: ^0.1.2" to clipboard
val_latex_flutter: ^0.1.2 copied to clipboard

Render LaTeX math in Flutter: formula widgets, math inside text and Markdown, line wrapping, selection, screen readers, theming and streaming LLM output.

0.1.2 #

  • MathSpan takes onTap, onLongPress and onHover (reporting the node under the pointer, as on Math.tex), plus mouseCursor and semanticsLabel as on TextSpan (a click cursor by default when tappable) and copyFormat.

Fixed #

  • Inline formulas in Text.rich (MathSpan) and in MathText were scaled twice under a text scaler: at 2× system text they drew at 4×.

0.1.1 #

Requires val_latex 0.1.1, with everything it adds and fixes (TeX and LaTeX commands, packages, tikzcd, prooftree, robustness limits, scripts in other languages, glyph fallbacks).

Changed #

  • Math.tex and MathSpan no longer parse as streaming by default: a formula on its own is complete, so an unfinished command or group at its end (x + \frac{a}{) shows its error instead of being hidden. For text still arriving, pass parseOptions: ParseOptions(streaming: true) or use MathText(streaming: true). The flutter_math_fork compatibility layer does the same.
  • MathText.markdown is on by default: LLM replies are Markdown, so code spans and blocks are left as text. Pass markdown: false for plain text that uses backticks, ~~~ or <!--.
  • MathText parses with its own streaming flag: a finished message now shows an error for an unfinished command (\fo) instead of hiding it.

Added #

  • MathText.spacedDollars: accept $ x + y $ with spaces inside.
  • \leqno numbers are painted on the left.
  • \reflectbox: reflected text runs are painted mirrored.

0.1.0 #

First release.

val_latex_flutter renders LaTeX math in Flutter, using the val_latex engine.

Added #

  • Math.tex — a formula as a widget, sized and coloured by the text style; display mode with equation numbers at the margin.
  • MathText — text with $…$ and $$…$$ formulas in it, wrapping formulas with the words; safe for streaming text.
  • MathSpan — inline math in Text.rich, on the text baseline.
  • Wrapping — display formulas break to the width; MathOverflow scroll, shrink or clip for what cannot break. Baselines are reported in every case.
  • Interaction — onTap, onLongPress, onHover, animated highlights, selection in a SelectionArea that copies LaTeX (copyFormat), and keyboard navigation (focusable).
  • Accessibility — screen readers hear formulas spoken and move through them part by part; the bold-text setting is respected.
  • MathTheme — colours, fonts, fallback fonts and styles per \htmlClass name.
  • MathPainter — draw a layout on any canvas.
  • Caching — MathCache shares parses and layouts between widgets; layoutInBackground lays long formulas out in a worker isolate.
  • flutter_math_compat.dart — a drop-in replacement for package:flutter_math_fork/flutter_math.dart.
  • Latin Modern text fonts bundled for \text{…}.
  • Licence page — the third-party notices of this package and of val_latex appear on Flutter's licence page with no setup (registerValLatexLicenses).
4
likes
160
points
0
downloads

Documentation

API reference

Publisher

verified publisheruseval.io

Weekly Downloads

Render LaTeX math in Flutter: formula widgets, math inside text and Markdown, line wrapping, selection, screen readers, theming and streaming LLM output.

Homepage
View/report issues

Topics

#katex #latex #math #streaming #mathematics

License

BSD-3-Clause (license)

Dependencies

flutter, val_latex

More

Packages that depend on val_latex_flutter