diff --git a/src/latexify_recipes.jl b/src/latexify_recipes.jl index 2b42953d1..7f801b6c9 100644 --- a/src/latexify_recipes.jl +++ b/src/latexify_recipes.jl @@ -230,6 +230,8 @@ function _toexpr(O) return :(solve($(_toexpr(args[1])), $(_toexpr(args[2])))) elseif issym(op) && symtype(op) <: AbstractArray return :(_textbf($(nameof(op)))) + elseif op === identity + return _toexpr(only(args)) # suppress identity transformations (e.g. "identity(π)" -> "π") end return Expr(:call, Symbol(op), _toexpr(args)...) end diff --git a/test/latexify.jl b/test/latexify.jl index d5249abc8..23d005cae 100644 --- a/test/latexify.jl +++ b/test/latexify.jl @@ -57,3 +57,5 @@ Dy = Differential(y) @test_reference "latexify_refs/indices1.txt" latexify(h[10,10]) @test_reference "latexify_refs/indices2.txt" latexify(h[10,10], index=:bracket) + +@test !occursin("identity", latexify(Num(π))) # issue #1254