Changes between Version 6 and Version 8 of Ticket #31586


Ignore:
Timestamp:
May 11, 2021, 9:27:01 AM (19 months ago)
Author:
Samuel Lelièvre
Comment:

I would suggest adding line breaks and using formatted strings and raw strings as follows.

-            \text{Projective Plane curve over $\Bold{Q}$ defined by $-x^{3} + y^{2} z - 17 x z^{2} + y z^{2}$}
+            \text{Projective Plane curve over $\Bold{Q}$
+            defined by $-x^{3} + y^{2} z - 17 x z^{2} + y z^{2}$}
-            \text{Affine Plane curve over $\Bold{Q}$ defined by $-x^{3} + y^{2} - 17 x + y$}
+            \text{Affine Plane curve over $\Bold{Q}$
+            defined by $-x^{3} + y^{2} - 17 x + y$}
-        if self.defining_ideal().is_zero() and self.ambient_space().dimension() == 1:
-            return r"\text{{{} line over ${}$}}".format(self._repr_type(), latex(self.base_ring()))
-        else:
-            return r"\text{{{} curve over ${}$ defined by {}}}".format(self._repr_type(), latex(self.base_ring()),
-                 ', '.join(['${0}$'.format(latex(x)) for x in self.defining_polynomials()]))
+        if (self.defining_ideal().is_zero()
+                and self.ambient_space().dimension() == 1):
+            repr_type, ring = self._repr_type(), latex(self.base_ring())
+            return fr"\text{{{repr_type} line over ${ring}$}}"
+        else:
+            repr_type, ring = self._repr_type(), latex(self.base_ring())
+            pp = ', '.join(f'${latex(p)}$' for p in self.defining_polynomials())
+            return fr"\text{{{repr_type} curve over ${ring}$ defined by {pp}}}"
-        return 'Rational cohomology ring of a ' + self._variety._repr_()
+        return f'Rational cohomology ring of a {self._variety._repr_()}'
-        return 'H^\\ast\\left(' + self._variety._latex_() + ',' + latex(QQ) + '\\right)'
+        return fr'H^\ast\left({self._variety._latex_()},{latex(QQ)}\right)'

Other than that (but feel free to discard any or all of these suggestions), positive review if bots agree.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31586

    • Property Reviewers changed from to Samuel Lelièvre
    • Property Summary changed from Add `_latex_` method to curves and fix a few typographic errors in schemes folder to Add _latex_ method to curves and improve formatting in schemes folder
  • Ticket #31586 – Description

    v6 v8  
    331. add `_latex_` method to algebraic curves
    44
    5 2. fix a few typographic errors in latex strings in schemes folder
     52. improve latex strings formatting in schemes folder