Ask Your Question

testtest2's profile - activity

2018-08-05 15:38:01 -0500 received badge  Famous Question (source)
2016-03-08 20:14:31 -0500 received badge  Notable Question (source)
2016-03-08 20:14:31 -0500 received badge  Popular Question (source)
2014-01-08 02:21:35 -0500 commented answer How to get the same environment in "sage -ipython notebook" as in "sage"?

This worked, thank you! One more problem though: The results are not pretty-printed using MathJax automatically, and if I surround the command with "pretty_print(...)", it prints the HTML code rather than rendering it. How can I activate MathJax rendering by default?

2014-01-08 02:19:27 -0500 received badge  Scholar (source)
2014-01-08 02:19:27 -0500 marked best answer How to get the same environment in "sage -ipython notebook" as in "sage"?

I agree with @ppurka explanation (i was going to answer along the same lines before his/her solution appears ;) and the workaround to have the preparser work in a ipython shell (or notebook) is to type:

%load_ext sage.misc.sage_extension

as suggested here

2014-01-08 02:19:26 -0500 received badge  Supporter (source)
2014-01-08 00:58:50 -0500 asked a question How to get the same environment in "sage -ipython notebook" as in "sage"?

If I start the command line version of sage with sage and type

integrate(x^2,x)

I get

1/3*x^3

as desired.


However, if I start sage in IPython's notebook with sage -ipython notebook and type the same thing I get

NameError: name 'integrate' is not defined

Trying to fix this by defining some prerequisites

from sage.all import *
,var x

I now get

RuntimeError: Use ** for exponentiation, not '^', which means xor
in Python, and has the wrong precedence.


In other words, it is clear that sage -ipython notebook does not provide the same environment as sage.

How can I fix this? I just want an IPython notebook that works like my sage command line.