diff --git a/CSharpMath.Evaluation.Tests/InterpretTests.cs b/CSharpMath.Evaluation.Tests/InterpretTests.cs index f4675fce..a30bd493 100644 --- a/CSharpMath.Evaluation.Tests/InterpretTests.cs +++ b/CSharpMath.Evaluation.Tests/InterpretTests.cs @@ -10,7 +10,7 @@ public class InterpretTests { [InlineData(@"1+2", @"\underline\mathrm{Input}\\1+2\\\\\underline\mathrm{Simplified}\\3\\\\\underline\mathrm{Value\ (100\ digits)}\\3")] [InlineData(@"1+\sqrt", @"\color{red}\text{Missing radicand}")] [InlineData(@"1+\sqrt2", @"\underline\mathrm{Input}\\1+\sqrt{2}\\\\\underline\mathrm{Simplified}\\1+\sqrt{2}\\\\\underline\mathrm{Value\ (100\ digits)}\\2.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573")] - [InlineData(@"1+\sqrt{2x}", @"\underline\mathrm{Input}\\1+\sqrt{2 x}\\\\\underline\mathrm{Simplified}\\1+\sqrt{2 x}\\\\\underline\mathrm{Expanded}\\1+\sqrt{2 x}\\\\\underline\mathrm{Factorized}\\1+\sqrt{2 x}")] + [InlineData(@"1+\sqrt{2x}", @"\underline\mathrm{Input}\\1+\sqrt{2 x}\\\\\underline\mathrm{Simplified}\\1+\sqrt{2 x}\\\\\underline\mathrm{Expanded}\\1+\sqrt{2} \sqrt{x}\\\\\underline\mathrm{Factorized}\\1+\sqrt{2 x}")] [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}")] [InlineData(@"=1+\sqrt{2xy}", @"\color{red}\text{Missing left side of equation}")] [InlineData(@"1+\sqrt{2xy}=", @"\color{red}\text{Missing right side of equation}")] diff --git a/CSharpMath.Evaluation/CSharpMath.Evaluation.csproj b/CSharpMath.Evaluation/CSharpMath.Evaluation.csproj index 942028b7..8f16b6e7 100644 --- a/CSharpMath.Evaluation/CSharpMath.Evaluation.csproj +++ b/CSharpMath.Evaluation/CSharpMath.Evaluation.csproj @@ -13,7 +13,7 @@ - + diff --git a/CSharpMath.Evaluation/Evaluation.cs b/CSharpMath.Evaluation/Evaluation.cs index ec6d1f16..58285cf1 100644 --- a/CSharpMath.Evaluation/Evaluation.cs +++ b/CSharpMath.Evaluation/Evaluation.cs @@ -42,16 +42,20 @@ enum Precedence { Postfix // Highest } - public abstract record MathItem : ILatexiseable { + public abstract record MathItem : ILatexizeable { private protected MathItem() { } public abstract string Latexise(); + // AngouriMath 2.0 renamed ILatexiseable.Latexise to ILatexizeable.Latexize. Implementing + // it explicitly keeps MathItem.Latexise as the public name here, so this package's own + // surface is unchanged by their rename. + string ILatexizeable.Latexize() => Latexise(); public static implicit operator MathItem(AngouriMath.Entity content) => new Entity(content); public static explicit operator AngouriMath.Entity(MathItem item) => ((Entity)item).Content; /// A real number, complex number, variable, function call, vector, matrix, higher-dimensional tensor, or set public sealed record Entity : MathItem { public Entity(AngouriMath.Entity content) => Content = content; public AngouriMath.Entity Content { get; } - public override string Latexise() => Content.Latexise(); + public override string Latexise() => Content.Latexize(); } /// A linked list of comma-delimited items public sealed record Comma : MathItem, IEnumerable { diff --git a/CSharpMath.Evaluation/Interpret.cs b/CSharpMath.Evaluation/Interpret.cs index 1f61f10d..8ad7bd15 100644 --- a/CSharpMath.Evaluation/Interpret.cs +++ b/CSharpMath.Evaluation/Interpret.cs @@ -3,8 +3,8 @@ namespace CSharpMath { static partial class Evaluation { - static StringBuilder AppendLaTeX(this StringBuilder sb, AngouriMath.Core.ILatexiseable latex) => - sb.Append(latex.Latexise()); + static StringBuilder AppendLaTeX(this StringBuilder sb, AngouriMath.Core.ILatexizeable latex) => + sb.Append(latex.Latexize()); static StringBuilder AppendLaTeXHeader(this StringBuilder sb, string header, bool includeNewlineBefore = true) { if (includeNewlineBefore) sb.Append(@"\\\\"); return sb.Append(@"\underline\mathrm{").Append(header).Append(@"}\\");