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

Add LaTeX representation for function fields #38854

Merged
merged 4 commits into from
Nov 3, 2024
Merged
Changes from 2 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
17 changes: 16 additions & 1 deletion src/sage/rings/function_field/function_field_polymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,22 @@ def _repr_(self):
sage: L._repr_()
'Function field in y defined by y^5 - 2*x*y + (-x^4 - 1)/x'
"""
return "Function field in %s defined by %s" % (self.variable_name(), self._polynomial)
return (f"Function field in {self.variable_name()} defined by "
f"{self._polynomial}")

kwankyu marked this conversation as resolved.
Show resolved Hide resolved
def _latex_(self):
r"""
Return the LaTeX representation of the function field.

EXAMPLES::

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^5 - (x^3 + 2*x*y + 1/x))
sage: latex(L)
\text{Function field in } y \text{ defined by } y^{5} - 2 x y + \frac{-x^{4} - 1}{x}
"""
return (fr"\text{{Function field in }} {self.variable_name()} "
fr"\text{{ defined by }} {self._polynomial._latex_()}")

def base_field(self):
"""
Expand Down
Loading