Skip to content

Commit

Permalink
sagemathgh-37883: 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, but they weren't very good anyway.

This PR replaces its usage. It should work fine on old gap so this can
be merged just fine.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.

URL: sagemath#37883
Reported by: Gonzalo Tornaría
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Apr 28, 2024
2 parents 35c6aeb + da9305a commit 9e968f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=2d6779beb2e69f0f7bddc2edc44ad275442ffd29
md5=789344e03a6b57ba1538c0c760449720
cksum=3806733369
sha1=e0222376823475faac337ea488d4a30304b4ea9a
md5=c51194c0b4c266ab5affd32a5c22d77f
cksum=2696744150
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0a7b2513287af1124a358c2494b8bef4668a1882
f740aeac06a83268aa0df435948d04229b7a574b
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 9e968f8

Please sign in to comment.