IPython Notebook Sympy数学渲染

Dot*_*tPi 15 sympy ipython-notebook

我刚刚开始使用IPython Notebook,并对它的强大功能着迷.我一直在网上使用一些例子来开始.我正在学习本教程:http://nbviewer.ipython.org/url/finiterank.com/cuadernos/suavesylocas.ipynb但数学输出未按预期呈现.下面是我的代码和输出:

In [30]:

%load_ext sympyprinting
%pylab inline

from __future__ import division
import sympy as sym
from sympy import *

init_printing()

x,y,z=symbols("x y z")
k,m,n=symbols("k m n", integer=True)

The sympyprinting extension is already loaded. To reload it, use:
  %reload_ext sympyprinting

Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.

In [31]:

t = sin(2*pi*x*(k**2))/ (4*(pi**2)*(k**5)) + (x**2) / (2*k)
t
Out[31]:
  2      ?     2  ?
 x    sin?2???k ?x?
??? + ?????????????
2?k         2  5   
         4?? ?k   
Run Code Online (Sandbox Code Playgroud)

我也尝试了其他例子,但它们也没有得到正确的渲染.我哪里错了?

小智 17

我有同样的问题.尝试

from sympy.interactive import printing
printing.init_printing(use_latex=True)
Run Code Online (Sandbox Code Playgroud)

代替

%load_ext sympyprinting
Run Code Online (Sandbox Code Playgroud)

我正在使用sympy 0.7.2