Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CSharpMath.Core.Tests/Atom/LaTeXParserTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,30 @@ public void TestModulo() {
Assert.Equal(@"x\bmod y", LaTeXParser.MathListToLaTeX(list).ToString());
}

/// <summary>
/// <c>\pmod{m}</c> is a quad, then "(mod m)": the operator name and the modulus inside parentheses.
/// </summary>
[Fact]
public void TestParenthesisedModulo() {
var list = ParseLaTeX(@"x\equiv y\pmod{z}");
Assert.Collection(list,
CheckAtom<Variable>("x"),
CheckAtom<Relation>("≡"),
CheckAtom<Variable>("y"),
CheckAtom<Space>("", space => {
Assert.Equal(Length.EmWidth.Amount, space.Length);
Assert.Equal(Length.EmWidth.IsMu, space.IsMu);
}),
CheckAtom<Inner>("", inner => {
Assert.Equal(new Boundary("("), inner.LeftBoundary);
Assert.Equal(new Boundary(")"), inner.RightBoundary);
Assert.Collection(inner.InnerList,
CheckAtom<LargeOperator>("mod"),
CheckAtom<Variable>("z"));
}));
Assert.Equal(@"x\equiv y\quad \left( \operatorname{mod} z\right) ", LaTeXParser.MathListToLaTeX(list).ToString());
}

[Theory]
[InlineData(@"\TeX")]
[InlineData(@"\left.\mathrm{T\! \raisebox{-4.5mu}{E}\mkern-2.25muX}\right.")]
Expand Down
Loading
Loading