I’d like to understand why a Polynomial object - which can be rendered beautifully in an IJulia notebook - isn’t rendered nicely by default, and is there a simple recipe to tell IJulia/julia how I’d like my polynomials rendered?
IJulia captures the output in multiple formats and then the frontend decides which format is the “best one”. You can see this if you look at the .ipynb file:
Thanks for opening a PR to fix this straight away @fredrikekre. I didn’t realize that IJulia captures the output in multiple formats - that is quite cool.
@tkf your code was correct to change the default mime type, but as it is changing the default output for all outputs it doesn’t look like something a user should touch!
It assumes that HTML renderer has MathJax and configured to recognize $...$. I guess it’s fine in IJulia, but if you want to add it to Polynomials.jl maybe you’d want to check isdefined(Main, :IJulia) && Main.IJulia.inited.
Or I guess a better way to do it is to set IOContext like :mathjax => true in IJulia, Documenter, etc. so that packages like Polynomials.jl can change its behavior in text/html show.