On Friday, August 12, 2016 at 6:20:24 PM UTC-4, Nathan Smith wrote: > > Hi all, > > I'm still a little confused about how to use julia's multimedia i/o. I'm > writing a module to interact with Maxima CAS and I want to provide i/o for > my maxima expression types. There are three different contexts that I'm > interested in: > > (1) During string interpolation (among other things) I need to print out a > 1D version of the expression >
show(io::IO, x::MyType) > (2) In the REPL I want to print out a 2D version of the expression > writemime(io::IO, ::MIME"text/plain", x::MyType) > (3) In Jupyter I want to print out a pretty Tex/MathML version of the > expression > writemime(io::IO, ::MIME"text/latex", x::MyType) = print(io, ...latex representation of x....) In Julia 0.5, writemime is renamed to show (with three arguments). To work with both Julia 0.4 and 0.5, use the Compat package and define @compat show(io, mime, x).
