[IPython-User] questions about latex rendering in ipython with sympy
Tue Jan 10 03:51:45 CST 2012
If I understand the question correctly, he is not using the sympy
profile, which enables mathjax output, but just the regular SymPy
pretty printing. Correct me if I am wrong.
To enable MathJax printing, load the notebook with --profile=sympy.
This will also import all of sympy and define common symbols, like
isympy. I think there's a way to do this without the profile, but the
IPython guys will have to comment on how to do that. I know you can
import display from IPython.core.display and use that, but I don't
know if there's some magic to set the display hook to that for you.
We do plan to implement this in sympy so you can just do
init_printing() from within the notebook and it will enable the LaTeX
printing with MathJax by default (the same in the qtconsole). See
http://code.google.com/p/sympy/issues/detail?id=2945. We also plan to
implement isympy -c qtconsole and isympy -c notebook, which will do
roughly the equivalent of ipython notebook --profile=sympy
(http://code.google.com/p/sympy/issues/detail?id=2632). But it hasn't
been done yet (patches welcome :)
On Mon, Jan 9, 2012 at 7:41 PM, Fernando Perez <email@example.com> wrote:
> On Mon, Jan 9, 2012 at 6:27 PM, Comer Duncan <firstname.lastname@example.org> wrote:
>> I am a recent user who wants to use ipython .12 to write notebooks. I have
>> ipython installed and working on my macbook pro. I am beginning to write a
>> notebook and like very much the flexibility it allows. Thanks to the
>> The notebook I am working on uses sympy. I note that the sympy example
>> renders equations. However, in my humble view the quality of the rendered
>> equations is minimal. Mathjax does a much better job I think. I have
>> cribbed the sympy example as a starter for building the notebook. I am
>> wondering whether ipython works with CDN Mathjax rather than the currently
>> working (but not particularly pretty) equation renderings used in ipython?
>> I have a separate blog which uses Mathjax and like its features.
>> Thanks for any help you can provide. Sorry for the primitive nature of my
> I'm sorry but I'm not sure what can be going on, as the notebook does
> use mathjax to render its equations as well. The sympy objects simply
> return a latex expression that is put into html, and we let mathjax
> finish rendering it. So I don't quite understand what differences you
> are seeing between the rendering of the notebook and mathjax output
> Perhaps a screenshot of the rendering you consider sub-par would help
> us figure it out.
> IPython-User mailing list
More information about the IPython-User