Blob Blame History Raw
diff -up src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx.orig src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
--- src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx	2022-03-04 15:50:46.104253492 -0700
@@ -229,7 +229,7 @@ cdef class FreeAlgebraElement_letterplac
         return '0'
 
     def _latex_(self):
-        """
+        r"""
         TESTS::
 
             sage: K.<z> = GF(25)
diff -up src/sage/algebras/letterplace/free_algebra_letterplace.pyx.orig src/sage/algebras/letterplace/free_algebra_letterplace.pyx
--- src/sage/algebras/letterplace/free_algebra_letterplace.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/algebras/letterplace/free_algebra_letterplace.pyx	2022-03-04 15:50:46.104253492 -0700
@@ -618,7 +618,7 @@ cdef class FreeAlgebra_letterplace(Algeb
 
     # Auxiliar methods
     cdef str exponents_to_latex(self, E):
-        """
+        r"""
         This auxiliary method is used for the representation of elements of this free algebra as a latex string.
 
         EXAMPLES::
diff -up src/sage/coding/binary_code.pyx.orig src/sage/coding/binary_code.pyx
--- src/sage/coding/binary_code.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/coding/binary_code.pyx	2022-03-04 15:50:46.105253494 -0700
@@ -517,7 +517,7 @@ cdef codeword permute_word_by_wp(WordPer
     return image
 
 def test_expand_to_ortho_basis(B=None):
-    """
+    r"""
     This function is written in pure C for speed, and is tested from this
     function.
 
diff -up src/sage/coding/codecan/codecan.pyx.orig src/sage/coding/codecan/codecan.pyx
--- src/sage/coding/codecan/codecan.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/coding/codecan/codecan.pyx	2022-03-04 15:50:46.105253494 -0700
@@ -369,7 +369,7 @@ cdef class InnerGroup:
         return self.transporter
 
     def __repr__(self):
-        """
+        r"""
         EXAMPLES::
 
             sage: from sage.coding.codecan.codecan import InnerGroup
@@ -378,7 +378,7 @@ cdef class InnerGroup:
             frobenius power = 1 and partition = 0 -> 0 1 -> 1 2 -> 2 3 -> 3 4 -> 4 5 -> 5
             6 -> 6 7 -> 7 8 -> 8 9 -> 9
         """
-        return "Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \
+        return r"Subgroup of (GL(k,q) times \GF{q}^n ) rtimes Aut(\GF{q}) " + \
             "with rank = %s, frobenius power = %s and partition =%s" % (self.rank,
             self.frob_pow, OP_string(self.row_partition))
 
diff -up src/sage/combinat/crystals/letters.pyx.orig src/sage/combinat/crystals/letters.pyx
--- src/sage/combinat/crystals/letters.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/combinat/crystals/letters.pyx	2022-03-04 15:50:46.106253495 -0700
@@ -558,7 +558,7 @@ cdef class EmptyLetter(Element):
         return 'E'
 
     def _latex_(self):
-        """
+        r"""
         Return a latex representation of ``self``.
 
         EXAMPLES::
diff -up src/sage/combinat/crystals/tensor_product_element.pyx.orig src/sage/combinat/crystals/tensor_product_element.pyx
--- src/sage/combinat/crystals/tensor_product_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/combinat/crystals/tensor_product_element.pyx	2022-03-04 15:50:46.106253495 -0700
@@ -144,8 +144,8 @@ cdef class TensorProductOfCrystalsElemen
         """
         from sage.misc.latex import latex
         if self._parent.options.convention == "Kashiwara":
-            return ' \otimes '.join(latex(c) for c in reversed(self))
-        return ' \otimes '.join(latex(c) for c in self)
+            return r' \otimes '.join(latex(c) for c in reversed(self))
+        return r' \otimes '.join(latex(c) for c in self)
 
     def _ascii_art_(self):
         """
@@ -784,7 +784,7 @@ cdef class CrystalOfTableauxElement(Tens
         return repr(self.to_tableau())
 
     def _repr_diagram(self):
-        """
+        r"""
         Return a string representation of ``self`` as a diagram.
 
         EXAMPLES::
diff -up src/sage/graphs/matchpoly.pyx.orig src/sage/graphs/matchpoly.pyx
--- src/sage/graphs/matchpoly.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/graphs/matchpoly.pyx	2022-03-04 15:50:49.321258036 -0700
@@ -50,7 +50,7 @@ x = polygen(ZZ, 'x')
 
 
 def matching_polynomial(G, complement=True, name=None):
-    """
+    r"""
     Computes the matching polynomial of the graph `G`.
 
     If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges)
diff -up src/sage/graphs/strongly_regular_db.pyx.orig src/sage/graphs/strongly_regular_db.pyx
--- src/sage/graphs/strongly_regular_db.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/graphs/strongly_regular_db.pyx	2022-03-04 15:50:49.321258036 -0700
@@ -2397,7 +2397,7 @@ def strongly_regular_from_two_intersecti
 
     A set of points in the projective geometry `PG(k,q)` is said to be a
     2-intersection set if it intersects every hyperplane in either `h_1` or
-    `h_2` points, where `h_1,h_2\in \\NN`.
+    `h_2` points, where `h_1,h_2\in \NN`.
 
     From a 2-intersection set `S` can be defined a strongly-regular graph in the
     following way:
diff -up src/sage/groups/group.pyx.orig src/sage/groups/group.pyx
--- src/sage/groups/group.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/groups/group.pyx	2022-03-04 15:50:49.322258037 -0700
@@ -51,7 +51,7 @@ def is_Group(x):
 
 
 cdef class Group(Parent):
-    """
+    r"""
     Base class for all groups
 
     TESTS::
@@ -190,7 +190,7 @@ cdef class Group(Parent):
         return self.order() != infinity
 
     def is_multiplicative(self):
-        """
+        r"""
         Returns True if the group operation is given by \* (rather than
         +).
 
diff -up src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx.orig src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
--- src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx	2022-03-04 15:50:49.322258037 -0700
@@ -913,7 +913,7 @@ cdef class PartitionRefinement_generic:
                 "\\begin{tikzpicture}\n" +
                 "\\tikzset{level distance=3cm, edge from parent/.style=" +
                 "{draw, edge from parent path={(\\tikzparentnode.south) -- (\\tikzchildnode.north)}}}\n" +
-                "\Tree")
+                "\\Tree")
             self._latex_debug_string += "[."
             self._latex_act_node()
 
diff -up src/sage/groups/perm_gps/partn_ref/data_structures.pyx.orig src/sage/groups/perm_gps/partn_ref/data_structures.pyx
--- src/sage/groups/perm_gps/partn_ref/data_structures.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/groups/perm_gps/partn_ref/data_structures.pyx	2022-03-04 15:50:49.322258037 -0700
@@ -828,11 +828,11 @@ cdef SC_print_level(StabilizerChain *SC,
         print('| labels  {}'.format([SC.labels        [level][i] for i from 0 <= i < n]))
         print('|')
         print('| generators  {}'.format([[SC.generators  [level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
-        print('\ inverses    {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
+        print('\\ inverses    {}'.format([[SC.gen_inverses[level][n*i + j] for j from 0 <= j < n] for i from 0 <= i < SC.num_gens[level]]))
     else:
         print('/ level {}'.format(level))
         print('|')
-        print('\ base_size {}'.format(SC.base_size))
+        print('\\ base_size {}'.format(SC.base_size))
 
 cdef StabilizerChain *SC_new_base(StabilizerChain *SC, int *base, int base_len):
     """
diff -up src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx.orig src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx
--- src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx	2022-03-04 15:50:49.323258039 -0700
@@ -105,7 +105,7 @@ cdef class LinearBinaryCodeStruct(Binary
         self.ith_word = &ith_word_linear
 
     def run(self, partition=None):
-        """
+        r"""
         Perform the canonical labeling and automorphism group computation,
         storing results to self.
 
@@ -607,7 +607,7 @@ cdef int ith_word_nonlinear(BinaryCodeSt
     return 0
 
 cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_refine_by, int ctrb_len):
-    """
+    r"""
     Refines the input partition by checking degrees of vertices to the given
     cells in the associated bipartite graph (vertices split into columns and
     words).
@@ -731,7 +731,7 @@ cdef int refine_by_bip_degree(PartitionS
     return invariant
 
 cdef int compare_linear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree):
-    """
+    r"""
     Compare gamma_1(S1) and gamma_2(S2).
 
     Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2),
@@ -804,7 +804,7 @@ cdef int compare_linear_codes(int *gamma
     return 0
 
 cdef int compare_nonlinear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree):
-    """
+    r"""
     Compare gamma_1(S1) and gamma_2(S2).
 
     Return return -1 if gamma_1(S1) < gamma_2(S2), 0 if gamma_1(S1) == gamma_2(S2),
diff -up src/sage/groups/perm_gps/permgroup_element.pyx.orig src/sage/groups/perm_gps/permgroup_element.pyx
--- src/sage/groups/perm_gps/permgroup_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/groups/perm_gps/permgroup_element.pyx	2022-03-04 15:50:49.323258039 -0700
@@ -1175,7 +1175,7 @@ cdef class PermutationGroupElement(Multi
         return result
 
     cpdef _act_on_(self, x, bint self_on_left):
-        """
+        r"""
         Return the result of the action of ``self`` on ``x``.
 
         For example, if ``x=f(z)`` is a polynomial, then this function returns
@@ -1619,7 +1619,7 @@ cdef class PermutationGroupElement(Multi
         return ~self
 
     def sign(self):
-        """
+        r"""
         Returns the sign of self, which is `(-1)^{s}`, where
         `s` is the number of swaps.
 
diff -up src/sage/libs/eclib/newforms.pyx.orig src/sage/libs/eclib/newforms.pyx
--- src/sage/libs/eclib/newforms.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/eclib/newforms.pyx	2022-03-04 15:50:49.323258039 -0700
@@ -22,7 +22,7 @@ from sage.modular.all import Cusp
 
 
 cdef class ECModularSymbol:
-    """
+    r"""
     Modular symbol associated with an elliptic curve,  using John Cremona's newforms class.
 
     EXAMPLES::
diff -up src/sage/libs/fes.pyx.orig src/sage/libs/fes.pyx
--- src/sage/libs/fes.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/fes.pyx	2022-03-04 15:50:49.324258040 -0700
@@ -292,7 +292,7 @@ def find_coordinate_change(As, max_tries
 
 
 def prepare_polynomials(f):
-    """
+    r"""
     Finds a linear combination of the equations that is faster to solve by FES
 
     INPUT:
diff -up src/sage/libs/ntl/ntl_GF2E.pyx.orig src/sage/libs/ntl/ntl_GF2E.pyx
--- src/sage/libs/ntl/ntl_GF2E.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_GF2E.pyx	2022-03-04 15:50:49.324258040 -0700
@@ -73,7 +73,7 @@ def ntl_GF2E_random(ntl_GF2EContext_clas
 
 cdef class ntl_GF2E(object):
     r"""
-    The \\class{GF2E} represents a finite extension field over GF(2)
+    The \class{GF2E} represents a finite extension field over GF(2)
     using NTL. Elements are represented as polynomials over GF(2)
     modulo a modulus.
 
@@ -439,7 +439,7 @@ cdef class ntl_GF2E(object):
         return l
 
     def _sage_(ntl_GF2E self, k=None):
-        """
+        r"""
         Returns a \class{FiniteFieldElement} representation
         of this element. If a \class{FiniteField} k is provided
         it is constructed in this field if possible. A \class{FiniteField}
diff -up src/sage/libs/ntl/ntl_GF2X.pyx.orig src/sage/libs/ntl/ntl_GF2X.pyx
--- src/sage/libs/ntl/ntl_GF2X.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_GF2X.pyx	2022-03-04 15:50:49.324258040 -0700
@@ -484,7 +484,7 @@ cdef class ntl_GF2X(object):
         return [self[i] for i in range(GF2X_deg(self.x)+1)]
 
     def bin(ntl_GF2X self):
-        """
+        r"""
         Returns binary representation of this element. It is
         the same as setting \code{ntl.GF2XHexOutput(False)} and
         representing this element afterwards. However it should be
@@ -507,7 +507,7 @@ cdef class ntl_GF2X(object):
         return s
 
     def hex(ntl_GF2X self):
-        """
+        r"""
         Return an hexadecimal representation of this element.
 
         It is the same as setting \code{ntl.GF2XHexOutput(True)} and
diff -up src/sage/libs/ntl/ntl_mat_GF2E.pyx.orig src/sage/libs/ntl/ntl_mat_GF2E.pyx
--- src/sage/libs/ntl/ntl_mat_GF2E.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_mat_GF2E.pyx	2022-03-04 15:50:49.324258040 -0700
@@ -181,7 +181,7 @@ cdef class ntl_mat_GF2E(object):
         return unpickle_class_args, (ntl_mat_GF2E, (self.modulus_context(), self.x.NumRows(), self.x.NumCols(), self.list()))
 
     def __repr__(self):
-        """
+        r"""
         Return the string representation of self.
 
         EXAMPLES::
@@ -446,7 +446,7 @@ cdef class ntl_mat_GF2E(object):
         return r
 
     def gauss(self,ncols=-1):
-        """
+        r"""
         Performs unitary row operations so as to bring this matrix
         into row echelon form.  If the optional argument \code{ncols}
         is supplied, stops when first ncols columns are in echelon
diff -up src/sage/libs/ntl/ntl_mat_GF2.pyx.orig src/sage/libs/ntl/ntl_mat_GF2.pyx
--- src/sage/libs/ntl/ntl_mat_GF2.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_mat_GF2.pyx	2022-03-04 15:50:49.325258042 -0700
@@ -5,7 +5,7 @@
 # distutils: extra_link_args = NTL_LIBEXTRA
 # distutils: language = c++
 
-"""
+r"""
 Matrices over the $\GF{2}$ via NTL
 
 This class is only provided to have a complete NTL interface and for
@@ -376,7 +376,7 @@ cdef class ntl_mat_GF2(object):
         return r
 
     def gauss(self,ncols=-1):
-        """
+        r"""
         Performs unitary row operations so as to bring this matrix
         into row echelon form (not reduced!).  If the optional
         argument \code{ncols} is supplied, stops when first ncols
@@ -497,7 +497,7 @@ cdef class ntl_mat_GF2(object):
         return r
 
     def __invert__(self):
-        """
+        r"""
         Return $X = A^{-1}$; an error is raised if A is singular.
 
         EXAMPLES::
diff -up src/sage/libs/ntl/ntl_mat_ZZ.pyx.orig src/sage/libs/ntl/ntl_mat_ZZ.pyx
--- src/sage/libs/ntl/ntl_mat_ZZ.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_mat_ZZ.pyx	2022-03-04 15:50:49.325258042 -0700
@@ -73,7 +73,7 @@ cdef class ntl_mat_ZZ(object):
     The \class{mat_ZZ} class implements arithmetic with matrices over $\Z$.
     """
     def __init__(self, nrows=0,  ncols=0, v=None):
-        """
+        r"""
         The \class{mat_ZZ} class implements arithmetic with matrices over $\Z$.
 
         EXAMPLES::
@@ -129,7 +129,7 @@ cdef class ntl_mat_ZZ(object):
         return unpickle_class_args, (ntl_mat_ZZ, (self.__nrows, self.__ncols, self.list()))
 
     def __repr__(self):
-        """
+        r"""
         Return the string representation of self.
 
         EXAMPLES::
diff -up src/sage/libs/ntl/ntl_ZZ_pEX.pyx.orig src/sage/libs/ntl/ntl_ZZ_pEX.pyx
--- src/sage/libs/ntl/ntl_ZZ_pEX.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_ZZ_pEX.pyx	2022-03-04 15:50:49.325258042 -0700
@@ -5,7 +5,7 @@
 # distutils: extra_link_args = NTL_LIBEXTRA
 # distutils: language = c++
 
-"""
+r"""
 Wrapper for NTL's polynomials over finite ring extensions of $\Z / p\Z.$
 
 AUTHORS:
diff -up src/sage/libs/ntl/ntl_ZZX.pyx.orig src/sage/libs/ntl/ntl_ZZX.pyx
--- src/sage/libs/ntl/ntl_ZZX.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/ntl/ntl_ZZX.pyx	2022-03-04 15:50:49.326258043 -0700
@@ -692,7 +692,7 @@ cdef class ntl_ZZX(object):
         return (self*other).quo_rem(g)[0]
 
     def xgcd(self, ntl_ZZX other, proof=None):
-        """
+        r"""
         If self and other are coprime over the rationals, return r, s,
         t such that r = s*self + t*other.  Otherwise return 0.  This
         is \emph{not} the same as the \sage function on polynomials
diff -up src/sage/libs/singular/polynomial.pyx.orig src/sage/libs/singular/polynomial.pyx
--- src/sage/libs/singular/polynomial.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/singular/polynomial.pyx	2022-03-06 19:39:15.350978716 -0700
@@ -22,7 +22,7 @@ cdef extern from *: # hack to get at cyt
     int unlikely(int)
 
 import re
-plusminus_pattern = re.compile("([^\(^])([\+\-])")
+plusminus_pattern = re.compile(r"([^\(^])([\+\-])")
 parenthvar_pattern = re.compile(r"\(([a-zA-Z][a-zA-Z0-9]*)\)")
 
 
diff -up src/sage/libs/symmetrica/sc.pxi.orig src/sage/libs/symmetrica/sc.pxi
--- src/sage/libs/symmetrica/sc.pxi.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/libs/symmetrica/sc.pxi	2022-03-04 15:50:55.377266585 -0700
@@ -103,7 +103,7 @@ def charvalue_symmetrica(irred, cls, tab
 
 
 def kranztafel_symmetrica(a, b):
-    """
+    r"""
     you enter the INTEGER objects, say a and b, and res becomes a
     MATRIX object, the charactertable of S_b \wr S_a, co becomes a
     VECTOR object of classorders and cl becomes a VECTOR object of
diff -up src/sage/matrix/matrix0.pyx.orig src/sage/matrix/matrix0.pyx
--- src/sage/matrix/matrix0.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix0.pyx	2022-03-04 15:50:57.330269343 -0700
@@ -2292,7 +2292,7 @@ cdef class Matrix(sage.structure.element
     # Functions
     ###################################################
     def act_on_polynomial(self, f):
-        """
+        r"""
         Return the polynomial f(self\*x).
 
         INPUT:
@@ -2358,7 +2358,7 @@ cdef class Matrix(sage.structure.element
     # Arithmetic
     ###################################################
     def commutator(self, other):
-        """
+        r"""
         Return the commutator self\*other - other\*self.
 
         EXAMPLES::
@@ -4976,7 +4976,7 @@ cdef class Matrix(sage.structure.element
     # Arithmetic
     ###################################################
     cdef _vector_times_matrix_(self, Vector v):
-        """
+        r"""
         Return the vector times matrix product.
 
         INPUT:
diff -up src/sage/matrix/matrix2.pyx.orig src/sage/matrix/matrix2.pyx
--- src/sage/matrix/matrix2.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix2.pyx	2022-03-04 15:50:57.331269345 -0700
@@ -9744,7 +9744,7 @@ cdef class Matrix(Matrix1):
         return img
 
     def density(self):
-        """
+        r"""
         Return the density of the matrix.
 
         By density we understand the ratio of the number of nonzero
diff -up src/sage/matrix/matrix_integer_dense.pyx.orig src/sage/matrix/matrix_integer_dense.pyx
--- src/sage/matrix/matrix_integer_dense.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix_integer_dense.pyx	2022-03-04 15:50:57.332269347 -0700
@@ -746,7 +746,7 @@ cdef class Matrix_integer_dense(Matrix_d
         return ans
 
     def _multiply_classical(self, Matrix_integer_dense right):
-        """
+        r"""
         EXAMPLES::
 
             sage: n = 3
diff -up src/sage/matrix/matrix_modn_dense_template.pxi.orig src/sage/matrix/matrix_modn_dense_template.pxi
--- src/sage/matrix/matrix_modn_dense_template.pxi.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix_modn_dense_template.pxi	2022-03-04 15:50:57.333269348 -0700
@@ -635,7 +635,7 @@ cdef class Matrix_modn_dense_template(Ma
         return (word_size, little_endian, s), 10
 
     def _unpickle(self, data, int version):
-        """
+        r"""
         TESTS:
 
         Test for char-sized modulus::
@@ -2247,7 +2247,7 @@ cdef class Matrix_modn_dense_template(Ma
             return Matrix_dense.determinant(self)
 
     cdef xgcd_eliminate(self, celement * row1, celement* row2, Py_ssize_t start_col):
-        """
+        r"""
         Reduces ``row1`` and ``row2`` by a unimodular transformation
         using the xgcd relation between their first coefficients ``a`` and
         ``b``.
diff -up src/sage/matrix/matrix_polynomial_dense.pyx.orig src/sage/matrix/matrix_polynomial_dense.pyx
--- src/sage/matrix/matrix_polynomial_dense.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix_polynomial_dense.pyx	2022-03-04 15:50:57.333269348 -0700
@@ -55,16 +55,16 @@ cdef class Matrix_polynomial_dense(Matri
     commonly used in the literature.
 
     - Working column-wise: each column of the matrix is a vector in the basis;
-      then, a $\\Bold{K}[x]$-submodule of $\\Bold{K}[x]^{m}$ of rank $n$ is
-      represented by an $m \\times n$ matrix, whose columns span the module
-      (via $\\Bold{K}[x]$-linear combinations). This matrix has full rank,
-      and $n \\leq m$.
+      then, a $\Bold{K}[x]$-submodule of $\Bold{K}[x]^{m}$ of rank $n$ is
+      represented by an $m \times n$ matrix, whose columns span the module
+      (via $\Bold{K}[x]$-linear combinations). This matrix has full rank,
+      and $n \leq m$.
 
     - Working row-wise: each row of the matrix is a vector in the basis; then,
-      a $\\Bold{K}[x]$-submodule of $\\Bold{K}[x]^{n}$ of rank $m$ is
-      represented by an $m \\times n$ matrix, whose rows span the module (via
-      $\\Bold{K}[x]$-linear combinations). This matrix has full rank, and $m
-      \\leq n$.
+      a $\Bold{K}[x]$-submodule of $\Bold{K}[x]^{n}$ of rank $m$ is
+      represented by an $m \times n$ matrix, whose rows span the module (via
+      $\Bold{K}[x]$-linear combinations). This matrix has full rank, and $m
+      \leq n$.
 
     For the rest of this class description, we assume that one is working
     row-wise. For a given such module, all its bases are equivalent under
diff -up src/sage/matrix/matrix_rational_dense.pyx.orig src/sage/matrix/matrix_rational_dense.pyx
--- src/sage/matrix/matrix_rational_dense.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matrix/matrix_rational_dense.pyx	2022-03-04 15:50:57.334269350 -0700
@@ -507,7 +507,7 @@ cdef class Matrix_rational_dense(Matrix_
         return rich_to_bool(op, 0)
 
     cdef _vector_times_matrix_(self, Vector v):
-        """
+        r"""
         Returns the vector times matrix product.
 
         INPUT:
@@ -920,7 +920,7 @@ cdef class Matrix_rational_dense(Matrix_
         return 0
 
     def _clear_denom(self):
-        """
+        r"""
         INPUT:
 
 
@@ -1187,7 +1187,7 @@ cdef class Matrix_rational_dense(Matrix_
         return ans
 
     def _multiply_over_integers(self, Matrix_rational_dense right, algorithm='default'):
-        """
+        r"""
         Multiply this matrix by right using a multimodular algorithm and
         return the result.
 
diff -up src/sage/matroids/basis_exchange_matroid.pyx.orig src/sage/matroids/basis_exchange_matroid.pyx
--- src/sage/matroids/basis_exchange_matroid.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matroids/basis_exchange_matroid.pyx	2022-03-04 15:50:57.334269350 -0700
@@ -2115,7 +2115,7 @@ cdef class BasisExchangeMatroid(Matroid)
         return EQ[0]
 
     cpdef _is_isomorphism(self, other, morphism):
-        """
+        r"""
         Version of is_isomorphism() that does no type checking.
 
         INPUT:
diff -up src/sage/matroids/linear_matroid.pyx.orig src/sage/matroids/linear_matroid.pyx
--- src/sage/matroids/linear_matroid.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matroids/linear_matroid.pyx	2022-03-04 15:50:57.335269351 -0700
@@ -800,7 +800,7 @@ cdef class LinearMatroid(BasisExchangeMa
     # (field) isomorphism
 
     cpdef bint _is_field_isomorphism(self, LinearMatroid other, morphism):  # not safe if self == other
-        """
+        r"""
         Version of :meth:`<LinearMatroid.is_field_isomorphism>` that does no
         type checking.
 
@@ -966,7 +966,7 @@ cdef class LinearMatroid(BasisExchangeMa
         return self._is_field_isomorphism(other, morphism)
 
     cpdef is_field_isomorphism(self, other, morphism):
-        """
+        r"""
         Test if a provided morphism induces a bijection between represented
         matroids.
 
diff -up src/sage/matroids/matroid.pyx.orig src/sage/matroids/matroid.pyx
--- src/sage/matroids/matroid.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/matroids/matroid.pyx	2022-03-04 15:50:57.336269352 -0700
@@ -3147,7 +3147,7 @@ cdef class Matroid(SageObject):
         return Polyhedron(vertices)
 
     def independence_matroid_polytope(self):
-        """
+        r"""
         Return the independence matroid polytope of ``self``.
 
         This is defined as the convex hull of the vertices
@@ -3427,7 +3427,7 @@ cdef class Matroid(SageObject):
         return self._is_isomorphism(other, morphism)
 
     cpdef is_isomorphism(self, other, morphism):
-        """
+        r"""
         Test if a provided morphism induces a matroid isomorphism.
 
         A *morphism* is a map from the groundset of ``self`` to the groundset
@@ -3550,7 +3550,7 @@ cdef class Matroid(SageObject):
         return self._is_isomorphism(other, mf)
 
     cpdef _is_isomorphism(self, other, morphism):
-        """
+        r"""
         Version of is_isomorphism() that does no type checking.
 
         INPUT:
@@ -4313,7 +4313,7 @@ cdef class Matroid(SageObject):
         return self.dual().extension(element, subsets).dual()
 
     cpdef modular_cut(self, subsets):
-        """
+        r"""
         Compute the modular cut generated by ``subsets``.
 
         A *modular cut* is a collection `C` of flats such that
@@ -4714,7 +4714,7 @@ cdef class Matroid(SageObject):
         return True
 
     cpdef is_cosimple(self):
-        """
+        r"""
         Test if the matroid is cosimple.
 
         A matroid is *cosimple* if it contains no cocircuits of length 1 or 2.
@@ -7480,7 +7480,7 @@ cdef class Matroid(SageObject):
         return A
 
     cpdef tutte_polynomial(self, x=None, y=None):
-        """
+        r"""
         Return the Tutte polynomial of the matroid.
 
         The *Tutte polynomial* of a matroid is the polynomial
diff -up src/sage/misc/cachefunc.pyx.orig src/sage/misc/cachefunc.pyx
--- src/sage/misc/cachefunc.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/misc/cachefunc.pyx	2022-03-04 15:50:57.336269352 -0700
@@ -835,7 +835,7 @@ cdef class CachedFunction(object):
     ## forward other questions to the cached function.
 
     def _instancedoc_(self):
-        """
+        r"""
         Provide documentation for the cached function.
 
         A cached function shall inherit the documentation
diff -up src/sage/misc/sageinspect.py.orig src/sage/misc/sageinspect.py
--- src/sage/misc/sageinspect.py.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/misc/sageinspect.py	2022-03-04 15:50:57.336269352 -0700
@@ -881,7 +881,7 @@ class SageArgSpecVisitor(ast.NodeVisitor
 
 
 def _grep_first_pair_of_parentheses(s):
-    """
+    r"""
     Return the first matching pair of parentheses in a code string.
 
     INPUT:
@@ -936,7 +936,7 @@ def _grep_first_pair_of_parentheses(s):
 
 
 def _split_syntactical_unit(s):
-    """
+    r"""
     Split off a sub-expression from the start of a given string.
 
     INPUT:
diff -up src/sage/modular/arithgroup/arithgroup_element.pyx.orig src/sage/modular/arithgroup/arithgroup_element.pyx
--- src/sage/modular/arithgroup/arithgroup_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/modular/arithgroup/arithgroup_element.pyx	2022-03-04 15:50:57.337269354 -0700
@@ -194,7 +194,7 @@ cdef class ArithmeticSubgroupElement(Mul
         return richcmp(self.__x, right.__x, op)
 
     def __nonzero__(self):
-        """
+        r"""
         Return ``True``, since the ``self`` lives in SL(2,\Z), which does not
         contain the zero matrix.
 
diff -up src/sage/modular/arithgroup/farey_symbol.pyx.orig src/sage/modular/arithgroup/farey_symbol.pyx
--- src/sage/modular/arithgroup/farey_symbol.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/modular/arithgroup/farey_symbol.pyx	2022-03-04 15:50:57.337269354 -0700
@@ -615,7 +615,7 @@ cdef class Farey:
         if forced_format == 'plain':
             # output not using xymatrix
             s = r'\left( -\infty'
-            a = [x._latex_() for x in self.fractions()] + ['\infty']
+            a = [x._latex_() for x in self.fractions()] + [r'\infty']
             b = self.pairings()
             for i in xrange(len(a)):
                 u = b[i]
diff -up src/sage/modular/modsym/heilbronn.pyx.orig src/sage/modular/modsym/heilbronn.pyx
--- src/sage/modular/modsym/heilbronn.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/modular/modsym/heilbronn.pyx	2022-03-04 15:50:57.337269354 -0700
@@ -211,7 +211,7 @@ cdef class Heilbronn:
         sig_off()
 
     cdef apply_to_polypart(self, fmpz_poly_t* ans, int i, int k):
-        """
+        r"""
         INPUT:
 
         -  ``ans`` - fmpz_poly_t\*; pre-allocated an
diff -up src/sage/modules/free_module_element.pyx.orig src/sage/modules/free_module_element.pyx
--- src/sage/modules/free_module_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/modules/free_module_element.pyx	2022-03-04 15:50:57.338269355 -0700
@@ -2387,7 +2387,7 @@ cdef class FreeModuleElement(Vector):
 
     def plot_step(self, xmin=0, xmax=1, eps=None, res=None,
              connect=True, **kwds):
-        """
+        r"""
         INPUT:
 
         -  ``xmin`` - (default: 0) start x position to start
@@ -3722,7 +3722,7 @@ cdef class FreeModuleElement(Vector):
         from sage.misc.latex import latex
         vector_delimiters = latex.vector_delimiters()
         s = '\\left' + vector_delimiters[0]
-        s += ',\,'.join(latex(a) for a in self.list())
+        s += ',\\,'.join(latex(a) for a in self.list())
         return s + '\\right' + vector_delimiters[1]
 
     def dense_vector(self):
diff -up src/sage/numerical/backends/generic_backend.pyx.orig src/sage/numerical/backends/generic_backend.pyx
--- src/sage/numerical/backends/generic_backend.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/numerical/backends/generic_backend.pyx	2022-03-04 15:50:57.338269355 -0700
@@ -1376,7 +1376,7 @@ cdef class GenericBackend:
         raise NotImplementedError()
 
     cpdef bint is_variable_basic(self, int index):
-        """
+        r"""
         Test whether the given variable is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -1406,7 +1406,7 @@ cdef class GenericBackend:
         raise NotImplementedError()
 
     cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the given variable is nonbasic at lower bound.
 
         This assumes that the problem has been solved with the simplex method
@@ -1436,7 +1436,7 @@ cdef class GenericBackend:
         raise NotImplementedError()
 
     cpdef bint is_slack_variable_basic(self, int index):
-        """
+        r"""
         Test whether the slack variable of the given row is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -1466,7 +1466,7 @@ cdef class GenericBackend:
         raise NotImplementedError()
 
     cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the given variable is nonbasic at lower bound.
 
         This assumes that the problem has been solved with the simplex method
diff -up src/sage/numerical/backends/glpk_backend.pyx.orig src/sage/numerical/backends/glpk_backend.pyx
--- src/sage/numerical/backends/glpk_backend.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/numerical/backends/glpk_backend.pyx	2022-03-04 15:50:57.339269357 -0700
@@ -2312,7 +2312,7 @@ cdef class GLPKBackend(GenericBackend):
 
 
     cpdef bint is_variable_basic(self, int index):
-        """
+        r"""
         Test whether the given variable is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -2343,7 +2343,7 @@ cdef class GLPKBackend(GenericBackend):
         return self.get_col_stat(index) == GLP_BS
 
     cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the given variable is nonbasic at lower bound.
         This assumes that the problem has been solved with the simplex method
         and a basis is available.  Otherwise an exception will be raised.
@@ -2373,7 +2373,7 @@ cdef class GLPKBackend(GenericBackend):
         return self.get_col_stat(index) == GLP_NL
 
     cpdef bint is_slack_variable_basic(self, int index):
-        """
+        r"""
         Test whether the slack variable of the given row is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -2404,7 +2404,7 @@ cdef class GLPKBackend(GenericBackend):
         return self.get_row_stat(index) == GLP_BS
 
     cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the slack variable of the given row is nonbasic at lower bound.
 
         This assumes that the problem has been solved with the simplex method
diff -up src/sage/numerical/backends/interactivelp_backend.pyx.orig src/sage/numerical/backends/interactivelp_backend.pyx
--- src/sage/numerical/backends/interactivelp_backend.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/numerical/backends/interactivelp_backend.pyx	2022-03-04 15:50:57.339269357 -0700
@@ -1063,7 +1063,7 @@ cdef class InteractiveLPBackend:
                                                problem_type, ring, objective_constant_term=d)
 
     cpdef bint is_variable_basic(self, int index):
-        """
+        r"""
         Test whether the given variable is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -1093,7 +1093,7 @@ cdef class InteractiveLPBackend:
         return self.lp_std_form.decision_variables()[index] in self.final_dictionary.basic_variables()
 
     cpdef bint is_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the given variable is nonbasic at lower bound.
 
         This assumes that the problem has been solved with the simplex method
@@ -1123,7 +1123,7 @@ cdef class InteractiveLPBackend:
         return self.lp_std_form.decision_variables()[index] in self.final_dictionary.nonbasic_variables()
 
     cpdef bint is_slack_variable_basic(self, int index):
-        """
+        r"""
         Test whether the slack variable of the given row is basic.
 
         This assumes that the problem has been solved with the simplex method
@@ -1153,7 +1153,7 @@ cdef class InteractiveLPBackend:
         return self.lp_std_form.slack_variables()[index] in self.final_dictionary.basic_variables()
 
     cpdef bint is_slack_variable_nonbasic_at_lower_bound(self, int index):
-        """
+        r"""
         Test whether the given variable is nonbasic at lower bound.
 
         This assumes that the problem has been solved with the simplex method
@@ -1185,7 +1185,7 @@ cdef class InteractiveLPBackend:
     cpdef dictionary(self):
         # Proposed addition to the general interface,
         # which would for other solvers return backend dictionaries (#18804)
-        """
+        r"""
         Return a dictionary representing the current basis.
 
         EXAMPLES::
@@ -1220,7 +1220,7 @@ cdef class InteractiveLPBackend:
 
     cpdef interactive_lp_problem(self):
 
-        """
+        r"""
         Return the :class:`InteractiveLPProblem` object associated with this backend.
 
         EXAMPLES::
diff -up src/sage/quivers/algebra_elements.pyx.orig src/sage/quivers/algebra_elements.pyx
--- src/sage/quivers/algebra_elements.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/quivers/algebra_elements.pyx	2022-03-04 15:50:57.339269357 -0700
@@ -280,7 +280,7 @@ cdef class PathAlgebraElement(RingElemen
                             )
 
     def _latex_(self):
-        """
+        r"""
         Latex string representation.
 
         EXAMPLES::
diff -up src/sage/rings/bernoulli_mod_p.pyx.orig src/sage/rings/bernoulli_mod_p.pyx
--- src/sage/rings/bernoulli_mod_p.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/bernoulli_mod_p.pyx	2022-03-04 15:50:57.339269357 -0700
@@ -41,7 +41,7 @@ from sage.rings.bernmm import bernmm_ber
 
 
 def verify_bernoulli_mod_p(data):
-    """
+    r"""
     Computes checksum for Bernoulli numbers.
 
     It checks the identity
diff -up src/sage/rings/complex_interval.pyx.orig src/sage/rings/complex_interval.pyx
--- src/sage/rings/complex_interval.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/complex_interval.pyx	2022-03-04 15:50:57.340269358 -0700
@@ -732,7 +732,7 @@ cdef class ComplexIntervalFieldElement(s
         return x
 
     def norm(self):
-        """
+        r"""
         Return the norm of this complex number.
 
         If `c = a + bi` is a complex number, then the norm of `c` is defined as
@@ -1114,7 +1114,7 @@ cdef class ComplexIntervalFieldElement(s
         return x
 
     def __invert__(self):
-        """
+        r"""
         Return the multiplicative inverse of ``self``.
 
         EXAMPLES::
diff -up src/sage/rings/complex_mpc.pyx.orig src/sage/rings/complex_mpc.pyx
--- src/sage/rings/complex_mpc.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/complex_mpc.pyx	2022-03-04 15:50:57.340269358 -0700
@@ -137,15 +137,15 @@ cdef inline mpfr_rnd_t rnd_im(mpc_rnd_t
 sign = '[+-]'
 digit_ten = '[0123456789]'
 exponent_ten = '[e@]' + sign + '?[0123456789]+'
-number_ten = 'inf(?:inity)?|@inf@|nan(?:\([0-9A-Z_]*\))?|@nan@(?:\([0-9A-Z_]*\))?'\
-    '|(?:' + digit_ten + '*\.' + digit_ten + '+|' + digit_ten + '+\.?)(?:' + exponent_ten + ')?'
-imaginary_ten = 'i(?:\s*\*\s*(?:' + number_ten + '))?|(?:' + number_ten + ')\s*\*\s*i'
-complex_ten = '(?P<im_first>(?P<im_first_im_sign>' + sign + ')?\s*(?P<im_first_im_abs>' + imaginary_ten + ')' \
-    '(\s*(?P<im_first_re_sign>' + sign + ')\s*(?P<im_first_re_abs>' + number_ten + '))?)' \
+number_ten = r'inf(?:inity)?|@inf@|nan(?:\([0-9A-Z_]*\))?|@nan@(?:\([0-9A-Z_]*\))?'\
+    '|(?:' + digit_ten + r'*\.' + digit_ten + '+|' + digit_ten + r'+\.?)(?:' + exponent_ten + ')?'
+imaginary_ten = r'i(?:\s*\*\s*(?:' + number_ten + '))?|(?:' + number_ten + r')\s*\*\s*i'
+complex_ten = '(?P<im_first>(?P<im_first_im_sign>' + sign + r')?\s*(?P<im_first_im_abs>' + imaginary_ten + ')' \
+    r'(\s*(?P<im_first_re_sign>' + sign + r')\s*(?P<im_first_re_abs>' + number_ten + '))?)' \
     '|' \
-    '(?P<re_first>(?P<re_first_re_sign>' + sign + ')?\s*(?P<re_first_re_abs>' + number_ten + ')' \
-    '(\s*(?P<re_first_im_sign>' + sign + ')\s*(?P<re_first_im_abs>' + imaginary_ten + '))?)'
-re_complex_ten = re.compile('^\s*(?:' + complex_ten + ')\s*$', re.I)
+    '(?P<re_first>(?P<re_first_re_sign>' + sign + r')?\s*(?P<re_first_re_abs>' + number_ten + ')' \
+    r'(\s*(?P<re_first_im_sign>' + sign + r')\s*(?P<re_first_im_abs>' + imaginary_ten + '))?)'
+re_complex_ten = re.compile(r'^\s*(?:' + complex_ten + r')\s*$', re.I)
 
 cpdef inline split_complex_string(string, int base=10):
     """
@@ -185,17 +185,17 @@ cpdef inline split_complex_string(string
 
         # Warning: number, imaginary, and complex should be enclosed in parentheses
         # when used as regexp because of alternatives '|'
-        number = '@nan@(?:\([0-9A-Z_]*\))?|@inf@|(?:' + digit + '*\.' + digit + '+|' + digit + '+\.?)(?:' + exponent + ')?'
+        number = r'@nan@(?:\([0-9A-Z_]*\))?|@inf@|(?:' + digit + r'*\.' + digit + '+|' + digit + r'+\.?)(?:' + exponent + ')?'
         if base <= 10:
-            number = 'nan(?:\([0-9A-Z_]*\))?|inf(?:inity)?|' + number
-        imaginary = 'i(?:\s*\*\s*(?:' + number + '))?|(?:' + number + ')\s*\*\s*i'
-        complex = '(?P<im_first>(?P<im_first_im_sign>' + sign + ')?\s*(?P<im_first_im_abs>' + imaginary + ')' \
-            '(\s*(?P<im_first_re_sign>' + sign + ')\s*(?P<im_first_re_abs>' + number + '))?)' \
+            number = r'nan(?:\([0-9A-Z_]*\))?|inf(?:inity)?|' + number
+        imaginary = r'i(?:\s*\*\s*(?:' + number + '))?|(?:' + number + r')\s*\*\s*i'
+        complex = '(?P<im_first>(?P<im_first_im_sign>' + sign + r')?\s*(?P<im_first_im_abs>' + imaginary + ')' \
+            r'(\s*(?P<im_first_re_sign>' + sign + r')\s*(?P<im_first_re_abs>' + number + '))?)' \
             '|' \
-            '(?P<re_first>(?P<re_first_re_sign>' + sign + ')?\s*(?P<re_first_re_abs>' + number + ')' \
-            '(\s*(?P<re_first_im_sign>' + sign + ')\s*(?P<re_first_im_abs>' + imaginary + '))?)'
+            '(?P<re_first>(?P<re_first_re_sign>' + sign + r')?\s*(?P<re_first_re_abs>' + number + ')' \
+            r'(\s*(?P<re_first_im_sign>' + sign + r')\s*(?P<re_first_im_abs>' + imaginary + '))?)'
 
-        z = re.match('^\s*(?:' + complex + ')\s*$', string, re.I)
+        z = re.match(r'^\s*(?:' + complex + r')\s*$', string, re.I)
 
     x, y = None, None
     if z is not None:
@@ -207,18 +207,18 @@ cpdef inline split_complex_string(string
             return None
 
         if  z.group(prefix + '_re_abs') is not None:
-            x = z.expand('\g<' + prefix + '_re_abs>')
+            x = z.expand(r'\g<' + prefix + '_re_abs>')
             if z.group(prefix + '_re_sign') is not None:
-                x = z.expand('\g<' + prefix + '_re_sign>') + x
+                x = z.expand(r'\g<' + prefix + '_re_sign>') + x
 
         if z.group(prefix + '_im_abs') is not None:
-            y = re.search('(?P<im_part>' + number + ')', z.expand('\g<' + prefix + '_im_abs>'), re.I)
+            y = re.search('(?P<im_part>' + number + ')', z.expand(r'\g<' + prefix + '_im_abs>'), re.I)
             if y is None:
                 y = '1'
             else:
-                y = y.expand('\g<im_part>')
+                y = y.expand(r'\g<im_part>')
             if z.group(prefix + '_im_sign') is not None:
-                y = z.expand('\g<' + prefix + '_im_sign>') + y
+                y = z.expand(r'\g<' + prefix + '_im_sign>') + y
 
     return x, y
 
@@ -1701,7 +1701,7 @@ cdef class MPComplexNumber(sage.structur
         return z
 
     def cosh(self):
-        """
+        r"""
         Return the hyperbolic cosine of this complex number:
 
         .. MATH::
@@ -1721,7 +1721,7 @@ cdef class MPComplexNumber(sage.structur
         return z
 
     def sinh(self):
-        """
+        r"""
         Return the hyperbolic sine of this complex number:
 
         .. MATH::
@@ -2063,7 +2063,7 @@ cdef class MPComplexNumber(sage.structur
         return z
 
     def exp(self):
-        """
+        r"""
         Return the exponential of this complex number:
 
         .. MATH::
diff -up src/sage/rings/finite_rings/hom_finite_field.pyx.orig src/sage/rings/finite_rings/hom_finite_field.pyx
--- src/sage/rings/finite_rings/hom_finite_field.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/finite_rings/hom_finite_field.pyx	2022-03-04 15:50:57.340269358 -0700
@@ -147,7 +147,7 @@ cdef class SectionFiniteFieldHomomorphis
 
 
     def _repr_(self):
-        """
+        r"""
         Return a string representation of this section.
 
         EXAMPLES::
diff -up src/sage/rings/finite_rings/integer_mod.pyx.orig src/sage/rings/finite_rings/integer_mod.pyx
--- src/sage/rings/finite_rings/integer_mod.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/finite_rings/integer_mod.pyx	2022-03-04 15:50:57.341269359 -0700
@@ -2241,7 +2241,7 @@ cdef class IntegerMod_gmp(IntegerMod_abs
         return int(self.lift())
 
     def __pow__(IntegerMod_gmp self, exp, m): # NOTE: m ignored, always use modulus of parent ring
-        """
+        r"""
         EXAMPLES::
 
             sage: R = Integers(10^10)
@@ -3541,7 +3541,7 @@ cdef class IntegerMod_int64(IntegerMod_a
             return self._new_c(self.ivalue >> (-k))
 
     def __pow__(IntegerMod_int64 self, exp, m): # NOTE: m ignored, always use modulus of parent ring
-        """
+        r"""
         EXAMPLES::
 
             sage: R = Integers(10)
diff -up src/sage/rings/number_field/number_field_element.pyx.orig src/sage/rings/number_field/number_field_element.pyx
--- src/sage/rings/number_field/number_field_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/number_field/number_field_element.pyx	2022-03-04 15:50:57.342269361 -0700
@@ -493,7 +493,7 @@ cdef class NumberFieldElement(FieldEleme
         return codomain(f(im_gens[0]))
 
     def _latex_(self):
-        """
+        r"""
         Returns the latex representation for this element.
 
         EXAMPLES::
diff -up src/sage/rings/number_field/number_field_morphisms.pyx.orig src/sage/rings/number_field/number_field_morphisms.pyx
--- src/sage/rings/number_field/number_field_morphisms.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/number_field/number_field_morphisms.pyx	2022-03-04 15:50:57.342269361 -0700
@@ -340,7 +340,7 @@ cdef class EmbeddedNumberFieldConversion
 
 
 cpdef matching_root(poly, target, ambient_field=None, margin=1, max_prec=None):
-    """
+    r"""
     Given a polynomial and a target, this function chooses the root that
     target best approximates as compared in ambient_field.
 
@@ -403,7 +403,7 @@ cpdef matching_root(poly, target, ambien
 
 
 cpdef closest(target, values, margin=1):
-    """
+    r"""
     This is a utility function that returns the item in values closest to
     target (with respect to the \code{abs} function). If margin is greater
     than 1, and x and y are the first and second closest elements to target,
diff -up src/sage/rings/padics/local_generic_element.pyx.orig src/sage/rings/padics/local_generic_element.pyx
--- src/sage/rings/padics/local_generic_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/padics/local_generic_element.pyx	2022-03-04 15:50:57.342269361 -0700
@@ -401,7 +401,7 @@ cdef class LocalGenericElement(Commutati
         return ans
 
     def _latex_(self):
-        """
+        r"""
         Returns a latex representation of self.
 
         EXAMPLES::
diff -up src/sage/rings/padics/padic_capped_absolute_element.pyx.orig src/sage/rings/padics/padic_capped_absolute_element.pyx
--- src/sage/rings/padics/padic_capped_absolute_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/padics/padic_capped_absolute_element.pyx	2022-03-04 15:50:57.342269361 -0700
@@ -383,7 +383,7 @@ cdef class pAdicCappedAbsoluteElement(CA
         return ans
 
     def _exp_binary_splitting(self, aprec):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
@@ -443,7 +443,7 @@ cdef class pAdicCappedAbsoluteElement(CA
         return ans
 
     def _exp_newton(self, aprec, log_algorithm=None):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
diff -up src/sage/rings/padics/padic_fixed_mod_element.pyx.orig src/sage/rings/padics/padic_fixed_mod_element.pyx
--- src/sage/rings/padics/padic_fixed_mod_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/padics/padic_fixed_mod_element.pyx	2022-03-04 15:50:57.343269362 -0700
@@ -449,7 +449,7 @@ cdef class pAdicFixedModElement(FMElemen
         return ans
 
     def _exp_binary_splitting(self, aprec):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
@@ -508,7 +508,7 @@ cdef class pAdicFixedModElement(FMElemen
         return ans
 
     def _exp_newton(self, aprec, log_algorithm=None):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
diff -up src/sage/rings/padics/padic_generic_element.pyx.orig src/sage/rings/padics/padic_generic_element.pyx
--- src/sage/rings/padics/padic_generic_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/padics/padic_generic_element.pyx	2022-03-04 15:50:57.343269362 -0700
@@ -544,7 +544,7 @@ cdef class pAdicGenericElement(LocalGene
         return self._repr_(mode=mode)
 
     def _repr_(self, mode=None, do_latex=False):
-        """
+        r"""
         Returns a string representation of this element.
 
         INPUT:
@@ -3026,7 +3026,7 @@ cdef class pAdicGenericElement(LocalGene
         return series_unit*nfactorial_unit.inverse_of_unit()<<(series_val-nfactorial_val)
 
     def _exp_binary_splitting(self, aprec):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
@@ -3072,7 +3072,7 @@ cdef class pAdicGenericElement(LocalGene
         raise NotImplementedError("the binary splitting algorithm is not implemented for the parent: %s" % self.parent())
 
     def _exp_newton(self, aprec, log_algorithm=None):
-        """
+        r"""
         Compute the exponential power series of this element
 
         This is a helper method for :meth:`exp`.
diff -up src/sage/rings/polynomial/multi_polynomial_libsingular.pyx.orig src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
--- src/sage/rings/polynomial/multi_polynomial_libsingular.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/polynomial/multi_polynomial_libsingular.pyx	2022-03-04 15:50:57.344269364 -0700
@@ -2520,7 +2520,7 @@ cdef class MPolynomial_libsingular(MPoly
         return char_to_str(s)
 
     def _latex_(self):
-        """
+        r"""
         Return a polynomial LaTeX representation of this polynomial.
 
         EXAMPLES::
diff -up src/sage/rings/polynomial/ore_polynomial_element.pyx.orig src/sage/rings/polynomial/ore_polynomial_element.pyx
--- src/sage/rings/polynomial/ore_polynomial_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/polynomial/ore_polynomial_element.pyx	2022-03-04 15:50:57.345269365 -0700
@@ -1707,8 +1707,8 @@ cdef class OrePolynomial(AlgebraElement)
                     var = ""
                 s += "%s %s"%(x,var)
         s = s.replace(" + -", " - ")
-        s = re.sub(" 1(\.0+)? \|"," ", s)
-        s = re.sub(" -1(\.0+)? \|", " -", s)
+        s = re.sub(r" 1(\.0+)? \|"," ", s)
+        s = re.sub(r" -1(\.0+)? \|", " -", s)
         s = s.replace("|","")
         if s == " ":
             return "0"
diff -up src/sage/rings/polynomial/polynomial_element.pyx.orig src/sage/rings/polynomial/polynomial_element.pyx
--- src/sage/rings/polynomial/polynomial_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/polynomial/polynomial_element.pyx	2022-03-04 15:50:57.346269367 -0700
@@ -2634,8 +2634,8 @@ cdef class Polynomial(CommutativeAlgebra
                     var = ""
                 s += "%s %s" % (x, var)
         s = s.replace(" + -", " - ")
-        s = re.sub(" 1(\.0+)? \|"," ", s)
-        s = re.sub(" -1(\.0+)? \|", " -", s)
+        s = re.sub(r" 1(\.0+)? \|"," ", s)
+        s = re.sub(r" -1(\.0+)? \|", " -", s)
         s = s.replace("|","")
         if s == " ":
             return "0"
@@ -2735,7 +2735,7 @@ cdef class Polynomial(CommutativeAlgebra
         raise IndexError("polynomials are immutable")
 
     cpdef _floordiv_(self, right):
-        """
+        r"""
         Quotient of division of self by other. This is denoted //.
 
         If self = quotient \* right + remainder, this function returns
@@ -6532,8 +6532,8 @@ cdef class Polynomial(CommutativeAlgebra
         where the roots `a` and `b` are to be considered in the algebraic
         closure of the fraction field of the coefficients and counted with
         multiplicities. If the polynomials are not monic this quantity is
-        multiplied by `\\alpha_1^{deg(p_2)} \\alpha_2^{deg(p_1)}` where
-        `\\alpha_1` and `\\alpha_2` are the leading coefficients of `p_1` and
+        multiplied by `\alpha_1^{deg(p_2)} \alpha_2^{deg(p_1)}` where
+        `\alpha_1` and `\alpha_2` are the leading coefficients of `p_1` and
         `p_2` respectively.
 
         INPUT:
diff -up src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx.orig src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx
--- src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx	2022-03-04 15:50:57.346269367 -0700
@@ -1394,7 +1394,7 @@ cdef class Polynomial_integer_dense_flin
         return smallInteger(fmpz_poly_degree(self.__poly))
 
     def pseudo_divrem(self, B):
-        """
+        r"""
         Write ``A = self``.  This function computes polynomials `Q` and `R`
         and an integer `d` such that
 
diff -up src/sage/rings/polynomial/real_roots.pyx.orig src/sage/rings/polynomial/real_roots.pyx
--- src/sage/rings/polynomial/real_roots.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/polynomial/real_roots.pyx	2022-03-04 15:50:57.347269368 -0700
@@ -1255,7 +1255,7 @@ def de_casteljau_intvec(Vector_integer_d
 cdef double half_ulp = ldexp(1.0 * 65/64, -54)
 
 def intvec_to_doublevec(Vector_integer_dense b, long err):
-    """
+    r"""
     Given a vector of integers A = [a1, ..., an], and an integer
     error bound E, returns a vector of floating-point numbers
     B = [b1, ..., bn], lower and upper error bounds F1 and F2, and
@@ -2145,7 +2145,7 @@ def subsample_vec_doctest(a, slen, llen)
     return subsample_vec(a, slen, llen)
 
 def maximum_root_first_lambda(p):
-    """
+    r"""
     Given a polynomial with real coefficients, computes an upper bound
     on its largest real root, using the first-\lambda algorithm from
     "Implementations of a New Theorem for Computing Bounds for Positive
diff -up src/sage/rings/real_double_element_gsl.pyx.orig src/sage/rings/real_double_element_gsl.pyx
--- src/sage/rings/real_double_element_gsl.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/real_double_element_gsl.pyx	2022-03-04 15:58:11.186882002 -0700
@@ -227,7 +227,7 @@ cdef class RealDoubleElement_gsl(RealDou
         return a
 
     def log(self, base=None):
-        """
+        r"""
         Return the logarithm.
 
         INPUT:
diff -up src/sage/rings/real_mpfi.pyx.orig src/sage/rings/real_mpfi.pyx
--- src/sage/rings/real_mpfi.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/real_mpfi.pyx	2022-03-04 15:50:57.348269369 -0700
@@ -1309,7 +1309,7 @@ cdef class RealIntervalFieldElement(Ring
         return self.str(10)
 
     def _latex_(self):
-        """
+        r"""
         Return a latex representation of ``self``.
 
         EXAMPLES::
diff -up src/sage/rings/semirings/tropical_semiring.pyx.orig src/sage/rings/semirings/tropical_semiring.pyx
--- src/sage/rings/semirings/tropical_semiring.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/semirings/tropical_semiring.pyx	2022-03-04 15:50:57.348269369 -0700
@@ -99,7 +99,7 @@ cdef class TropicalSemiringElement(Eleme
         return repr(self._val)
 
     def _latex_(self):
-        """
+        r"""
         Return a latex representation of ``self``.
 
         EXAMPLES::
diff -up src/sage/rings/tate_algebra_element.pyx.orig src/sage/rings/tate_algebra_element.pyx
--- src/sage/rings/tate_algebra_element.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/rings/tate_algebra_element.pyx	2022-03-04 15:50:57.349269371 -0700
@@ -3447,7 +3447,7 @@ cdef class TateAlgebraElement(Commutativ
 
     @coerce_binop
     def Spoly(self, other):
-        """
+        r"""
         Return the S-polynomial of this series and ``other``.
 
         INPUT:
diff -up src/sage/structure/coerce_maps.pyx.orig src/sage/structure/coerce_maps.pyx
--- src/sage/structure/coerce_maps.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/structure/coerce_maps.pyx	2022-03-04 15:50:57.349269371 -0700
@@ -312,7 +312,7 @@ cdef class NamedConvertMap(Map):
 
 cdef class CallableConvertMap(Map):
     def __init__(self, domain, codomain, func, parent_as_first_arg=None):
-        """
+        r"""
         This lets one easily create maps from any callable object.
 
         This is especially useful to create maps from bound methods.
diff -up src/sage/symbolic/expression.pyx.orig src/sage/symbolic/expression.pyx
--- src/sage/symbolic/expression.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/symbolic/expression.pyx	2022-03-04 16:01:04.179126250 -0700
@@ -7,7 +7,7 @@
 # distutils: include_dirs = SINGULAR_INCDIR
 # pynac/basic.h includes
 #   factory/factory.h    so this ^ is needed to find it
-"""
+r"""
 Symbolic Expressions
 
 RELATIONAL EXPRESSIONS:
@@ -5202,7 +5202,7 @@ cdef class Expression(Expression_abc):
     expand_rational = rational_expand = expand
 
     def expand_trig(self, full=False, half_angles=False, plus=True, times=True):
-        """
+        r"""
         Expand trigonometric and hyperbolic functions of sums of angles
         and of multiple angles occurring in self. For best results, self
         should already be expanded.
@@ -7930,7 +7930,7 @@ cdef class Expression(Expression_abc):
             return new_Expression_from_GEx(self._parent, x)
 
     def gosper_term(self, n):
-        """
+        r"""
         Return Gosper's hypergeometric term for ``self``.
 
         Suppose ``f``=``self`` is a hypergeometric term such that:
diff -up src/sage/symbolic/function.pyx.orig src/sage/symbolic/function.pyx
--- src/sage/symbolic/function.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/symbolic/function.pyx	2022-03-04 15:50:59.211272001 -0700
@@ -1137,7 +1137,7 @@ cdef class BuiltinFunction(Function):
 
     # this is required to read old pickles of erf, elliptic_ec, etc.
     def __setstate__(self, state):
-        """
+        r"""
         EXAMPLES::
 
             sage: cot.__setstate__([1,0])
diff -up src/sage/symbolic/ring.pyx.orig src/sage/symbolic/ring.pyx
--- src/sage/symbolic/ring.pyx.orig	2022-01-30 06:41:50.000000000 -0700
+++ src/sage/symbolic/ring.pyx	2022-03-04 15:50:59.211272001 -0700
@@ -110,7 +110,7 @@ cdef class SymbolicRing(sage.rings.abc.S
         return "Symbolic Ring"
 
     def _latex_(self):
-        """
+        r"""
         Return latex representation of the symbolic ring.
 
         EXAMPLES::
@@ -759,7 +759,7 @@ cdef class SymbolicRing(sage.rings.abc.S
                     asm.forget()
 
     def var(self, name, latex_name=None, n=None, domain=None):
-        """
+        r"""
         Return a symbolic variable as an element of the symbolic ring.
 
         INPUT: