From d00fbd47e01de71aae1f62eb7993f570fb87cb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Wed, 21 Aug 2024 10:52:59 +0200 Subject: [PATCH] Improve latex print --- src/polynomial.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/polynomial.jl b/src/polynomial.jl index ecadb9e..2460705 100644 --- a/src/polynomial.jl +++ b/src/polynomial.jl @@ -102,7 +102,17 @@ end function _show(io::IO, mime::MIME, p::Polynomial{B}) where {B} if B != Monomial - print(io, B) + if mime isa MIME"text/latex" + print(io, "\\text{") + end + if B == Chebyshev + print(io, "Cheby") + else + print(io, B) + end + if mime isa MIME"text/latex" + print(io, "}") + end print(io, "(") end print(io, SA.trim_LaTeX(mime, sprint(show, mime, p.monomial)))