Skip to content

Commit

Permalink
Merge pull request #763 from JuliaSymbolics/ChrisRackauckas-patch-1
Browse files Browse the repository at this point in the history
Fix `MIME"text/latex"` output to ensure it's in a TeX environment
  • Loading branch information
ChrisRackauckas authored Oct 15, 2022
2 parents 6cf49a4 + 9db4342 commit 2388acd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/latexify_recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ end
return Expr(:call, :connect, map(nameof, c.systems)...)
end

Base.show(io::IO, ::MIME"text/latex", x::Num) = print(io, latexify(x))
Base.show(io::IO, ::MIME"text/latex", x::Symbolic) = print(io, latexify(x))
Base.show(io::IO, ::MIME"text/latex", x::Equation) = print(io, latexify(x))
Base.show(io::IO, ::MIME"text/latex", x::Vector{Equation}) = print(io, latexify(x))
Base.show(io::IO, ::MIME"text/latex", x::AbstractArray{Num}) = print(io, latexify(x))
Base.show(io::IO, ::MIME"text/latex", x::Num) = print(io, "\$\$ " * latexify(x) * " \$\$")
Base.show(io::IO, ::MIME"text/latex", x::Symbolic) = print(io, "\$\$ " * latexify(x) * " \$\$")
Base.show(io::IO, ::MIME"text/latex", x::Equation) = print(io, "\$\$ " * latexify(x) * " \$\$")
Base.show(io::IO, ::MIME"text/latex", x::Vector{Equation}) = print(io, "\$\$ " * latexify(x) * " \$\$")
Base.show(io::IO, ::MIME"text/latex", x::AbstractArray{Num}) = print(io, "\$\$ " * latexify(x) * " \$\$")

_toexpr(O::ArrayOp) = _toexpr(O.term)

Expand Down

0 comments on commit 2388acd

Please sign in to comment.