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

Matthias BUSSONNIER bussonniermatthias@gmail....
Sun Mar 3 14:02:18 CST 2013


Le 3 mars 2013 à 19:51, Thomas Hisch a écrit :
> 
> The sympy printing ext. is now hosted in the sympy repo and can be
> loaded with %load_ext sympy.interactive.ipythonprinting. This does not
> 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.
-- 
Matthias



More information about the IPython-User mailing list