Repository navigation
v0.6.0
This release adds the texform command-line tool, gives prime marks a consistent meaning as symbols with explicit superscript binding, and makes normalization stable across transform phases. It also fixes spacing drift after text-mode control symbols and declarations leaking out of local groups, and roughly halves transform time. The prime change is breaking; see Changed for migration notes.
Added
- A new
texform-clicrate installs atexformbinary (cargo install texform-cli).normalize,parse, andtokenizeread one formula from an argument or stdin, or one per line with--lines, and print human-readable text or one JSON object per formula;info,packages, andargspec validatequery the knowledge base and argument specifications with the same shapes as the bindings.texform servespeaks JSON-RPC 2.0 over stdio (normalizer protocol v1) so external tools can call a specific TeXForm build across a process boundary, andtexform --versionreports the source commit and whether it was dirty. The CLI loads the library's default packages;braketis opt-in.
Changed
- Breaking:
Primeis now a math symbol, and onlyScriptedexpresses superscript binding.x\primestaysx \primeinstead of becomingx',x^2\primeno longer produces an unparsable double superscript,f'^2serializes as one superscript instead of a nested empty-base one, andf^{'}no longer collapses tof'. A pure prime superscript still serializes asf'. A leading quote, including insidef^{'}andA^{'\alpha}, parses as an empty-baseScripted, and whitespace-separated quotes such asf' ' 'form one superscript as in MathJax.x^'andx_'are now parse errors. Snapshots that stored a barePrimefor a quote superscript should be reparsed from source or rebuilt with an empty-baseScripted. - Transforms are faster: rewrite trigger indexes are built once per
Plan, and phases skip work they have already done. On a 10,000-formula sample, transform time falls from 33–44 µs to 14–18 µs per formula across the four profiles.
Fixed
- Normalization no longer depends on how many times it is applied. Later phases could expose attribute merges or rewrite matches after earlier phases had finished; the phases now run to a shared fixed point, and a transform that fails to converge within eight rounds returns a
TransformErrorinstead of partially normalized output. As a result, a prefix command's single-node argument is no longer wrapped in an implicit group in the transformed tree; serialized output is unchanged. - Text-mode control symbols such as
\and\,no longer gain a separator space on every serialization (\mbox{mod\ 1}grew by one space per round). A separator is emitted only where it keeps a control word from absorbing the following letter. - Declaratives without a prefix form keep their local scope:
{\scriptstyle x} yno longer becomes\scriptstyle x y,{\oldstyle 1}2no longer becomes\oldstyle 12, and\mathbf{\scriptstyle x}yno longer emits the style twice.