I define a object and want to generate the latex output using Latexify.jl. The object is defined as following
struct vecSym <: Number
name::String
function vecSym(x::String)
new(x)
end
end
function Base.show(io::IO, ::MIME"text/latex", vec::vecSym)
print(io, latexify(vec.name))
end
Then the output of the object is in latex style.
Then I define a method for this object as following
struct vecAdd
veca
function vecAdd(x)
new(x)
end
end
function Base.show(io::IO,::MIME"text/latex",y::vecAdd)
print(io, “+”,“(”, y.veca, “)”)
end
Then the output is not in latex style anymore.
Does anybody know what happens? Why this vecAdd method can not show the output in the latex form as +((P_1,P_2))?