From 3b39fa0b6137637d1c6d8456f0c96be9dc1c42b2 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Wed, 8 Nov 2023 15:06:21 +0100 Subject: [PATCH] avoid latex rendering if system has too many equations The latex rendering of systems in Pluto notebooks and the documentation looks very bad for large systems. This PR reverts to the standard printing of systems if the number of equations is > 50. Ideally, I'd like to avoid automatic latexification at all times, it is currently poorly implemented and has a ton of known issues. It would be better to ask the user to opt into latexification and use something that is more robust by default. --- src/systems/abstractsystem.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systems/abstractsystem.jl b/src/systems/abstractsystem.jl index fb65274828..88d0c3a32a 100644 --- a/src/systems/abstractsystem.jl +++ b/src/systems/abstractsystem.jl @@ -1703,6 +1703,9 @@ end end function Base.show(io::IO, ::MIME"text/latex", x::AbstractSystem) + if length(equations(sys)) > 50 + return Base.show(io::IO, ::MIME"text/plain", x) + end print(io, "\$\$ " * latexify(x) * " \$\$") end