TeX output in IPython qt 0.11

121 views
Skip to first unread message

hm70

unread,
Aug 21, 2011, 9:31:52 PM8/21/11
to sympy
I've seen at http://research.scios.ch/inet/doku.php?id=ipy_tex a
screenshot showing simpy code output as inline PNG in the new IPython
version (qt). Apparently the _repr_png_ method together with --
pylab=inline can be used to render any latex output on the fly.
My question: is it feasible to provide simpy objects with a suitable
_repr_png_ method?
Hans Moser

Aaron Meurer

unread,
Aug 22, 2011, 1:52:59 PM8/22/11
to sy...@googlegroups.com
Cool. I knew there had to be a way to render LaTeX in the qtconsole
other than just using matplotlib.

Probably the best way to use this with SymPy would be to create a
custom printer that sends the output of latex() through the TeX
command. You can play around with this. I'll take a look at it later
to see if I can get it to work.

We also have a function preview(), which I think can be modified to
work with the qtconsole (again, I need to play with it).

Aaron Meurer

> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
>

Hans Moser

unread,
Aug 25, 2011, 10:52:11 AM8/25/11
to sy...@googlegroups.com
Hi
Thank you for the answer. Meanwhile I had a conversation with the author who fed me with hopes but discouraged me from changing any core code.
H.Moser
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone

Aaron Meurer

unread,
Aug 25, 2011, 7:12:11 PM8/25/11
to sy...@googlegroups.com
Actually, the author and I are currently discussing off list ways to
get this to work by default (perhaps it should be brought on list).

Aaron Meurer

Brian Granger

unread,
Aug 25, 2011, 8:24:25 PM8/25/11
to sy...@googlegroups.com
Aaron,

On Thu, Aug 25, 2011 at 4:12 PM, Aaron Meurer <asme...@gmail.com> wrote:
> Actually, the author and I are currently discussing off list ways to
> get this to work by default (perhaps it should be brought on list).

Yes, please do. I can definitely point in the right direction on the
IPython side of things. To see how the printing works and how to get
an image back to the frontend, have a look in
IPython.extensions.sympyprinting.

Cheers,

Brian

> Aaron Meurer
>
> On Thu, Aug 25, 2011 at 8:52 AM, Hans Moser <hans.m...@gmx.at> wrote:
>> Hi
>> Thank you for the answer. Meanwhile I had a conversation with the author who fed me with hopes but discouraged me from changing any core code.
>> H.Moser
>> --
>> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
>> Jetzt informieren: http://www.gmx.net/de/go/freephone
>>
>> --
>> You received this message because you are subscribed to the Google Groups "sympy" group.
>> To post to this group, send email to sy...@googlegroups.com.
>> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
>

--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgra...@calpoly.edu and elli...@gmail.com

Aaron Meurer

unread,
Aug 26, 2011, 11:36:30 AM8/26/11
to sy...@googlegroups.com
On Thu, Aug 25, 2011 at 6:24 PM, Brian Granger <elli...@gmail.com> wrote:
> Aaron,
>
> On Thu, Aug 25, 2011 at 4:12 PM, Aaron Meurer <asme...@gmail.com> wrote:
>> Actually, the author and I are currently discussing off list ways to
>> get this to work by default (perhaps it should be brought on list).
>
> Yes, please do.  I can definitely point in the right direction on the
> IPython side of things.  To see how the printing works and how to get
> an image back to the frontend, have a look in
> IPython.extensions.sympyprinting.
>
> Cheers,
>
> Brian

Thanks. This doesn't exactly tell me how to make the SymPy pretty
printer return a png, but I'll look into it.

I noticed that you are doing some replacements for things like
\operatorname that mathtext doesn't support. We should fix some of
this stuff upstream, so you can just do latex(mode="matplotlib") and
it will give you a suitable form.

Aaron Meurer

Reply all
Reply to author
Forward
0 new messages