Skip to main content

val_latex 0.1.0 copy "val_latex: ^0.1.0" to clipboard
val_latex: ^0.1.0 copied to clipboard

LaTeX math typesetting in pure Dart: a TeX parser, macros, TeX layout with line breaking and right-to-left math, OpenType math fonts, and speech output.

0.1.0 #

First release.

val_latex typesets LaTeX math in pure Dart. It runs anywhere Dart runs — the VM, Flutter on every platform, servers and the web — and is the shared core of val_latex_flutter.

Added #

  • Parser — parseLatex turns LaTeX math into an immutable syntax tree where every node carries its source span. It never throws for bad input: problems become error nodes and Diagnostics, and unfinished input is incomplete, so streaming text renders as far as it goes.
  • 3,882 commands and 68 environments — LaTeX and AMS math, mathtools, the physics package, mhchem (\ce, \pu), siunitx, diffcoeff, commath, nccmath, empheq, unicode-math names, stmaryrd and wasysym symbols, text tables and lists. LatexCatalog lists them all.
  • Macros — \def, \newcommand, \DeclareMathOperator and more, with TeX group scoping, shareable across formulas with newMacroTable().
  • TeX layout — layoutFormula and renderLatex follow the TeXbook's Appendix G and the OpenType MATH table, and produce a render-agnostic display list.
  • Fonts — Latin Modern Math bundled, STIX Two Math as the fallback; any OpenType math font with MathFont.fromBytes, variable fonts at any axis values.
  • Line breaking — LayoutOptions.maxWidth; prepareFormula lays out once and re-breaks for each width.
  • Right-to-left math — Arabic notation, Arabic-Indic and Persian digits.
  • Text with formulas — MathScanner finds $…$, $$…$$, \(…\) and \[…\] in text.
  • Outputs — toLatex (normalised source) and toSpeech (spoken math in eight languages, six of them drafts).
  • Hit testing and selection — hitTestLayout, selectionUnits.
  • Background layout — layoutInBackground in a worker isolate.
  • Third-party notices — valLatexNotices and THIRD_PARTY_NOTICES.md credit the work val_latex contains.
6
likes
0
points
23.2k
downloads

Publisher

verified publisheruseval.io

Weekly Downloads

LaTeX math typesetting in pure Dart: a TeX parser, macros, TeX layout with line breaking and right-to-left math, OpenType math fonts, and speech output.

Homepage
View/report issues

Topics

#latex #math #typesetting #tex #equations

License

unknown (license)

Dependencies

characters

More

Packages that depend on val_latex