diff --git a/src/print.jl b/src/print.jl index 521f1b860d2..c48269fafb1 100644 --- a/src/print.jl +++ b/src/print.jl @@ -741,7 +741,7 @@ end function in_set_string(::MIME"text/latex", set::MOI.Interval) lower, upper = _string_round(set.lower), _string_round(set.upper) - return string("\\in \\[", lower, ", ", upper, "\\]") + return string("\\in [", lower, ", ", upper, "]") end function in_set_string(mode::MIME"text/plain", set::MOI.Interval) diff --git a/test/test_print.jl b/test/test_print.jl index faae676ec67..761f5776e69 100644 --- a/test/test_print.jl +++ b/test/test_print.jl @@ -502,8 +502,7 @@ function test_extension_printing_scalaraffinefunction_constraints( @test sprint(show, "text/latex", linear_le) == "\$\$ x \\leq 1 \$\$" @test sprint(show, "text/latex", linear_ge) == "\$\$ x \\geq 1 \$\$" @test sprint(show, "text/latex", linear_eq) == "\$\$ x = 1 \$\$" - @test sprint(show, "text/latex", linear_range) == - "\$\$ x \\in \\[-1, 1\\] \$\$" + @test sprint(show, "text/latex", linear_range) == "\$\$ x \\in [-1, 1] \$\$" @test sprint(show, "text/latex", linear_noname) == "\$\$ x \\leq 1 \$\$" return end @@ -963,4 +962,9 @@ function test_print_model_with_huge_integers() return end +function test_print_text_latex_interval_set() + @test in_set_string(MIME("text/latex"), MOI.Interval(1, 2)) == "\\in [1, 2]" + return +end + end