From da9305a29952988c245e70097f27267b18c971ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Fri, 26 Apr 2024 00:55:04 -0300 Subject: [PATCH] gap: don't use deprecated LaTeX() and LaTeXObj() These functions were removed in 4.13. --- src/sage/groups/libgap_wrapper.pyx | 13 +++++-------- src/sage/interfaces/gap.py | 12 +++--------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index 0cf0e8bfb31..ddba766e94d 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -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): """ diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py index ee5861ac785..2e49e4c106f 100644 --- a/src/sage/interfaces/gap.py +++ b/src/sage/interfaces/gap.py @@ -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):