diff --git a/AGENTS.md b/AGENTS.md
index 778677d14..6ef729018 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -92,16 +92,16 @@ printed with `if` came back as a product with `if` read as an undeclared variabl
usual notation is not in the grammar, print the function call the parser does have.
`StringizeRoundTripTest` is where that is enforced; add to it when you add a node.
-**`Latexise` has a round trip too, and it is enforced in someone else's repository.**
+**`Latexize` has a round trip too, and it is enforced in someone else's repository.**
[CSharpMath.Evaluation](https://github.com/verybadcat/CSharpMath/blob/master/CSharpMath.Evaluation/Evaluation.cs)
reads LaTeX back into an `Entity`, and says so in its own source: *"CSharpMath must handle all LaTeX
-coming from AngouriMath or a bug is present!"* So a change to what `Latexise` emits — a new node, a
+coming from AngouriMath or a bug is present!"* So a change to what `Latexize` emits — a new node, a
different command, a changed bracketing — can break a downstream project, and no test here will say
so.
That is weaker than `Stringize`'s contract, not stronger. `StringizeRoundTripTest` fails in this
repository the moment the printed form stops parsing; the LaTeX contract fails as a bug report from
-someone else, months later. When you change `Latexise` output, check it against CSharpMath and open
+someone else, months later. When you change `Latexize` output, check it against CSharpMath and open
a PR there as well ([#822](https://github.com/asc-community/AngouriMath/issues/822)).
The syntax the parser accepts is written down in
@@ -217,7 +217,7 @@ the *basis* is, and it is made differently on purpose:
| | basis | why |
|---|---|---|
-| quantum | `Entity`-backed | the state is then an ordinary expression, so `Simplify`, `Substitute`, `Latexise` and the rest work on it without anything being taught about quantum |
+| quantum | `Entity`-backed | the state is then an ordinary expression, so `Simplify`, `Substitute`, `Latexize` and the rest work on it without anything being taught about quantum |
| polynomials, series | a generic `TBasis` struct | exponent vectors never enter the expression tree, and the internal layers stay allocation-free and type-safe |
One generic spine, instantiated twice. That is less tidy than picking a single answer, and the
diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md
index e4f399656..b23a3d5b6 100644
--- a/BREAKING-CHANGES.md
+++ b/BREAKING-CHANGES.md
@@ -52,6 +52,7 @@ read first.
| loud | `floor(x)`, `ceil(x)`, `ceiling(x)` | `UnrecognizedFunctionParseException` | the functions |
| loud | `round(x)`, `min(a, b)`, `max(a, b)`, `gcd(a, b)` | `UnrecognizedFunctionParseException` | the functions |
| loud | 28 members deprecated since 1.x | obsolete but present | removed |
+| loud | `Latexise`, `ILatexiseable`, `entity_latexise` | the British spelling | `Latexize`, `ILatexizeable`, `entity_latexize` |
| loud | the target frameworks | `net7.0;netstandard2.0` | `netstandard2.0;net8.0;net10.0` |
| **silent** | `abs(x) = c` for a negative `c` | a set of non-solutions | the empty set |
@@ -118,6 +119,42 @@ right answer. Code written against the old names was wrong in the same way.
[#632](https://github.com/asc-community/AngouriMath/issues/632), PR
[#664](https://github.com/asc-community/AngouriMath/pull/664).
+### `Latexise` is now `Latexize`
+
+The library serialises a node to text two ways, and spelled them in two languages:
+
+| | was | is |
+|---|---|---|
+| the method | `Latexise()` | `Latexize()` |
+| the interface | `ILatexiseable` | `ILatexizeable` |
+| the string extension | `"x + 1".Latexise()` | `"x + 1".Latexize()` |
+| the C# helper | `MathS.Latex(ILatexiseable)` | `MathS.Latex(ILatexizeable)` |
+| the native entry point | `entity_latexise` | `entity_latexize` |
+| the C++ method | `Entity::Latexise()` | `Entity::Latexize()` |
+| the F# function | `latexise` | `latexize` |
+
+Everything else in the public surface is `-ize` — `Stringize`, `Factorize`, `Serialize`,
+`Deserialize` — so `Latexise` and its interface were the only members a caller had to remember the
+other spelling for. `Stringize` and `Latexise` do the same kind of thing and sit next to each other
+in every file that has either, which is what made the split spelling costly rather than merely
+untidy.
+
+**What breaks.** Every call, every override, and every implementation of the interface. There is no
+forwarding member: this release is the one that removed 28 members that accumulated as forwarders,
+so adding a permanent one here would undo that on the same day. The compiler reports each site, and
+the fix is mechanical.
+
+`MathS.Quantum.Factorise` keeps its spelling for now. Renaming it to `Factorize` would give the
+library two public `Factorize` methods doing unrelated things — expression factoring on `Entity`,
+tensor factorisation on a quantum state — which is a worse outcome than the inconsistency. It wants
+a distinguishing name rather than a spelling change, and that is not decided here.
+
+**Downstream.** [`CSharpMath.Evaluation`](https://github.com/verybadcat/CSharpMath) reads LaTeX
+produced here back into an `Entity` and calls this method. It is unaffected until it moves to 2.0,
+at which point it needs the new name.
+
+[#840](https://github.com/asc-community/AngouriMath/issues/840).
+
---
## Parsing
@@ -312,7 +349,10 @@ This one is worth reading twice if you parse printed output, because the misread
ordinary number: every root of a trigonometric equation prints through this path, and
`cos(x)^2 + sin(x) = 0` returns roots that are exact as entities and were not as text.
-`Latexise` is under no such obligation, since nothing parses LaTeX, and is unaffected.
+`Latexize` is unaffected by this change. Its output is under a weaker obligation, not none:
+nothing in this repository parses LaTeX back, but [`CSharpMath.Evaluation`](https://github.com/verybadcat/CSharpMath)
+does, so a change to what it emits can break a downstream project with no test here to say so
+([#822](https://github.com/asc-community/AngouriMath/issues/822)).
The syntax the parser accepts is now written down in
[`Sources/AngouriMath/Docs/Usage/Syntax.md`](Sources/AngouriMath/Docs/Usage/Syntax.md).
diff --git a/README.md b/README.md
index 49c936cab..5ca1abfe3 100644
--- a/README.md
+++ b/README.md
@@ -264,7 +264,7 @@ Console.WriteLine("x^2 + x + a".SolveEquation("x"));
Under developing now and forever (always available)
```cs
Entity expr = "(sin(x)^2 - sin(x) + a)(b - x)((-3) * x + 2 + 3 * x ^ 2 + (x + (-3)) * x ^ 3)";
-Console.WriteLine(expr.SolveEquation("x").Latexise());
+Console.WriteLine(expr.SolveEquation("x").Latexize());
```
@@ -297,7 +297,7 @@ var system = MathS.Equations(
"cos(x2 + 1)^2 + 3y",
"y * (-1) + 4cos(x2 + 1)"
);
-Console.WriteLine(system.Latexise());
+Console.WriteLine(system.Latexize());
var solutions = system.Solve("x", "y");
Console.WriteLine(solutions);
```
@@ -334,10 +334,10 @@ WriteLine("x^2 + a x".Integrate("x").InnerSimplified);
There are four types of sets:
```cs
-WriteLine("{ 1, 2 }".Latexise());
-WriteLine("[3; +oo)".Latexise());
-WriteLine("RR".Latexise());
-WriteLine("{ x : x^8 + a x < 0 }".Latexise());
+WriteLine("{ 1, 2 }".Latexize());
+WriteLine("[3; +oo)".Latexize());
+WriteLine("RR".Latexize());
+WriteLine("{ x : x^8 + a x < 0 }".Latexize());
```
@@ -347,9 +347,9 @@ WriteLine("{ x : x^8 + a x < 0 }".Latexise());
And there operators:
```cs
-WriteLine(@"A \/ B".Latexise());
-WriteLine(@"A /\ B".Latexise());
-WriteLine(@"A \ B".Latexise());
+WriteLine(@"A \/ B".Latexize());
+WriteLine(@"A /\ B".Latexize());
+WriteLine(@"A \ B".Latexize());
```
@@ -363,7 +363,7 @@ WriteLine(@"A \ B".Latexise());
You can build LaTeX with AngouriMath:
```cs
var expr = "x ^ y + sqrt(x) + integral(sqrt(x) / a, x, 1) + derive(sqrt(x) / a, x, 1) + limit(sqrt(x) / a, x, +oo)";
-Console.WriteLine(expr.Latexise());
+Console.WriteLine(expr.Latexize());
>>> {x}^{y}+\sqrt{x}+\int \left[\frac{\sqrt{x}}{a}\right] dx+\frac{d\left[\frac{\sqrt{x}}{a}\right]}{dx}+\lim_{x\to \infty } \left[\frac{\sqrt{x}}{a}\right]
```
diff --git a/Sources/AngouriMath/Convenience/AngouriMathExtensions.cs b/Sources/AngouriMath/Convenience/AngouriMathExtensions.cs
index bc9f4c056..bd46d3be5 100644
--- a/Sources/AngouriMath/Convenience/AngouriMathExtensions.cs
+++ b/Sources/AngouriMath/Convenience/AngouriMathExtensions.cs
@@ -279,7 +279,7 @@ public static Complex ToNumber(this NumericsComplex complex)
/// Builds a LaTeX code from an expression
///
/// A which can be rendered into pretty output
- public static string Latexise(this string str) => str.ToEntity().Latexise();
+ public static string Latexize(this string str) => str.ToEntity().Latexize();
///
/// Compiles an expression into a special compiled code that runs via
diff --git a/Sources/AngouriMath/Convenience/MathS.cs b/Sources/AngouriMath/Convenience/MathS.cs
index 888af3934..7412b1415 100644
--- a/Sources/AngouriMath/Convenience/MathS.cs
+++ b/Sources/AngouriMath/Convenience/MathS.cs
@@ -3162,7 +3162,7 @@ public static IEnumerable TaylorTerms(Entity expr, params (Variable expr
/// var inCyrillic = Var("Абаваола");
///
/// Underscore "_" allows indexing. Greek letter names (e. g.
- /// "alpha") will be latexised as Greek letter (but other than that,
+ /// "alpha") will be latexized as Greek letter (but other than that,
/// will appear as "alpha" in other places).
///
public static Variable Var(string name) => name;
@@ -3184,7 +3184,7 @@ public static IEnumerable TaylorTerms(Entity expr, params (Variable expr
/// var inCyrillic = Var("Абаваола");
///
/// Underscore "_" allows indexing. Greek letter names (e. g.
- /// "alpha") will be latexised as Greek letter (but other than that,
+ /// "alpha") will be latexized as Greek letter (but other than that,
/// will appear as "alpha" in other places).
///
public static (Variable, Variable) Var(string name1, string name2) => (Var(name1), Var(name2));
@@ -3206,7 +3206,7 @@ public static IEnumerable TaylorTerms(Entity expr, params (Variable expr
/// var inCyrillic = Var("Абаваола");
///
/// Underscore "_" allows indexing. Greek letter names (e. g.
- /// "alpha") will be latexised as Greek letter (but other than that,
+ /// "alpha") will be latexized as Greek letter (but other than that,
/// will appear as "alpha" in other places).
///
public static (Variable, Variable, Variable) Var(string name1, string name2, string name3)
@@ -3231,7 +3231,7 @@ public static (Variable, Variable, Variable) Var(string name1, string name2, str
/// var inCyrillic = Var("Абаваола");
///
/// Underscore "_" allows indexing. Greek letter names (e. g.
- /// "alpha") will be latexised as Greek letter (but other than that,
+ /// "alpha") will be latexized as Greek letter (but other than that,
/// will appear as "alpha" in other places).
///
public static (Variable, Variable, Variable, Variable) Var(string name1, string name2, string name3, string name4)
@@ -3256,7 +3256,7 @@ public static (Variable, Variable, Variable, Variable) Var(string name1, string
/// var inCyrillic = Var("Абаваола");
///
/// Underscore "_" allows indexing. Greek letter names (e. g.
- /// "alpha") will be latexised as Greek letter (but other than that,
+ /// "alpha") will be latexized as Greek letter (but other than that,
/// will appear as "alpha" in other places).
///
public static (Variable, Variable, Variable, Variable, Variable) Var(string name1, string name2, string name3, string name4, string name5)
@@ -3984,7 +3984,7 @@ public static ParsingResult Parse(string source)
///
/// The LaTeX representation of the argument
///
- ///
+ ///
/// Any element (, , etc.) that can be represented in LaTeX
///
///
@@ -4008,7 +4008,7 @@ public static ParsingResult Parse(string source)
/// \frac{a}{{b}^{\lim_{x\to \infty } \left[\sin\left(x\right)-\frac{{e}^{y}+{e}^{-y}}{2}\right]}}
///
///
- public static string Latex(ILatexiseable latexiseable) => latexiseable.Latexise();
+ public static string Latex(ILatexizeable latexizeable) => latexizeable.Latexize();
///
/// All operations for and its derived classes are available from here.
diff --git a/Sources/AngouriMath/Core/Entity/Entity.Definition.cs b/Sources/AngouriMath/Core/Entity/Entity.Definition.cs
index 5a2ba04a4..09aa05e1a 100644
--- a/Sources/AngouriMath/Core/Entity/Entity.Definition.cs
+++ b/Sources/AngouriMath/Core/Entity/Entity.Definition.cs
@@ -70,10 +70,10 @@ internal enum Priority
///
/// Entity expr = "sqrt(a) + integral(sin(x), x)";
/// Console.WriteLine(expr);
- /// Console.WriteLine(expr.Latexise());
+ /// Console.WriteLine(expr.Latexize());
/// Entity expr2 = "a / b ^ limit(sin(x) - cosh(y), x, +oo)";
/// Console.WriteLine(expr2);
- /// Console.WriteLine(expr2.Latexise());
+ /// Console.WriteLine(expr2.Latexize());
///
/// Prints
///
@@ -83,13 +83,13 @@ internal enum Priority
/// \frac{a}{{b}^{\lim_{x\to \infty } \left[\sin\left(x\right)-\frac{{e}^{y}+{e}^{-y}}{2}\right]}}
///
///
- public interface ILatexiseable
+ public interface ILatexizeable
{
///
/// Converts the object to the LaTeX format
/// That is, a string that can be later displayed and rendered as LaTeX
///
- public string Latexise();
+ public string Latexize();
}
}
@@ -101,7 +101,7 @@ namespace AngouriMath
/// Every node, expression, or number is an .
/// However, you cannot create an instance of this class, look for the nested classes instead.
///
- public abstract partial record Entity : ILatexiseable
+ public abstract partial record Entity : ILatexizeable
{
///
/// Returns the array of the direct children. Will be
diff --git a/Sources/AngouriMath/Core/EquationSystem.cs b/Sources/AngouriMath/Core/EquationSystem.cs
index 1a7aa5f41..224907e22 100644
--- a/Sources/AngouriMath/Core/EquationSystem.cs
+++ b/Sources/AngouriMath/Core/EquationSystem.cs
@@ -17,13 +17,13 @@ namespace AngouriMath.Core
/// It is a system of arbitrary equations, not only those linear. However,
/// it is not a system of s.
///
- public sealed class EquationSystem : ILatexiseable
+ public sealed class EquationSystem : ILatexizeable
{
private readonly IEnumerable equations;
///
/// The equations you pass should not have an node.
- /// After having created a system of equations, you may solve or latexise it.
+ /// After having created a system of equations, you may solve or latexize it.
///
///
/// Any parameter, such as or .
@@ -40,7 +40,7 @@ public sealed class EquationSystem : ILatexiseable
///
/// The equations you pass should not have an node.
- /// After having created a system of equations, you may solve or latexise it.
+ /// After having created a system of equations, you may solve or latexize it.
///
///
/// An
@@ -73,19 +73,19 @@ public sealed class EquationSystem : ILatexiseable
public Matrix? Solve(params Variable[] vars) => EquationSolver.SolveSystem(equations, vars);
///
- /// Latexised version of the system. It adds
+ /// Latexized version of the system. It adds
/// zero equality to all the provided expressions
///
- public string Latexise()
+ public string Latexize()
{
using var enumerator = equations.GetEnumerator();
if (!enumerator.MoveNext())
return string.Empty;
- var firstEquation = enumerator.Current.Latexise() + " = 0";
+ var firstEquation = enumerator.Current.Latexize() + " = 0";
if (!enumerator.MoveNext())
return firstEquation;
var sb = new StringBuilder(@"\begin{cases}").Append(firstEquation);
- do sb.Append(@"\\").Append(enumerator.Current.Latexise()).Append(" = 0");
+ do sb.Append(@"\\").Append(enumerator.Current.Latexize()).Append(" = 0");
while (enumerator.MoveNext());
sb.Append(@"\end{cases}");
return sb.ToString();
diff --git a/Sources/AngouriMath/Docs/Contributing/AddingNode.cs b/Sources/AngouriMath/Docs/Contributing/AddingNode.cs
index 706b8248f..9389ce304 100644
--- a/Sources/AngouriMath/Docs/Contributing/AddingNode.cs
+++ b/Sources/AngouriMath/Docs/Contributing/AddingNode.cs
@@ -30,7 +30,7 @@
/// 3. A few essential methods
/// a. InnerEval and InnerSimplify ( for numerical and for boolean)
/// b. Stringize () (and tests to CircleTest.cs)
-/// c. Latexise () (and tests to LatexTest.cs)
+/// c. Latexize () (and tests to LatexTest.cs)
/// d. Limit computation () (and tests to LimitTest.cs)
/// e. Hash for sorting ()
/// f. Default domain
diff --git a/Sources/AngouriMath/Docs/Usage/Syntax.md b/Sources/AngouriMath/Docs/Usage/Syntax.md
index 6ed53efcc..16c9ca781 100644
--- a/Sources/AngouriMath/Docs/Usage/Syntax.md
+++ b/Sources/AngouriMath/Docs/Usage/Syntax.md
@@ -16,7 +16,7 @@ form would silently come back as something else.
**LaTeX output has a round trip too, and it is checked in someone else's repository.**
[CSharpMath.Evaluation](https://github.com/verybadcat/CSharpMath/blob/master/CSharpMath.Evaluation/Evaluation.cs)
reads LaTeX back into an `Entity` and says so in its own source — *"CSharpMath must handle all
-LaTeX coming from AngouriMath or a bug is present!"* — so `Latexise` is free to use `\frac`,
+LaTeX coming from AngouriMath or a bug is present!"* — so `Latexize` is free to use `\frac`,
`\bmod` and the rest, but changing what it emits can break a downstream project and no test here
will say so ([#822](https://github.com/asc-community/AngouriMath/issues/822)).
diff --git a/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/AnalyticalEquationSolver.cs b/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/AnalyticalEquationSolver.cs
index 10c57537d..ff1ff55b1 100644
--- a/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/AnalyticalEquationSolver.cs
+++ b/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/AnalyticalEquationSolver.cs
@@ -15,7 +15,7 @@
namespace AngouriMath
{
- partial record Entity : ILatexiseable
+ partial record Entity : ILatexizeable
{
///
/// Attempt to find analytical roots of a custom equation.
diff --git a/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/InvertNode.Classes.cs b/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/InvertNode.Classes.cs
index c23be9bd1..c6f3a9d69 100644
--- a/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/InvertNode.Classes.cs
+++ b/Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/InvertNode.Classes.cs
@@ -10,7 +10,7 @@
namespace AngouriMath
{
- partial record Entity : ILatexiseable
+ partial record Entity : ILatexizeable
{
partial record Number
{
diff --git a/Sources/AngouriMath/Functions/Continuous/Solvers/InvertNode.Definition.cs b/Sources/AngouriMath/Functions/Continuous/Solvers/InvertNode.Definition.cs
index 0fae1201d..0bcdf1e32 100644
--- a/Sources/AngouriMath/Functions/Continuous/Solvers/InvertNode.Definition.cs
+++ b/Sources/AngouriMath/Functions/Continuous/Solvers/InvertNode.Definition.cs
@@ -7,7 +7,7 @@
namespace AngouriMath
{
- partial record Entity : ILatexiseable
+ partial record Entity : ILatexizeable
{
/// This MUST contain exactly ONE occurance of ,
/// otherwise this function won't work correctly.
diff --git a/Sources/AngouriMath/Functions/Continuous/Solvers/NumericalSolving/NewtonSolver.cs b/Sources/AngouriMath/Functions/Continuous/Solvers/NumericalSolving/NewtonSolver.cs
index 989a60b89..79b94cc6b 100644
--- a/Sources/AngouriMath/Functions/Continuous/Solvers/NumericalSolving/NewtonSolver.cs
+++ b/Sources/AngouriMath/Functions/Continuous/Solvers/NumericalSolving/NewtonSolver.cs
@@ -291,7 +291,7 @@ private static bool Satisfies(Entity expr, Entity.Variable v, Complex root)
namespace AngouriMath
{
- partial record Entity : ILatexiseable
+ partial record Entity : ILatexizeable
{
///
/// Searches for numerical solutions via Newton's method
diff --git a/Sources/AngouriMath/Functions/Output/Latex.Definition.cs b/Sources/AngouriMath/Functions/Output/Latex.Definition.cs
index 5eaaa03c8..cc1d86a3d 100644
--- a/Sources/AngouriMath/Functions/Output/Latex.Definition.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex.Definition.cs
@@ -8,7 +8,7 @@
namespace AngouriMath
{
using Core;
- partial record Entity : ILatexiseable
+ partial record Entity : ILatexizeable
{
///
/// Returns the expression in LaTeX
@@ -16,7 +16,7 @@ partial record Entity : ILatexiseable
///
///
/// Entity expr = "a / b + sqrt(c)";
- /// Console.WriteLine(expr.Latexise());
+ /// Console.WriteLine(expr.Latexize());
///
/// Output:
///
@@ -31,10 +31,10 @@ partial record Entity : ILatexiseable
///
/// Entity expr = "sqrt(a) + integral(sin(x), x)";
/// Console.WriteLine(expr);
- /// Console.WriteLine(expr.Latexise());
+ /// Console.WriteLine(expr.Latexize());
/// Entity expr2 = "a / b ^ limit(sin(x) - cosh(y), x, +oo)";
/// Console.WriteLine(expr2);
- /// Console.WriteLine(expr2.Latexise());
+ /// Console.WriteLine(expr2.Latexize());
///
/// Prints
///
@@ -44,7 +44,7 @@ partial record Entity : ILatexiseable
/// \frac{a}{{b}^{\lim_{x\to \infty } \left[\sin\left(x\right)-\frac{{e}^{y}+{e}^{-y}}{2}\right]}}
///
///
- public abstract string Latexise();
+ public abstract string Latexize();
///
/// Calculus operators, unlike other functions, have a between addition/subtraction
/// and multiplication/division which is different from .
@@ -53,7 +53,7 @@ partial record Entity : ILatexiseable
/// Returns the expression in LaTeX (for example, a / b -> \frac{a}{b})
/// Whether to wrap it with parentheses
- protected internal string Latexise(bool parenthesesRequired) =>
- parenthesesRequired ? @$"\left({Latexise()}\right)" : Latexise();
+ protected internal string Latexize(bool parenthesesRequired) =>
+ parenthesesRequired ? @$"\left({Latexize()}\right)" : Latexize();
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Arithmetics.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Arithmetics.Classes.cs
index 883e57cf7..7e0ccc40e 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Arithmetics.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Arithmetics.Classes.cs
@@ -14,24 +14,24 @@ partial record Entity
public partial record Sumf
{
///
- public override string Latexise() =>
- Augend.Latexise(Augend.LatexPriority < LatexPriority)
- + (Addend.Latexise(Addend.LatexPriority < LatexPriority) is var addend && addend.StartsWith("-")
+ public override string Latexize() =>
+ Augend.Latexize(Augend.LatexPriority < LatexPriority)
+ + (Addend.Latexize(Addend.LatexPriority < LatexPriority) is var addend && addend.StartsWith("-")
? addend : "+" + addend);
}
public partial record Minusf
{
///
- public override string Latexise() =>
- Minuend.Latexise(Minuend.LatexPriority < LatexPriority)
- + "-" + Subtrahend.Latexise(Subtrahend.LatexPriority <= LatexPriority);
+ public override string Latexize() =>
+ Minuend.Latexize(Minuend.LatexPriority < LatexPriority)
+ + "-" + Subtrahend.Latexize(Subtrahend.LatexPriority <= LatexPriority);
}
public partial record Mulf
{
///
- public override string Latexise()
+ public override string Latexize()
{
var longArray = GatherProducts(this).ToArray();
return longArray.AggregateIndexed("",
@@ -44,15 +44,15 @@ public override string Latexise()
{
// -1, -2, 2i, i, -i, -2i etc. in the front and not (1+i) etc.
Number { LatexPriority: Priority.Sum } and not Complex { RealPart.IsZero: false, ImaginaryPart.IsZero: false } =>
- currIn.Latexise(false),
- _ => currIn.Latexise(currIn.LatexPriority < LatexPriority)
+ currIn.Latexize(false),
+ _ => currIn.Latexize(currIn.LatexPriority < LatexPriority)
};
case 1:
if (longArray[index - 1] is Integer(-1))
- return $"-{currIn.Latexise(currIn.LatexPriority < LatexPriority)}"; // display "-1 * x * y" as "-x \cdot y", only for the first -1
+ return $"-{currIn.Latexize(currIn.LatexPriority < LatexPriority)}"; // display "-1 * x * y" as "-x \cdot y", only for the first -1
break;
}
- var currOut = currIn.Latexise(currIn.LatexPriority < LatexPriority);
+ var currOut = currIn.Latexize(currIn.LatexPriority < LatexPriority);
return (longArray[index - 1], currIn) switch // whether we use juxtaposition and omit \cdot
{
@@ -90,39 +90,39 @@ static IEnumerable GatherProducts(Entity expr)
public partial record Divf
{
///
- public override string Latexise() =>
- @"\frac{" + Dividend.Latexise() + "}{" + Divisor.Latexise() + "}";
+ public override string Latexize() =>
+ @"\frac{" + Dividend.Latexize() + "}{" + Divisor.Latexize() + "}";
}
public partial record Modf
{
///
- public override string Latexise() =>
- Dividend.Latexise(Dividend.Priority < Priority) + @" \bmod " + Divisor.Latexise(Divisor.Priority <= Priority);
+ public override string Latexize() =>
+ Dividend.Latexize(Dividend.Priority < Priority) + @" \bmod " + Divisor.Latexize(Divisor.Priority <= Priority);
}
public partial record Logf
{
///
- public override string Latexise() =>
+ public override string Latexize() =>
Base == 10
- ? @"\log\left(" + Antilogarithm.Latexise() + @"\right)"
+ ? @"\log\left(" + Antilogarithm.Latexize() + @"\right)"
: Base == MathS.e
- ? @"\ln\left(" + Antilogarithm.Latexise() + @"\right)"
- : @"\log_{" + Base.Latexise() + @"}\left(" + Antilogarithm.Latexise() + @"\right)";
+ ? @"\ln\left(" + Antilogarithm.Latexize() + @"\right)"
+ : @"\log_{" + Base.Latexize() + @"}\left(" + Antilogarithm.Latexize() + @"\right)";
}
public partial record Powf
{
///
- public override string Latexise()
+ public override string Latexize()
{
if (Exponent is Rational { ERational: { Numerator: var numerator, Denominator: var denominator } }
and not Integer)
{
var str =
@"\sqrt" + (denominator.Equals(2) ? "" : "[" + denominator + "]")
- + "{" + Base.Latexise() + "}";
+ + "{" + Base.Latexize() + "}";
var abs = numerator.Abs();
if (!abs.Equals(EInteger.One))
str += "^{" + abs + "}";
@@ -132,7 +132,7 @@ public override string Latexise()
}
else
{
- return "{" + Base.Latexise(Base.LatexPriority <= LatexPriority) + "}^{" + Exponent.Latexise() + "}";
+ return "{" + Base.Latexize(Base.LatexPriority <= LatexPriority) + "}^{" + Exponent.Latexize() + "}";
}
}
}
@@ -140,72 +140,72 @@ public override string Latexise()
public partial record Factorialf
{
///
- public override string Latexise() =>
- Argument.Latexise(Argument.LatexPriority <= LatexPriority) + "!";
+ public override string Latexize() =>
+ Argument.Latexize(Argument.LatexPriority <= LatexPriority) + "!";
}
partial record Signumf
{
///
- public override string Latexise()
- => $@"\operatorname{{sgn}}\left({Argument.Latexise()}\right)";
+ public override string Latexize()
+ => $@"\operatorname{{sgn}}\left({Argument.Latexize()}\right)";
}
partial record Absf
{
///
- public override string Latexise()
- => $@"\left|{Argument.Latexise()}\right|";
+ public override string Latexize()
+ => $@"\left|{Argument.Latexize()}\right|";
}
partial record Floorf
{
///
- public override string Latexise()
- => $@"\left\lfloor{{{Argument.Latexise()}}}\right\rfloor";
+ public override string Latexize()
+ => $@"\left\lfloor{{{Argument.Latexize()}}}\right\rfloor";
}
partial record Ceilf
{
///
- public override string Latexise()
- => $@"\left\lceil{{{Argument.Latexise()}}}\right\rceil";
+ public override string Latexize()
+ => $@"\left\lceil{{{Argument.Latexize()}}}\right\rceil";
}
partial record Roundf
{
// The nearest-integer brackets: a floor on the left, a ceiling on the right.
///
- public override string Latexise()
- => $@"\left\lfloor{{{Argument.Latexise()}}}\right\rceil";
+ public override string Latexize()
+ => $@"\left\lfloor{{{Argument.Latexize()}}}\right\rceil";
}
partial record Minf
{
///
- public override string Latexise()
- => $@"\min\left({Left.Latexise()}, {Right.Latexise()}\right)";
+ public override string Latexize()
+ => $@"\min\left({Left.Latexize()}, {Right.Latexize()}\right)";
}
partial record Maxf
{
///
- public override string Latexise()
- => $@"\max\left({Left.Latexise()}, {Right.Latexise()}\right)";
+ public override string Latexize()
+ => $@"\max\left({Left.Latexize()}, {Right.Latexize()}\right)";
}
partial record Gcdf
{
///
- public override string Latexise()
- => $@"\gcd\left({Left.Latexise()}, {Right.Latexise()}\right)";
+ public override string Latexize()
+ => $@"\gcd\left({Left.Latexize()}, {Right.Latexize()}\right)";
}
partial record Phif
{
///
// NOTE: \operatorname is used here to distinguish the phi function from variables, consistent with sgn and other functions.
- public override string Latexise() => $@"\operatorname{{\varphi}}\left({Argument.Latexise()}\right)";
+ public override string Latexize() => $@"\operatorname{{\varphi}}\left({Argument.Latexize()}\right)";
}
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Calculus.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Calculus.Classes.cs
index 3091653ef..d4a2a3c25 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Calculus.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Calculus.Classes.cs
@@ -19,39 +19,39 @@ partial record CalculusOperator
public partial record Derivativef
{
///
- public override string Latexise()
+ public override string Latexize()
{
if (Iterations < 0)
{
var sb = new StringBuilder();
for (int i = 0; i < -Iterations; i++)
sb.Append(@"\int");
- sb.Append(' ').Append(Expression.Latexise(Expression.LatexPriority < Priority.LatexCalculusOperation));
+ sb.Append(' ').Append(Expression.Latexize(Expression.LatexPriority < Priority.LatexCalculusOperation));
for (int i = 0; i < -Iterations; i++)
{
sb.Append(@"\,");
sb.Append(@"\mathrm{d}");
- sb.Append(Var.Latexise(Var is not Variable { IsLatexUprightFormatted: false }));
+ sb.Append(Var.Latexize(Var is not Variable { IsLatexUprightFormatted: false }));
}
return sb.ToString();
}
var powerIfNeeded = Iterations == 1 ? "" : "^{" + Iterations + "}";
// NOTE: \mathrm{d} is used for upright 'd' following ISO 80000-2 standard.
// The differential operator should be upright (roman) to distinguish it from variables, similar to sin, cos, log, etc.
- return $$"""\frac{\mathrm{d}{{powerIfNeeded}}}{\mathrm{d}{{Var.Latexise(Var is not Variable { IsLatexUprightFormatted: false })
- }}{{powerIfNeeded}}}{{Expression.Latexise(Expression.LatexPriority < Priority.LatexCalculusOperation)}}""";
+ return $$"""\frac{\mathrm{d}{{powerIfNeeded}}}{\mathrm{d}{{Var.Latexize(Var is not Variable { IsLatexUprightFormatted: false })
+ }}{{powerIfNeeded}}}{{Expression.Latexize(Expression.LatexPriority < Priority.LatexCalculusOperation)}}""";
}
}
public partial record Integralf
{
///
- public override string Latexise()
+ public override string Latexize()
{
var sb = new StringBuilder(@"\int");
- if (Range is var (from, to)) sb.Append('_').Append('{').Append(from.Latexise()).Append('}').Append('^').Append('{').Append(to.Latexise()).Append('}');
- sb.Append(' ').Append(Expression.Latexise(Expression.LatexPriority < Priority.LatexCalculusOperation));
+ if (Range is var (from, to)) sb.Append('_').Append('{').Append(from.Latexize()).Append('}').Append('^').Append('{').Append(to.Latexize()).Append('}');
+ sb.Append(' ').Append(Expression.Latexize(Expression.LatexPriority < Priority.LatexCalculusOperation));
// NOTE: \mathrm{d} is used for upright 'd' following ISO 80000-2 standard.
// The differential operator should be upright (roman) to distinguish it from variables.
@@ -61,7 +61,7 @@ public override string Latexise()
// Thin spaces (\,) are added between differentials following standard practice.
sb.Append(@"\,"); // Leading space before first differential and between differentials
sb.Append(@"\mathrm{d}");
- sb.Append(Var.Latexise(Var is not Variable { IsLatexUprightFormatted: false }));
+ sb.Append(Var.Latexize(Var is not Variable { IsLatexUprightFormatted: false }));
return sb.ToString();
}
}
@@ -69,27 +69,27 @@ public override string Latexise()
public partial record Limitf
{
///
- public override string Latexise()
+ public override string Latexize()
{
var sb = new StringBuilder();
- sb.Append(@"\lim_{").Append(Var.Latexise())
+ sb.Append(@"\lim_{").Append(Var.Latexize())
.Append(@"\to ");
switch (ApproachFrom)
{
case ApproachFrom.Left:
- sb.Append(Destination.Latexise(Destination.LatexPriority <= Priority.Pow)).Append("^-");
+ sb.Append(Destination.Latexize(Destination.LatexPriority <= Priority.Pow)).Append("^-");
break;
case ApproachFrom.Right:
- sb.Append(Destination.Latexise(Destination.LatexPriority <= Priority.Pow)).Append("^+");
+ sb.Append(Destination.Latexize(Destination.LatexPriority <= Priority.Pow)).Append("^+");
break;
case ApproachFrom.BothSides:
- sb.Append(Destination.Latexise());
+ sb.Append(Destination.Latexize());
break;
}
sb.Append("} ");
- sb.Append(Expression.Latexise(Expression.LatexPriority < Priority.LatexCalculusOperation));
+ sb.Append(Expression.Latexize(Expression.LatexPriority < Priority.LatexCalculusOperation));
return sb.ToString();
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Classes.cs
index 842b89a1e..7cdc734a2 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Classes.cs
@@ -37,22 +37,22 @@ internal static bool IsNameLatexUprightFormatted(string varName) =>
// Single-letter variables remain italic as per standard mathematical typography.
varName.Length > 1 && !LatexisableConstants.Contains(varName);
///
- /// Returns latexised const if it is possible to latexise it,
+ /// Returns latexized const if it is possible to latexize it,
/// or its original name otherwise
///
- public override string Latexise()
+ public override string Latexize()
{
- static string LatexisePart(string symbol)
+ static string LatexizePart(string symbol)
{
var inner = LatexisableConstants.Contains(symbol) ? $@"\{symbol}" : symbol;
return IsNameLatexUprightFormatted(symbol) ? $@"\mathrm{{{inner}}}" : inner;
}
// For variables with subscripts (e.g., "pi_2", "x_e", "e_pi")
- // Both the main part and subscript are processed through LatexisePart,
+ // Both the main part and subscript are processed through LatexizePart,
// which handles upright formatting for "pi" and "e" consistently
return SplitIndex() is var (prefix, index)
- ? $"{LatexisePart(prefix)}_{{{LatexisePart(index)}}}"
- : LatexisePart(Name);
+ ? $"{LatexizePart(prefix)}_{{{LatexizePart(index)}}}"
+ : LatexizePart(Name);
}
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Discrete.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Discrete.Classes.cs
index 0ee10e0ff..abe0d4c24 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Discrete.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Discrete.Classes.cs
@@ -13,22 +13,22 @@ partial record Entity
partial record Boolean
{
///
- public override string Latexise() => (bool)this ? @"\top " : @"\bot ";
+ public override string Latexize() => (bool)this ? @"\top " : @"\bot ";
}
partial record Notf
{
///
- public override string Latexise()
+ public override string Latexize()
=> Argument is Equalsf(var left, var right)
- ? $@"{left.Latexise(left.LatexPriority <= Priority.Equal)} \neq {right.Latexise(right.LatexPriority <= Priority.Equal)}"
- : $@"\neg{{{Argument.Latexise(Argument.LatexPriority < LatexPriority)}}}";
+ ? $@"{left.Latexize(left.LatexPriority <= Priority.Equal)} \neq {right.Latexize(right.LatexPriority <= Priority.Equal)}"
+ : $@"\neg{{{Argument.Latexize(Argument.LatexPriority < LatexPriority)}}}";
}
partial record Andf
{
///
- public override string Latexise()
+ public override string Latexize()
{
var result = new System.Text.StringBuilder();
Entity? left = null;
@@ -42,7 +42,7 @@ public override string Latexise()
var renew = left != child.DirectChildren[0];
if (!first && renew) result.Append(@" \land ");
first = false;
- if (first || renew) result.Append(child.DirectChildren[0].Latexise(child.DirectChildren[0].LatexPriority <= child.LatexPriority));
+ if (first || renew) result.Append(child.DirectChildren[0].Latexize(child.DirectChildren[0].LatexPriority <= child.LatexPriority));
renew = false;
result.Append(child switch {
Equalsf => " = ",
@@ -50,24 +50,24 @@ public override string Latexise()
GreaterOrEqualf => @" \geq ",
Lessf => " < ",
LessOrEqualf => @" \leq ",
- _ => throw new Core.Exceptions.AngouriBugException("Unexpected comparison sign in Andf.Latexise")
- }).Append(child.DirectChildren[1].Latexise(child.DirectChildren[1].LatexPriority <= child.LatexPriority));
+ _ => throw new Core.Exceptions.AngouriBugException("Unexpected comparison sign in Andf.Latexize")
+ }).Append(child.DirectChildren[1].Latexize(child.DirectChildren[1].LatexPriority <= child.LatexPriority));
left = child.DirectChildren[1];
break;
case Notf (Equalsf eq):
renew = left != eq.Left;
if (!first && renew) result.Append(@" \land ");
first = false;
- if (first || renew) result.Append(eq.Left.Latexise(eq.Left.LatexPriority <= eq.LatexPriority));
+ if (first || renew) result.Append(eq.Left.Latexize(eq.Left.LatexPriority <= eq.LatexPriority));
renew = false;
- result.Append(@" \neq ").Append(eq.Right.Latexise(eq.Right.LatexPriority <= eq.LatexPriority));
+ result.Append(@" \neq ").Append(eq.Right.Latexize(eq.Right.LatexPriority <= eq.LatexPriority));
left = eq.Right;
break;
default:
if (!first) result.Append(" \\land ");
left = null;
first = false;
- result.Append(child.Latexise(child.LatexPriority < LatexPriority));
+ result.Append(child.Latexize(child.LatexPriority < LatexPriority));
break;
}
}
@@ -78,16 +78,16 @@ public override string Latexise()
partial record Orf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority < LatexPriority)} \lor {Right.Latexise(Right.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority < LatexPriority)} \lor {Right.Latexize(Right.LatexPriority < LatexPriority)}";
}
partial record Xorf
{
///
// NOTE: \veebar (⊻) can disambiguate better than \oplus (⊕) which can mean the direct sum in algebra.
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority < LatexPriority)} \veebar {Right.Latexise(Right.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority < LatexPriority)} \veebar {Right.Latexize(Right.LatexPriority < LatexPriority)}";
}
partial record Impliesf
@@ -98,22 +98,22 @@ partial record Impliesf
// \implies (⇒) is a metalanguage symbol indicating a logical consequence or entailment. It's used to express that one statement logically follows from another.
// ISO 80000-2 puts ⇒ first for implies, but → is also accepted and is more common in logic contexts.
// ⇒ can be used in steps for proofs if we were to add it later.
- public override string Latexise()
- => $@"{Assumption.Latexise(Assumption.LatexPriority <= LatexPriority)} \to {Conclusion.Latexise(Conclusion.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Assumption.Latexize(Assumption.LatexPriority <= LatexPriority)} \to {Conclusion.Latexize(Conclusion.LatexPriority < LatexPriority)}";
}
partial record Equalsf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority <= LatexPriority)} = {Right.Latexise(Right.LatexPriority <= LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority <= LatexPriority)} = {Right.Latexize(Right.LatexPriority <= LatexPriority)}";
}
partial record Greaterf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority <= LatexPriority)} > {Right.Latexise(Right.LatexPriority <= LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority <= LatexPriority)} > {Right.Latexize(Right.LatexPriority <= LatexPriority)}";
}
partial record GreaterOrEqualf
@@ -121,15 +121,15 @@ partial record GreaterOrEqualf
///
// NOTE: While \geqslant (⩾) is more used in e.g. Russian texts, \geq (≥) is more universally used in English texts.
// Since the output language of LaTeX is English (referencing Piecewise and Providedf), \geq is more appropriate.
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority <= LatexPriority)} \geq {Right.Latexise(Right.LatexPriority <= LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority <= LatexPriority)} \geq {Right.Latexize(Right.LatexPriority <= LatexPriority)}";
}
partial record Lessf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority <= LatexPriority)} < {Right.Latexise(Right.LatexPriority <= LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority <= LatexPriority)} < {Right.Latexize(Right.LatexPriority <= LatexPriority)}";
}
partial record LessOrEqualf
@@ -137,8 +137,8 @@ partial record LessOrEqualf
///
// NOTE: While \leqslant (⩽) is more used in e.g. Russian texts, \leq (≤) is more universally used in English texts.
// Since the output language of LaTeX is English (referencing Piecewise and Providedf), \leq is more appropriate.
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority <= LatexPriority)} \leq {Right.Latexise(Right.LatexPriority <= LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority <= LatexPriority)} \leq {Right.Latexize(Right.LatexPriority <= LatexPriority)}";
}
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Number.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Number.Classes.cs
index d2fc03775..0e19b9019 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Number.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Number.Classes.cs
@@ -16,7 +16,7 @@ partial record Number
partial record Complex
{
///
- public override string Latexise()
+ public override string Latexize()
{
static string RenderNum(Real number)
{
@@ -25,22 +25,22 @@ static string RenderNum(Real number)
else if (number == Integer.One)
return "";
else
- return number.Latexise();
+ return number.Latexize();
}
if (ImaginaryPart is Integer(0))
- return RealPart.Latexise();
+ return RealPart.Latexize();
else if (RealPart is Integer(0))
return RenderNum(ImaginaryPart) + @"\mathrm{i}"; // Display i upright per ISO 80000-2.
var (im, sign) = ImaginaryPart > 0 ? (ImaginaryPart, "+") : (-ImaginaryPart, "-");
- return RealPart.Latexise() + " " + sign + " " +
- (im == 1 ? "" : im.Latexise(ImaginaryPart is Rational and not Integer)) + @"\mathrm{i}";
+ return RealPart.Latexize() + " " + sign + " " +
+ (im == 1 ? "" : im.Latexize(ImaginaryPart is Rational and not Integer)) + @"\mathrm{i}";
}
}
partial record Real
{
///
- public override string Latexise() => this switch
+ public override string Latexize() => this switch
{
{ IsFinite: true } => EDecimal.ToString(),
{ IsNaN: true } => @"\mathrm{undefined}",
@@ -52,14 +52,14 @@ partial record Real
partial record Rational
{
///
- public override string Latexise() => $@"\frac{{{ERational.Numerator}}}{{{ERational.Denominator}}}";
+ public override string Latexize() => $@"\frac{{{ERational.Numerator}}}{{{ERational.Denominator}}}";
}
partial record Integer
{
///
- public override string Latexise() => EInteger.ToString();
+ public override string Latexize() => EInteger.ToString();
}
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Omni.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Omni.Classes.cs
index f0acc2c82..ad97a0428 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Omni.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Omni.Classes.cs
@@ -16,8 +16,8 @@ partial record Set
partial record FiniteSet
{
///
- public override string Latexise()
- => IsSetEmpty ? @"\emptyset" : $@"\left\{{ {string.Join(", ", Elements.Select(c => c.Latexise()))} \right\}}";
+ public override string Latexize()
+ => IsSetEmpty ? @"\emptyset" : $@"\left\{{ {string.Join(", ", Elements.Select(c => c.Latexize()))} \right\}}";
}
partial record Interval
@@ -25,73 +25,73 @@ partial record Interval
///
// NOTE: Comma is used as the separator following standard mathematical notation (ISO 80000-2).
// Some regional variants use semicolon, but comma is more universally recognized.
- public override string Latexise()
+ public override string Latexize()
{
var left = LeftClosed ? "[" : "(";
var right = RightClosed ? "]" : ")";
- return @"\left" + left + Left.Latexise() + ", " + Right.Latexise() + @"\right" + right;
+ return @"\left" + left + Left.Latexize() + ", " + Right.Latexize() + @"\right" + right;
}
}
partial record ConditionalSet
{
///
- public override string Latexise()
- => $@"\left\{{ {Var.Latexise()} : {Predicate.Latexise()} \right\}}";
+ public override string Latexize()
+ => $@"\left\{{ {Var.Latexize()} : {Predicate.Latexize()} \right\}}";
}
partial record SpecialSet
{
///
- public override string Latexise()
+ public override string Latexize()
=> $@"\mathbb{{{Stringize()[0]}}}";
}
partial record Unionf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority < LatexPriority)} \cup {Right.Latexise(Right.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority < LatexPriority)} \cup {Right.Latexize(Right.LatexPriority < LatexPriority)}";
}
partial record Intersectionf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority < LatexPriority)} \cap {Right.Latexise(Right.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority < LatexPriority)} \cap {Right.Latexize(Right.LatexPriority < LatexPriority)}";
}
partial record SetMinusf
{
///
- public override string Latexise()
- => $@"{Left.Latexise(Left.LatexPriority < LatexPriority)} \setminus {Right.Latexise(Right.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Left.Latexize(Left.LatexPriority < LatexPriority)} \setminus {Right.Latexize(Right.LatexPriority < LatexPriority)}";
}
partial record Inf
{
///
- public override string Latexise()
- => $@"{Element.Latexise(Element.LatexPriority < LatexPriority)} \in {SupSet.Latexise(SupSet.LatexPriority < LatexPriority)}";
+ public override string Latexize()
+ => $@"{Element.Latexize(Element.LatexPriority < LatexPriority)} \in {SupSet.Latexize(SupSet.LatexPriority < LatexPriority)}";
}
}
partial record Providedf
{
///
- public override string Latexise() => $@"{Expression.Latexise(Expression.LatexPriority < LatexPriority)} \quad \text{{for}} \quad {Predicate.Latexise(Predicate.LatexPriority < LatexPriority)}";
+ public override string Latexize() => $@"{Expression.Latexize(Expression.LatexPriority < LatexPriority)} \quad \text{{for}} \quad {Predicate.Latexize(Predicate.LatexPriority < LatexPriority)}";
}
partial record Piecewise
{
///
- public override string Latexise() => @"\begin{cases}" +
+ public override string Latexize() => @"\begin{cases}" +
string.Join(@"\\",
Cases.Select(c =>
{
if (c.Predicate == Boolean.True)
- return $@"{c.Expression.Latexise(c.Expression.LatexPriority < Priority.Provided)} & \text{{otherwise}}";
- return $@"{c.Expression.Latexise(c.Expression.LatexPriority < Priority.Provided)} & \text{{for }} {c.Predicate.Latexise(c.Predicate.LatexPriority <= Priority.Provided)}"; // "for" used in https://mathworld.wolfram.com/Derivative.html
+ return $@"{c.Expression.Latexize(c.Expression.LatexPriority < Priority.Provided)} & \text{{otherwise}}";
+ return $@"{c.Expression.Latexize(c.Expression.LatexPriority < Priority.Provided)} & \text{{for }} {c.Predicate.Latexize(c.Predicate.LatexPriority <= Priority.Provided)}"; // "for" used in https://mathworld.wolfram.com/Derivative.html
}
))
+
@@ -101,13 +101,13 @@ public override string Latexise() => @"\begin{cases}" +
partial record Matrix
{
///
- public override string Latexise()
+ public override string Latexize()
{
if (IsVector)
{
var sb = new StringBuilder();
sb.Append(@"\begin{bmatrix}");
- sb.Append(string.Join(@" \\ ", InnerMatrix.Iterate().Select(k => k.Value.Latexise())));
+ sb.Append(string.Join(@" \\ ", InnerMatrix.Iterate().Select(k => k.Value.Latexize())));
sb.Append(@"\end{bmatrix}");
return sb.ToString();
}
@@ -120,7 +120,7 @@ public override string Latexise()
var items = new List();
for (int y = 0; y < ColumnCount; y++)
- items.Add(this[x, y].Latexise());
+ items.Add(this[x, y].Latexize());
var line = string.Join(" & ", items);
lines.Add(line);
@@ -137,12 +137,12 @@ partial record Application
///
// NOTE: Application represents curried function application. Multiple arguments
// are rendered as separate applications: f(x)(y) rather than f(x, y)
- public override string Latexise()
+ public override string Latexize()
{
- var result = new StringBuilder(Expression.Latexise(Expression.LatexPriority < LatexPriority));
+ var result = new StringBuilder(Expression.Latexize(Expression.LatexPriority < LatexPriority));
foreach (var arg in Arguments)
{
- result.Append(@"\left(").Append(arg.Latexise()).Append(@"\right)");
+ result.Append(@"\left(").Append(arg.Latexize()).Append(@"\right)");
}
return result.ToString();
}
@@ -153,8 +153,8 @@ partial record Lambda
///
// NOTE: \mapsto (↦) links the function variable with its output while
// \rightarrow (→) links the function domain with its codomain. See https://math.stackexchange.com/a/651240, https://math.stackexchange.com/a/936591
- public override string Latexise()
- => Parameter.Latexise() + @" \mapsto " + Body.Latexise(Body.LatexPriority < LatexPriority);
+ public override string Latexize()
+ => Parameter.Latexize() + @" \mapsto " + Body.Latexize(Body.LatexPriority < LatexPriority);
}
}
}
diff --git a/Sources/AngouriMath/Functions/Output/Latex/Latex.Trigonometry.Classes.cs b/Sources/AngouriMath/Functions/Output/Latex/Latex.Trigonometry.Classes.cs
index b9b618861..cef7f4840 100644
--- a/Sources/AngouriMath/Functions/Output/Latex/Latex.Trigonometry.Classes.cs
+++ b/Sources/AngouriMath/Functions/Output/Latex/Latex.Trigonometry.Classes.cs
@@ -12,85 +12,85 @@ partial record Entity
public partial record Sinf
{
///
- public override string Latexise() =>
- @"\sin\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\sin\left(" + Argument.Latexize() + @"\right)";
}
public partial record Cosf
{
///
- public override string Latexise() =>
- @"\cos\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\cos\left(" + Argument.Latexize() + @"\right)";
}
public partial record Secantf
{
///
- public override string Latexise() =>
- @"\sec\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\sec\left(" + Argument.Latexize() + @"\right)";
}
public partial record Cosecantf
{
///
- public override string Latexise() =>
- @"\csc\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\csc\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arcsecantf
{
///
- public override string Latexise() =>
- @"\operatorname{arcsec}\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\operatorname{arcsec}\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arccosecantf
{
///
- public override string Latexise() =>
- @"\operatorname{arccsc}\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\operatorname{arccsc}\left(" + Argument.Latexize() + @"\right)";
}
public partial record Tanf
{
///
- public override string Latexise() =>
- @"\tan\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\tan\left(" + Argument.Latexize() + @"\right)";
}
public partial record Cotanf
{
///
- public override string Latexise() =>
- @"\cot\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\cot\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arcsinf
{
///
- public override string Latexise() =>
- @"\arcsin\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\arcsin\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arccosf
{
///
- public override string Latexise() =>
- @"\arccos\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\arccos\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arctanf
{
///
- public override string Latexise() =>
- @"\arctan\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\arctan\left(" + Argument.Latexize() + @"\right)";
}
public partial record Arccotanf
{
///
- public override string Latexise() =>
- @"\operatorname{arccot}\left(" + Argument.Latexise() + @"\right)";
+ public override string Latexize() =>
+ @"\operatorname{arccot}\left(" + Argument.Latexize() + @"\right)";
}
}
}
diff --git a/Sources/AngouriMath/extension.dib b/Sources/AngouriMath/extension.dib
index 06d294f3d..2b597c221 100644
--- a/Sources/AngouriMath/extension.dib
+++ b/Sources/AngouriMath/extension.dib
@@ -28,7 +28,7 @@ Formatter.Register(o => o.ToString(), "text/plain");
Formatter.SetPreferredMimeTypesFor(typeof(PeterO.Numbers.EInteger), "text/plain");
Formatter.Register(o => o.ToString(), "text/plain");
-RegisterLatex(o => o.Latexise());
+RegisterLatex(o => o.Latexize());
RegisterLatex(o => $@"\frac{{{o.Numerator}}}{{{o.Denominator}}}");
diff --git a/Sources/Terminal/AngouriMath.Terminal.Lib/FSharpInteractive.fs b/Sources/Terminal/AngouriMath.Terminal.Lib/FSharpInteractive.fs
index 7fa253e60..db4cca0fd 100644
--- a/Sources/Terminal/AngouriMath.Terminal.Lib/FSharpInteractive.fs
+++ b/Sources/Terminal/AngouriMath.Terminal.Lib/FSharpInteractive.fs
@@ -22,8 +22,8 @@ JsonFSharpConverter () |> options.Converters.Add
let private objectEncode (o : obj) =
match o with
- | :? ILatexiseable as latexiseable ->
- let toSerialize = LatexSuccess (latexiseable.Latexise (), string o)
+ | :? ILatexizeable as latexizeable ->
+ let toSerialize = LatexSuccess (latexizeable.Latexize (), string o)
EncodingLatexPrefix + JsonSerializer.Serialize(toSerialize, options)
| _ ->
let toSerialize = PlainTextSuccess (string o)
diff --git a/Sources/Tests/CPPWrapperUnitTests/tests/RunTests.cpp b/Sources/Tests/CPPWrapperUnitTests/tests/RunTests.cpp
index 61ea0e60d..d439ad596 100644
--- a/Sources/Tests/CPPWrapperUnitTests/tests/RunTests.cpp
+++ b/Sources/Tests/CPPWrapperUnitTests/tests/RunTests.cpp
@@ -30,13 +30,13 @@ TEST(RunTests, ParsingTest3) {
TEST(RunTests, Latex1) {
auto src = "x + 1";
AngouriMath::Entity entity = src;
- EXPECT_EQ("x+1", entity.Latexise());
+ EXPECT_EQ("x+1", entity.Latexize());
}
TEST(RunTests, Latex2) {
auto src = "sqrt(x)";
AngouriMath::Entity entity = src;
- EXPECT_EQ("\\sqrt{x}", entity.Latexise());
+ EXPECT_EQ("\\sqrt{x}", entity.Latexize());
}
TEST(RunTests, DiffTest1) {
diff --git a/Sources/Tests/InteractiveWrapperUnitTests/HtmlOutput.fs b/Sources/Tests/InteractiveWrapperUnitTests/HtmlOutput.fs
index b2a5ddc11..e7d9673aa 100644
--- a/Sources/Tests/InteractiveWrapperUnitTests/HtmlOutput.fs
+++ b/Sources/Tests/InteractiveWrapperUnitTests/HtmlOutput.fs
@@ -13,7 +13,7 @@ open AngouriMath
open AngouriMath.FSharp.Functions
[]
-let ``Latex with magic ILatexiseable html`` () =
+let ``Latex with magic ILatexizeable html`` () =
AngouriMath.InteractiveExtension.KernelExtension.applyMagic()
let entity = parsed "x / 2"
let html = entity.ToDisplayString("text/html")
@@ -46,7 +46,7 @@ let ``Latex with magic ERational multi-char for html`` () =
[]
-let ``Latex with magic ILatexiseable latex`` () =
+let ``Latex with magic ILatexizeable latex`` () =
AngouriMath.InteractiveExtension.KernelExtension.applyMagic()
let entity = parsed "x / 2"
let latex = entity.ToDisplayString("text/latex")
diff --git a/Sources/Tests/UnitTests/Common/EveryNodeSurvivesEveryPipelineTest.cs b/Sources/Tests/UnitTests/Common/EveryNodeSurvivesEveryPipelineTest.cs
index 665914695..cb3de06b7 100644
--- a/Sources/Tests/UnitTests/Common/EveryNodeSurvivesEveryPipelineTest.cs
+++ b/Sources/Tests/UnitTests/Common/EveryNodeSurvivesEveryPipelineTest.cs
@@ -74,7 +74,7 @@ public static IEnumerable