Ask Your Question

testtest2's profile - activity

2018-08-05 22:38:01 +0200 received badge  Famous Question (source)
2016-03-09 03:14:31 +0200 received badge  Notable Question (source)
2016-03-09 03:14:31 +0200 received badge  Popular Question (source)
2014-01-08 09:21:35 +0200 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 09:19:27 +0200 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 09:19:27 +0200 received badge  Scholar (source)
2014-01-08 09:19:26 +0200 received badge  Supporter (source)
2014-01-08 07:58:50 +0200 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.