<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 6, 2016, at 06:13, Jason Moore <<a href="mailto:moorepants@gmail.com" class="">moorepants@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class="">SymPy has a comprehensive printing system and we leverage IPython's qtconsole and notebook display abilities to show mathematics in unicode, mathjax, and png outputs. Typically all three of these are generated and the IPython frontend can choose what to display.<br class=""><br class=""></div>We've hit a bug that we can't figure out how to fix though. Matplotlib has a minimal LaTeX implementation and can output PNGs. If a user doesn't have a full LaTeX suit installed we fall back to that. But since matplotlib doesn't handle LaTeX environments, it can't render things like matrices.<br class=""><br class=""></div>Now if a qtconsole user tries to display a matrix, this fails if matplotlib is the only available renderer. But if the user is using the notebook then the matplotlib renderer will fail but mathjax will print properly. We'd like to fall back to unicode printing if matplotlib fails to print **only in the qtconsole**, but render with mathjax in the notebook.<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>Technically you can only distinguish a non-zmq from a ZMQ front-end, so **only** in qtconsole is not reliable.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">So, as far as we can tell, we need to know which frontend is trying to display our object so that we can handle errors properly. We haven't been able to think of a workaround that is agnostic of the frontend.<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>Can’t you register 2 display formatter (tex and pretty unicode) so that it display correctly on both ?</div><div><br class=""></div><div>Though IIUC there might also be a bug where our Tex to Png that should not return empty PNG.</div><div>-- </div><div>M</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div>There is some discussion in this PR: <a href="https://github.com/sympy/sympy/pull/9976" class="">https://github.com/sympy/sympy/pull/9976</a> (among others).<br class=""><br class=""></div>Any suggestions?<br clear="all" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><br class="">Jason<br class=""><a href="http://moorepants.info/" target="_blank" class="">moorepants.info</a><br class=""><span class="">+01 530-601-9791</span><br class=""></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div></div>
_______________________________________________<br class="">IPython-dev mailing list<br class=""><a href="mailto:IPython-dev@scipy.org" class="">IPython-dev@scipy.org</a><br class="">https://mail.scipy.org/mailman/listinfo/ipython-dev<br class=""></div></blockquote></div><br class=""></body></html>