From c6de18ac3153a01d74da89c5a0a6f00342d921f8 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Xavier <31925649+pedromxavier@users.noreply.github.com> Date: Thu, 3 Feb 2022 16:03:17 -0300 Subject: [PATCH 1/2] Fix printing of intervals (jump-dev#1728) --- src/Utilities/print.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utilities/print.jl b/src/Utilities/print.jl index 017779fcd6..3e0464f755 100644 --- a/src/Utilities/print.jl +++ b/src/Utilities/print.jl @@ -297,11 +297,11 @@ end function _to_string(options::_PrintOptions{MIME"text/latex"}, set::MOI.Interval) return string( - "\\in \\[", + "\\in [", _shorten(options, set.lower), ", ", _shorten(options, set.upper), - "\\]", + "]", ) end From 24bf9e0428984d26801a67d7ee2bff991b1527b5 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Xavier <31925649+pedromxavier@users.noreply.github.com> Date: Thu, 3 Feb 2022 16:12:11 -0300 Subject: [PATCH 2/2] Fix tests for printing of intervals (jump-dev#1728) --- test/Utilities/print.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Utilities/print.jl b/test/Utilities/print.jl index bd12535672..34f1903517 100644 --- a/test/Utilities/print.jl +++ b/test/Utilities/print.jl @@ -199,7 +199,7 @@ end function test_Interval() s = MOI.Interval(1.2, 1.3) @test MOIU._to_string(PLAIN, s) == "$(IN) [1.2, 1.3]" - @test MOIU._to_string(LATEX, s) == "\\in \\[1.2, 1.3\\]" + @test MOIU._to_string(LATEX, s) == "\\in [1.2, 1.3]" end function test_ZeroOne() @@ -384,7 +384,7 @@ function test_latex() & \text{ScalarAffineFunction{Float64}-in-GreaterThan{Float64}} \\ & 0.0 + 2.0 x \ge 1.0 \\ & \text{ScalarAffineFunction{Float64}-in-Interval{Float64}} \\ - & 0.0 + 2.0 x \in \[1.0, 2.0\] \\ + & 0.0 + 2.0 x \in [1.0, 2.0] \\ & \text{ScalarQuadraticFunction{Float64}-in-LessThan{Float64}} \\ & 0.0 + 1.0 y - 1.0 z + 2.0 x^2 \le 1.0 \\ & \text{VectorOfVariables-in-SecondOrderCone} \\ @@ -457,7 +457,7 @@ function test_latex_simplified() \text{Subject to}\\ & x - y = 0 \\ & 2 x \ge 1 \\ - & 2 x \in \[1, 2\] \\ + & 2 x \in [1, 2] \\ & y - z + 2 x^2 \le 1 \\ & \begin{bmatrix} x\\