From 37b7d25b83e8c2536f545968a9c21bfffa9e25e6 Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Thu, 2 Nov 2023 19:16:42 +0100 Subject: [PATCH] Revert "Fix printing multivariate polynomial ring with many variables (#1476)" This reverts commit 23ff5b1cced4f494c209d0c3233f5e6d4c204bdd. --- docs/src/mpolynomial.md | 4 ---- docs/src/mseries.md | 2 +- src/AbsMSeries.jl | 4 ++-- src/FreeAssAlgebra.jl | 2 +- src/LaurentMPoly.jl | 4 ++-- src/MPoly.jl | 6 +++--- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/src/mpolynomial.md b/docs/src/mpolynomial.md index 09d859daa0..56f3761b99 100644 --- a/docs/src/mpolynomial.md +++ b/docs/src/mpolynomial.md @@ -96,10 +96,6 @@ julia> derivative(k, 1) julia> derivative(k, 2) 0 -julia> R, x = polynomial_ring(ZZ, 10); R -Multivariate polynomial ring in 10 variables x1, x2, x3, x4, ..., x10 - over integers - ``` ## Polynomial constructors diff --git a/docs/src/mseries.md b/docs/src/mseries.md index c2d9121061..b1d975b3be 100644 --- a/docs/src/mseries.md +++ b/docs/src/mseries.md @@ -197,7 +197,7 @@ julia> v = symbols(R) :x julia> T = parent(x + 1) -Multivariate power series ring in 1 variable x +Multivariate power series ringin 1 variable x over integers julia> f == deepcopy(f) diff --git a/src/AbsMSeries.jl b/src/AbsMSeries.jl index be73175c7f..33782bf973 100644 --- a/src/AbsMSeries.jl +++ b/src/AbsMSeries.jl @@ -119,10 +119,10 @@ function show(io::IO, ::MIME"text/plain", p::MSeriesRing) max_vars = 5 # largest number of variables to print n = nvars(p) print(io, "Multivariate power series ring") - print(io, " in ", ItemQuantity(nvars(p), "variable"), " ") + print(io, "in ", ItemQuantity(nvars(p), "variable"), " ") if n > max_vars join(io, symbols(p)[1:max_vars - 1], ", ") - println(io, ", ..., ", symbols(a)[n]) + println(io, "..., ", symbols(p)[n]) else join(io, symbols(p), ", ") println(io) diff --git a/src/FreeAssAlgebra.jl b/src/FreeAssAlgebra.jl index bf3a759a06..c5e152b8a6 100644 --- a/src/FreeAssAlgebra.jl +++ b/src/FreeAssAlgebra.jl @@ -70,7 +70,7 @@ function show(io::IO, ::MIME"text/plain", a::FreeAssAlgebra) print(io, " on ", ItemQuantity(nvars(a), "indeterminate"), " ") if n > max_vars join(io, symbols(a)[1:max_vars - 1], ", ") - println(io, ", ..., ", symbols(a)[n]) + println(io, "..., ", symbols(a)[n]) else join(io, symbols(a), ", ") println(io) diff --git a/src/LaurentMPoly.jl b/src/LaurentMPoly.jl index 08b4aa1d06..93516b5261 100644 --- a/src/LaurentMPoly.jl +++ b/src/LaurentMPoly.jl @@ -36,10 +36,10 @@ function show(io::IO, ::MIME"text/plain", p::LaurentMPolyRing) max_vars = 5 # largest number of variables to print n = nvars(p) print(io, "Multivariate Laurent polynomial ring") - print(io, " in ", ItemQuantity(nvars(p), "variable"), " ") + print(io, "in ", ItemQuantity(nvars(p), "variable"), " ") if n > max_vars join(io, symbols(p)[1:max_vars - 1], ", ") - println(io, ", ..., ", symbols(a)[n]) + println(io, "..., ", symbols(p)[n]) else join(io, symbols(p), ", ") println(io) diff --git a/src/MPoly.jl b/src/MPoly.jl index 000fbdc909..5b1811c797 100644 --- a/src/MPoly.jl +++ b/src/MPoly.jl @@ -570,12 +570,12 @@ function show(io::IO, ::MIME"text/plain", p::MPolyRing) print(io, " in ", ItemQuantity(nvars(p), "variable"), " ") if n > max_vars join(io, symbols(p)[1:max_vars - 1], ", ") - println(io, ", ..., ", symbols(p)[n]) + println(io, "..., ", symbols(p)[n]) else join(io, symbols(p), ", ") println(io) end - io = pretty(io) + io = pretty(io) # we need this to allow indented and lowercase printing print(io, Indent(), "over ", Lowercase(), base_ring(p)) print(io, Dedent()) end @@ -585,8 +585,8 @@ function show(io::IO, p::MPolyRing) # no nested printing print(io, "Multivariate polynomial ring") else + io = pretty(io) # we need this to allow printing lowercase # nested printing allowed, preferably supercompact - io = pretty(io) print(io, "Multivariate polynomial ring in ", ItemQuantity(nvars(p), "variable")) print(IOContext(io, :supercompact => true), " over ", Lowercase(), base_ring(p)) end