Skip to content

Commit

Permalink
cutgeneratingfunctionology/spam/real_set.py: Another update from Sage…
Browse files Browse the repository at this point in the history
… 9.5.beta9
  • Loading branch information
mkoeppe committed Dec 30, 2021
1 parent 58df798 commit 1d61b5a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cutgeneratingfunctionology/spam/real_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,15 @@ def _latex_(self):
"""
from sage.misc.latex import latex
if self.is_point():
return r'\{' + latex(self.lower()) + r'\}'
# Converting to str avoids the extra whitespace
# that LatexExpr add on concenation. We do not need
# the whitespace because we are wrapping it in
# non-letter characters.
return r'\{' + str(latex(self.lower())) + r'\}'
s = '[' if self._lower_closed else '('
s += latex(self.lower())
s += str(latex(self.lower()))
s += ', '
s += latex(self.upper())
s += str(latex(self.upper()))
s += ']' if self._upper_closed else ')'
return s

Expand Down Expand Up @@ -1380,9 +1384,9 @@ def _latex_(self):
sage: from cutgeneratingfunctionology.spam.real_set import RealSet
sage: latex(RealSet(0, 1))
( 0 , 1 )
(0, 1)
sage: latex((RealSet(0, 1).union(RealSet.unbounded_above_closed(2))))
( 0 , 1 ) \cup [ 2 , +\infty )
(0, 1) \cup [2, +\infty)
"""
from sage.misc.latex import latex
if self.n_components() == 0:
Expand Down

0 comments on commit 1d61b5a

Please sign in to comment.