Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _latex_ exponents #38243

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/sage/schemes/affine/affine_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ def _latex_(self):
EXAMPLES::

sage: print(latex(AffineSpace(1, ZZ, 'x')))
\mathbf{A}_{\Bold{Z}}^1
\mathbf{A}_{\Bold{Z}}^{1}

TESTS::

sage: AffineSpace(3, Zp(5), 'y')._latex_() # needs sage.rings.padics
'\\mathbf{A}_{\\Bold{Z}_{5}}^3'
sage: AffineSpace(11, Zp(5), 'y')._latex_() # needs sage.rings.padics
'\\mathbf{A}_{\\Bold{Z}_{5}}^{11}'
"""
return "\\mathbf{A}_{%s}^%s" % (latex(self.base_ring()), self.dimension_relative())
return "\\mathbf{A}_{%s}^{%s}" % (latex(self.base_ring()), self.dimension_relative())

def _morphism(self, *args, **kwds):
"""
Expand Down
8 changes: 4 additions & 4 deletions src/sage/schemes/generic/algebraic_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _latex_(self):
sage: S = AlgebraicScheme(P); S
Subscheme of Projective Space of dimension 3 over Integer Ring
sage: S._latex_()
'\\text{Subscheme of ${\\mathbf P}_{\\Bold{Z}}^3$}'
'\\text{Subscheme of ${\\mathbf P}_{\\Bold{Z}}^{3}$}'
"""
return r"\text{{Subscheme of ${}$}}".format(latex(self.__A))

Expand Down Expand Up @@ -675,7 +675,7 @@ def _latex_(self):
x - y
sage: U._latex_()
'\\text{Quasi-projective subscheme }
(X\\setminus Y)\\subset {\\mathbf P}_{\\Bold{Z}}^2,\\text{ where }
(X\\setminus Y)\\subset {\\mathbf P}_{\\Bold{Z}}^{2},\\text{ where }
X \\text{ is defined by }\\text{no polynomials},\\text{ and }
Y \\text{ is defined by } x - y.'
"""
Expand Down Expand Up @@ -1047,13 +1047,13 @@ def _latex_(self):
Closed subscheme of Projective Space of dimension 2 over Finite Field of size 11 defined by:
x^2 - y*z
sage: S._latex_()
'\\text{Closed subscheme of } {\\mathbf P}_{\\Bold{F}_{11}}^2 \\text{ defined by } x^{2} - y z'
'\\text{Closed subscheme of } {\\mathbf P}_{\\Bold{F}_{11}}^{2} \\text{ defined by } x^{2} - y z'
sage: S = P.subscheme([x^2 - y*z, x^5]); S
Closed subscheme of Projective Space of dimension 2 over Finite Field of size 11 defined by:
x^2 - y*z,
x^5
sage: S._latex_()
'\\text{Closed subscheme of } {\\mathbf P}_{\\Bold{F}_{11}}^2 \\text{ defined by } x^{2} - y z, x^{5}'
'\\text{Closed subscheme of } {\\mathbf P}_{\\Bold{F}_{11}}^{2} \\text{ defined by } x^{2} - y z, x^{5}'
"""
polynomials = ', '.join(latex(f) for f in self.defining_polynomials())
if not polynomials:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/product_projective/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def _latex_(self):
EXAMPLES::

sage: latex(ProductProjectiveSpaces([1, 2, 3], ZZ, 'x'))
{\mathbf P}_{\Bold{Z}}^1 \times {\mathbf P}_{\Bold{Z}}^2 \times {\mathbf
P}_{\Bold{Z}}^3
{\mathbf P}_{\Bold{Z}}^{1} \times {\mathbf P}_{\Bold{Z}}^{2} \times
{\mathbf P}_{\Bold{Z}}^{3}
"""
return " \\times ".join(PS._latex_() for PS in self)

Expand Down
9 changes: 4 additions & 5 deletions src/sage/schemes/projective/projective_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,14 @@ def _latex_(self):
EXAMPLES::

sage: print(latex(ProjectiveSpace(1, ZZ, 'x')))
{\mathbf P}_{\Bold{Z}}^1
{\mathbf P}_{\Bold{Z}}^{1}

TESTS::

sage: ProjectiveSpace(3, Zp(5), 'y')._latex_() # needs sage.rings.padics
'{\\mathbf P}_{\\Bold{Z}_{5}}^3'
sage: ProjectiveSpace(11, Zp(5), 'y')._latex_() # needs sage.rings.padics
'{\\mathbf P}_{\\Bold{Z}_{5}}^{11}'
"""
return "{\\mathbf P}_{%s}^%s" % (latex(self.base_ring()),
self.dimension_relative())
return "{\\mathbf P}_{%s}^{%s}" % (latex(self.base_ring()), self.dimension_relative())

def _linear_system_as_kernel(self, d, pt, m):
"""
Expand Down
Loading