# [IPython-User] switching between display representations in the frontend

Aaron Meurer asmeurer@gmail....
Sun Mar 3 14:23:13 CST 2013

On Mar 3, 2013, at 1:02 PM, Matthias BUSSONNIER <
bussonniermatthias@gmail.com> wrote:

Le 3 mars 2013 à 19:51, Thomas Hisch a écrit :

The sympy printing ext. is now hosted in the sympy repo and can be

set up the formatter for 'text/latex' ! You have to call

sympy.interactive.init_printing(use_latex=True) to initialize the

extension.

Ah, sorry, I'm not a huge user of sympy and I still have an old version.

Once the latex repr is enabled one can't switch the output

to 'image/png' (due to the output order in the frontend) by calling

init_printing with a different set of options. This is what I need to

fix for my PR.

There is still something I quite do not understand.
What are shown on those images/png and why do you want to switch ?
I couldn't see any reason why you would like to deactivate LaTeX to see the
png ?
For debug purposes ?

Sorry, if I'm insisting in really understanding the use case, I really wish
to understand why,
both for myself, and also because from experience, trying to take frontend
into account in library
that run in kernel are generally a bad choice.

So it is **really** a question of frontend to know wether or not show latex
or png or jpeg.

A function in IPython to change the 'output order' for specified

frontends would be ideal.

In the notebook this shouldn't be difficult, it's monkey patching what I
sent you in the first mail, just need to write UI, and bundle it as an
extension.
It is not just high-priority.

Shouldn't be much harder for QtConsole neither, but low priority too.
Especially because up until now, I haven't really seen a reason why you
would prefer to modify priority.

I'll try to take a look at the PR later.

The pull request integrates the iPyXt extension into SymPy. This extension
calls latex directly if it is installed to render the SymPy output. In the
qtconsole this is highly preferred over latex, which uses matplotlib, and
it might even be preferred in the notebook by some users, since technically
latex is the best possible math output, even better than mathjax
(especially if it is fast enough and if we can modify it to use vector
graphics, which I hope we can).

By the way, there are some bugs in the SymPy extension with dev ipython
which are fixed at https://github.com/sympy/sympy/pull/1853. In particular
I think what Thomas said about the extension not using latex by default is
just a bug.

Aaron Meurer

--
Matthias

_______________________________________________
IPython-User mailing list
IPython-User@scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130303/0c46279e/attachment.html