You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move to AngouriMath 2.0, which renamed Latexise to Latexize (#262)
* Move to AngouriMath 2.0, which renamed Latexise to Latexize
AngouriMath 2.0 renames ILatexiseable.Latexise to ILatexizeable.Latexize.
MathItem implements the new interface explicitly, so CSharpMath's own public
surface does not change: MathItem.Latexise stays the name callers know, and
PublicAPI.Unshipped.txt is untouched. The public-API analyzer confirms it --
no RS warnings.
Only two call sites are on AngouriMath's side of the boundary and move:
Content.Latexize() on an AngouriMath.Entity, and the ILatexizeable parameter
in Interpret.
One test expectation changes. 2.0 splits a radical over a positive factor, so
1+\sqrt{2x} expands to 1+\sqrt{2}\sqrt{x}. sqrt(2x) = sqrt(2)sqrt(x) holds for
all complex x when the factored constant is positive, so the new output is
sound; it is a rendering change rather than a correctness one.
955 of 955 tests pass.
* Read the LaTeX AngouriMath 2.2.0 emits, and pin it with a sweep
Evaluation.Visualize throws InvalidCodePathException on any LaTeX it cannot
read, and says why in its own source -- "CSharpMath must handle all LaTeX
coming from AngouriMath or a bug is present!" -- but nothing checked it.
AngouriMathLatexSweepTests now does: every concrete Entity type AngouriMath
can print, Latexized and fed back through LaTeXParser. On 2.2.0 that is 76
nodes, of which two forms had no reading here.
\bmod, AngouriMath's modulo node. Added as a BinaryOperator whose nucleus is
the word "mod": binary spacing, and upright because only Variable and Number
go through the italicising font changer. It binds like multiplication and
division, matching AngouriMath's Priority.Mul, so x+y \bmod z is x+(y mod z)
on both sides.
\operatorname{\varphi}, Euler's totient. The name was read with ReadString,
which takes ASCII letters only, so both the command and -- since the name is
written back out as the letter -- this method's own output \operatorname{φ}
were rejected. It now reads char.IsLetter and resolves commands that stand
for a letter, refusing the rest; \operatorname{a|} stays the error it was.
Both directions are covered: parsing, serialising back, evaluating to an
Entity, and laying out. Layout is measured rather than compared against a
baseline image, since the new shapes there are a word-length BinaryOperator
and a non-ASCII operator name, and glyph coverage is already asserted by
TestCommandDisplay.
Four recorded answers changed with the version and are updated, each because
AngouriMath became more careful rather than less:
sgn(|x|) was 1; it is 1 away from zero but 0 at zero
arccos(cos x) was x; that holds only on [0, pi]
x <= x was T; now T for x in RR, the domain <= needs
cos(-x) now folds to cos(x), by evenness
Core 1515, Evaluation 962, Rendering 1226, Rendering.Text 237 all pass.
[InlineData(@"1+\sqrt{2xy}",@"\underline\mathrm{Input}\\1+\sqrt{2 x y}\\\\\underline\mathrm{Simplified}\\1+\sqrt{2 x y}\\\\\underline\mathrm{Expanded}\\1+\sqrt{2 x y}\\\\\underline\mathrm{Factorized}\\1+\sqrt{2 x y}")]
15
15
[InlineData(@"=1+\sqrt{2xy}",@"\color{red}\text{Missing left side of equation}")]
16
16
[InlineData(@"1+\sqrt{2xy}=",@"\color{red}\text{Missing right side of equation}")]
0 commit comments