val_latex_flutter 0.1.2
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 #
MathSpantakesonTap,onLongPressandonHover(reporting the node under the pointer, as onMath.tex), plusmouseCursorandsemanticsLabelas onTextSpan(a click cursor by default when tappable) andcopyFormat.
Fixed #
- Inline formulas in
Text.rich(MathSpan) and inMathTextwere 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.texandMathSpanno 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, passparseOptions: ParseOptions(streaming: true)or useMathText(streaming: true). The flutter_math_fork compatibility layer does the same.MathText.markdownis on by default: LLM replies are Markdown, so code spans and blocks are left as text. Passmarkdown: falsefor plain text that uses backticks,~~~or<!--.MathTextparses with its ownstreamingflag: 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.\leqnonumbers 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 inText.rich, on the text baseline.- Wrapping — display formulas break to the width;
MathOverflowscroll, shrink or clip for what cannot break. Baselines are reported in every case. - Interaction —
onTap,onLongPress,onHover, animatedhighlights, selection in aSelectionAreathat 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\htmlClassname.MathPainter— draw a layout on any canvas.- Caching —
MathCacheshares parses and layouts between widgets;layoutInBackgroundlays long formulas out in a worker isolate. flutter_math_compat.dart— a drop-in replacement forpackage: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_latexappear on Flutter's licence page with no setup (registerValLatexLicenses).