Skip to content

Commit b466c8a

Browse files
author
Release Manager
committed
Trac #33973: Deprecate handling of $...$ in docstrings
We change the function `sage.misc.sagedoc.process_dollars` so it issues a deprecation warning when dollar signs are used for math markup. This is to provide a gentle transition for user packages that use the Sage docbuilding machinery. URL: https://trac.sagemath.org/33973 Reported by: mkoeppe Ticket author(s): Matthias Koeppe, John Palmieri Reviewer(s): Kwankyu Lee, John Palmieri
2 parents e79f6ff + c79c24d commit b466c8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1027
-944
lines changed

src/doc/en/developer/coding_basics.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,9 @@ there is not one already. That is, you can do the following:
728728
LaTeX Typesetting
729729
-----------------
730730

731-
In Sage's documentation LaTeX code is allowed and is marked with **backticks or
732-
dollar signs**:
731+
In Sage's documentation LaTeX code is allowed and is marked with **backticks**:
733732

734-
```x^2 + y^2 = 1``` and ``$x^2 + y^2 = 1$`` both yield `x^2 + y^2 = 1`.
733+
```x^2 + y^2 = 1``` yields `x^2 + y^2 = 1`.
735734

736735
**Backslashes:** For LaTeX commands containing backslashes, either use double
737736
backslashes or begin the docstring with a ``r"""`` instead of ``"""``. Both of
@@ -744,7 +743,7 @@ the following are valid::
744743

745744
def sin(x):
746745
r"""
747-
Return $\sin(x)$.
746+
Return `\sin(x)`.
748747
"""
749748

750749
**MATH block:** This is similar to the LaTeX syntax ``\[<math expression>\]``

src/sage/combinat/words/suffix_trees.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ class DecoratedSuffixTree(ImplicitSuffixTree):
15701570
A *decorated suffix tree* of a word `w` is the suffix tree of `w`
15711571
marked with the end point of all squares in the `w`.
15721572
1573-
The symbol ``"$"`` is appended to ``w`` to ensure that each final
1573+
The symbol ``$`` is appended to ``w`` to ensure that each final
15741574
state is a leaf of the suffix tree.
15751575
15761576
INPUT:

