Skip to content

Commit

Permalink
gap: don't use deprecated LaTeX() and LaTeXObj()
Browse files Browse the repository at this point in the history
These functions were removed in 4.13.
  • Loading branch information
tornaria committed Apr 27, 2024
1 parent c4363fc commit da9305a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
13 changes: 5 additions & 8 deletions src/sage/groups/libgap_wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,11 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
sage: from sage.groups.libgap_group import GroupLibGAP
sage: G = GroupLibGAP(libgap.FreeGroup('a', 'b'))
sage: g = G.gen(0) * G.gen(1)
sage: g._latex_()
"ab%\n"
"""
try:
return self.gap().LaTeX()
except ValueError:
from sage.misc.latex import latex
return latex(self._repr_())
sage: latex(g)
\text{\texttt{a*b}}
"""
from sage.misc.latex import latex
return latex(self._repr_())

cpdef _mul_(left, right):
"""
Expand Down
12 changes: 3 additions & 9 deletions src/sage/interfaces/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,16 +1562,10 @@ def _latex_(self):
sage: s = gap("[[1,2], [3/4, 5/6]]")
sage: latex(s)
\left(\begin{array}{rr} 1&2\\ 3/4&\frac{5}{6}\\ \end{array}\right)
\left[\left[1, 2\right], \left[\frac{3}{4}, \frac{5}{6}\right]\right]
"""
P = self._check_valid()
try:
s = P.eval('LaTeXObj(%s)' % self.name())
s = s.replace('\\\\', '\\').replace('"', '')
s = s.replace('%\\n', ' ')
return s
except RuntimeError:
return str(self)
from sage.misc.latex import latex
return latex(self._sage_())

@cached_method
def _tab_completion(self):
Expand Down

0 comments on commit da9305a

Please sign in to comment.