Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/Utilities/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions test/Utilities/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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} \\
Expand Down Expand Up @@ -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\\
Expand Down