Skip to content

Commit

Permalink
avoid latex rendering if system has too many equations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
baggepinnen authored Nov 8, 2023
1 parent 397ab12 commit 3b39fa0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 1707 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L1706-L1707

Added lines #L1706 - L1707 were not covered by tests
end
print(io, "\$\$ " * latexify(x) * " \$\$")
end

Expand Down

0 comments on commit 3b39fa0

Please sign in to comment.