src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,9 @@ def connection_coefficients(self):
14521452
Computes the connection coefficients or Christoffel symbols
14531453
`\Gamma^k_{ij}` of the surface. If the coefficients of the first
14541454
fundamental form are given by `g_{ij}` (where `i, j = 1, 2`), then
1455-
$\Gamma^k_{ij} = \frac{1}{2} g^{kl} \left( \frac{\partial g_{li}}{\partial x^j}
1455+
`\Gamma^k_{ij} = \frac{1}{2} g^{kl} \left( \frac{\partial g_{li}}{\partial x^j}
14561456
- \frac{\partial g_{ij}}{\partial x^l}
1457-
+ \frac{\partial g_{lj}}{\partial x^i} \right)$.
1457+
+ \frac{\partial g_{lj}}{\partial x^i} \right)`.
14581458
Here, `(g^{kl})` is the inverse of the matrix `(g_{ij})`, with
14591459
`i, j = 1, 2`.
14601460

src/sage/geometry/toric_plotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ def label_list(label, n, math_mode, index_set=None):
836836
837837
If ``label`` was a list of ``n`` entries, it is returned without changes.
838838
If ``label`` is ``None``, a list of ``n`` ``None``'s is returned. If
839-
``label`` is a string, a list of strings of the form "$label_{i}$" is
839+
``label`` is a string, a list of strings of the form ``$label_{i}$`` is
840840
returned, where `i` ranges over ``index_set``. (If ``math_mode=False``, the
841841
form "label_i" is used instead.) If ``n=1``, there is no subscript added,
842842
unless ``index_set`` was specified explicitly.

src/sage/graphs/generators/classical_geometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ def Nowhere0WordsTwoWeightCodeGraph(q, hyperoval=None, field=None, check_hyperov
14331433

14341434
def OrthogonalDualPolarGraph(e, d, q):
14351435
r"""
1436-
Return the dual polar graph on $GO^e(n,q)$ of diameter `d`.
1436+
Return the dual polar graph on `GO^e(n,q)` of diameter `d`.
14371437
14381438
The value of `n` is determined by `d` and `e`.
14391439

src/sage/groups/abelian_gps/dual_abelian_group_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def word_problem(self, words, display=True):
200200
[[b^2*c^2*d^3*e^5, 245]]
201201
202202
The command e.word_problem([u,v,w,x,y],display=True) returns
203-
the same list but also prints $e = (b^2*c^2*d^3*e^5)^245$.
203+
the same list but also prints ``e = (b^2*c^2*d^3*e^5)^245``.
204204
"""
205205
## First convert the problem to one using AbelianGroups
206206
import copy

src/sage/groups/braid.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ def LKB_matrix(self, variables='x,y'):
628628
r"""
629629
Return the Lawrence-Krammer-Bigelow representation matrix.
630630
631-
The matrix is expressed in the basis $\{e_{i, j} \mid 1\leq i
632-
< j \leq n\}$, where the indices are ordered
631+
The matrix is expressed in the basis `\{e_{i, j} \mid 1\leq i
632+
< j \leq n\}`, where the indices are ordered
633633
lexicographically. It is a matrix whose entries are in the
634634
ring of Laurent polynomials on the given variables. By
635635
default, the variables are ``'x'`` and ``'y'``.
@@ -1345,7 +1345,7 @@ def _left_normal_form_coxeter(self):
13451345
13461346
OUTPUT:
13471347
1348-
A tuple whose first element is the power of $\Delta$, and the
1348+
A tuple whose first element is the power of `\Delta`, and the
13491349
rest are the permutations corresponding to the simple factors.
13501350
13511351
EXAMPLES::
@@ -3081,8 +3081,8 @@ class group of the punctured disk.
30813081
x_{j} & \text{otherwise}
30823082
\end{cases},
30833083
3084-
where $\sigma_i$ are the generators of the braid group on $n$
3085-
strands, and $x_j$ the generators of the free group of rank $n$.
3084+
where `\sigma_i` are the generators of the braid group on `n`
3085+
strands, and `x_j` the generators of the free group of rank `n`.
30863086
30873087
You should left multiplication of the free group element by the
30883088
braid to compute the action. Alternatively, use the

src/sage/groups/perm_gps/permgroup_named.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@
33
44
You can construct the following permutation groups:
55
6-
-- SymmetricGroup, $S_n$ of order $n!$ (n can also be a list $X$ of distinct
7-
positive integers, in which case it returns $S_X$)
6+
-- SymmetricGroup, `S_n` of order `n!` (n can also be a list `X` of distinct
7+
positive integers, in which case it returns `S_X`)
88
9-
-- AlternatingGroup, $A_n$ of order $n!/2$ (n can also be a list $X$
9+
-- AlternatingGroup, `A_n` of order `n!/2` (n can also be a list `X`
1010
of distinct positive integers, in which case it returns
11-
$A_X$)
11+
`A_X`)
1212
13-
-- DihedralGroup, $D_n$ of order $2n$
13+
-- DihedralGroup, `D_n` of order `2n`
1414
15-
-- GeneralDihedralGroup, $Dih(G)$, where G is an abelian group
15+
-- GeneralDihedralGroup, `Dih(G)`, where G is an abelian group
1616
17-
-- CyclicPermutationGroup, $C_n$ of order $n$
17+
-- CyclicPermutationGroup, `C_n` of order `n`
1818
1919
-- DiCyclicGroup, nonabelian groups of order `4m` with a unique element of order 2
2020
21-
-- TransitiveGroup, $n^{th}$ transitive group of degree $d$
21+
-- TransitiveGroup, `n^{th}` transitive group of degree `d`
2222
from the GAP tables of transitive groups
2323
2424
-- TransitiveGroups(d), TransitiveGroups(), set of all of the above
2525
26-
-- PrimitiveGroup, $n^{th}$ primitive group of degree $d$
26+
-- PrimitiveGroup, `n^{th}` primitive group of degree `d`
2727
from the GAP tables of primitive groups
2828
2929
-- PrimitiveGroups(d), PrimitiveGroups(), set of all of the above
3030
3131
-- MathieuGroup(degree), Mathieu group of degree 9, 10, 11, 12, 21, 22, 23, or 24.
3232
33-
-- KleinFourGroup, subgroup of $S_4$ of order $4$ which is not $C_2 \times C_2$
33+
-- KleinFourGroup, subgroup of `S_4` of order `4` which is not `C_2 \times C_2`
3434
3535
-- QuaternionGroup, non-abelian group of order `8`, `\{\pm 1, \pm I, \pm J, \pm K\}`
3636
@@ -39,24 +39,24 @@
3939
4040
-- SemidihedralGroup, nonabelian 2-groups with cyclic subgroups of index 2
4141
42-
-- PGL(n,q), projective general linear group of $n\times n$ matrices over
42+
-- PGL(n,q), projective general linear group of `n\times n` matrices over
4343
the finite field GF(q)
4444
45-
-- PSL(n,q), projective special linear group of $n\times n$ matrices over
45+
-- PSL(n,q), projective special linear group of `n\times n` matrices over
4646
the finite field GF(q)
4747
48-
-- PSp(2n,q), projective symplectic linear group of $2n\times 2n$ matrices
48+
-- PSp(2n,q), projective symplectic linear group of `2n\times 2n` matrices
4949
over the finite field GF(q)
5050
51-
-- PSU(n,q), projective special unitary group of $n \times n$ matrices having
52-
coefficients in the finite field $GF(q^2)$ that respect a
51+
-- PSU(n,q), projective special unitary group of `n \times n` matrices having
52+
coefficients in the finite field `GF(q^2)` that respect a
5353
fixed nondegenerate sesquilinear form, of determinant 1.
5454
55-
-- PGU(n,q), projective general unitary group of $n\times n$ matrices having
56-
coefficients in the finite field $GF(q^2)$ that respect a
55+
-- PGU(n,q), projective general unitary group of `n\times n` matrices having
56+
coefficients in the finite field `GF(q^2)` that respect a
5757
fixed nondegenerate sesquilinear form, modulo the centre.
5858
59-
-- SuzukiGroup(q), Suzuki group over GF(q), $^2 B_2(2^{2k+1}) = Sz(2^{2k+1})$.
59+
-- SuzukiGroup(q), Suzuki group over GF(q), `^2 B_2(2^{2k+1}) = Sz(2^{2k+1})`.
6060
6161
-- ComplexReflectionGroup, the complex reflection group `G(m, p, n)` or
6262
the exceptional complex reflection group `G_m`
@@ -622,7 +622,7 @@ def algebra(self, base_ring, category=None):
622622
class AlternatingGroup(PermutationGroup_symalt):
623623
def __init__(self, domain=None):
624624
"""
625-
The alternating group of order $n!/2$, as a permutation group.
625+
The alternating group of order `n!/2`, as a permutation group.
626626
627627
INPUT:
628628
@@ -968,8 +968,8 @@ def is_abelian(self):
968968
class KleinFourGroup(PermutationGroup_unique):
969969
def __init__(self):
970970
r"""
971-
The Klein 4 Group, which has order $4$ and exponent $2$, viewed
972-
as a subgroup of $S_4$.
971+
The Klein 4 Group, which has order `4` and exponent `2`, viewed
972+
as a subgroup of `S_4`.
973973
974974
OUTPUT:
975975
@@ -1703,7 +1703,7 @@ def _repr_(self):
17031703
class MathieuGroup(PermutationGroup_unique):
17041704
def __init__(self, n):
17051705
"""
1706-
The Mathieu group of degree $n$.
1706+
The Mathieu group of degree `n`.
17071707
17081708
INPUT:
17091709
@@ -2777,7 +2777,7 @@ def ramification_module_decomposition_modular_curve(self):
27772777
27782778
REFERENCE: D. Joyner and A. Ksir, 'Modular representations
27792779
on some Riemann-Roch spaces of modular curves
2780-
$X(N)$', Computational Aspects of Algebraic Curves,
2780+
`X(N)`', Computational Aspects of Algebraic Curves,
27812781
(Editor: T. Shaska) Lecture Notes in Computing, WorldScientific,
27822782
2005.)
27832783
@@ -2990,7 +2990,7 @@ class SuzukiGroup(PermutationGroup_unique):
29902990
def __init__(self, q, name='a'):
29912991
r"""
29922992
The Suzuki group over GF(q),
2993-
$^2 B_2(2^{2k+1}) = Sz(2^{2k+1})$.
2993+
`^2 B_2(2^{2k+1}) = Sz(2^{2k+1})`.
29942994
29952995
A wrapper for the GAP function SuzukiGroup.
29962996

src/sage/interfaces/frobby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def hilbert(self, monomial_ideal):
144144
145145
The Hilbert-Poincaré series of a monomial ideal is the sum of all
146146
monomials not in the ideal. This sum can be written as a (finite)
147-
rational function with $(x_1-1)(x_2-1)...(x_n-1)$ in the denominator,
148-
assuming the variables of the ring are $x_1,x2,...,x_n$. This action
147+
rational function with `(x_1-1)(x_2-1)...(x_n-1)` in the denominator,
148+
assuming the variables of the ring are `x_1,x2,...,x_n`. This action
149149
computes the polynomial in the numerator of this fraction.
150150
151151
INPUT:

0 commit comments

Comments
 (0)