@@ -33,6 +33,10 @@ Base.show(io::IO, ::MIME"text/latex", ::CustomLaTeXPrint) = print(io, "a_a")
33
33
@test sprint (show, x^ 2 + (1.0 + 3.1im ) * x) == " (1.0 + 3.1im)x + x²"
34
34
@test sprint (show, x^ 2 - (1.0 + 3.1im ) * x) == " (-1.0 - 3.1im)x + x²"
35
35
36
+ @test sprint (show, 1e-8 + 3.2e7 * x + 4.5 * x^ 2 ) == " 1.0e-8 + 3.2e7x + 4.5x²"
37
+ @test sprint (show, " text/plain" , 1e-8 + 3.2e7 * x + 4.5 * x^ 2 ) == " 1.0e-8 + 3.2e7x + 4.5x²"
38
+ @test sprint (show, " text/latex" , 1e-8 + 3.2e7 * x + 4.5 * x^ 2 ) == " \$\$ 1.0 \\ cdot 10^{-8} + 3.2 \\ cdot 10^{7}x + 4.5x^{2} \$\$ "
39
+
36
40
Mod. @polyvar x[0 : 9 ]
37
41
@test sprint (show, sum (i* x[i]^ i for i= 1 : 10 )) == " x₀ + 2x₁² + 3x₂³ + 4x₃⁴ + 5x₄⁵ + 6x₅⁶ + 7x₆⁷ + 8x₇⁸ + 9x₈⁹ + 10x₉¹⁰"
38
42
@test sprint (show, " text/latex" , sum (i* x[i]^ i for i= 1 : 10 )) == " \$\$ x_{0} + 2x_{1}^{2} + 3x_{2}^{3} + 4x_{3}^{4} + 5x_{4}^{5} + 6x_{5}^{6} + 7x_{6}^{7} + 8x_{7}^{8} + 9x_{8}^{9} + 10x_{9}^{10} \$\$ "
@@ -45,6 +49,6 @@ Base.show(io::IO, ::MIME"text/latex", ::CustomLaTeXPrint) = print(io, "a_a")
45
49
@test sprint (print, 2 x[1 ]^ 2 + 3 x[3 ]+ 1 + x[4 ]) == " 1 + x[4] + 3*x[3] + 2*x[1]^2"
46
50
47
51
a = CustomLaTeXPrint ()
48
- @test sprint ((io, x) -> show (io, MIME " text/latex" () , x), term (a, x[1 ]^ 2 )) == " \$\$ (a_a)x_{1}^{2} \$\$ "
49
- @test sprint ((io, x) -> show (io, MIME " text/latex" () , x), polynomial ([a, a], [x[1 ]^ 2 , x[2 ]])) == " \$\$ (a_a)x_{2} + (a_a)x_{1}^{2} \$\$ "
52
+ @test sprint ((io, x) -> show (io, " text/latex" , x), term (a, x[1 ]^ 2 )) == " \$\$ (a_a)x_{1}^{2} \$\$ "
53
+ @test sprint ((io, x) -> show (io, " text/latex" , x), polynomial ([a, a], [x[1 ]^ 2 , x[2 ]])) == " \$\$ (a_a)x_{2} + (a_a)x_{1}^{2} \$\$ "
50
54
end
0 commit comments