First time here? Check out the FAQ!

Ask Your Question
2

Automatic typesetting in Jupyter

asked 9 years ago

marmistrz gravatar image

updated 9 years ago

When using the Jupyter notebook I always have to type

%display typeset

as my first line so as to enable typesetting.

Is there any way to avoid it and have the answers typeset automatically?

I'm using sagemath-upstream-binary from the PPA and Linux Mint 17.3 Cinnamon.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 9 years ago

slelievre gravatar image

Use the init.sage file and include this line in that file:

pretty_print_default(True)

See the section about 'init.sage' on this page:

http://doc.sagemath.org/html/en/refer...

Preview: (hide)
link

Comments

This works. Set it in ~/.sage/init.sage

Šarūnas Burdulis gravatar imageŠarūnas Burdulis ( 5 years ago )
0

answered 9 years ago

calc314 gravatar image

Your question does not specify whether you are using SageMath Cloud or just an standalone version of Jupyter.

In Sage Math Cloud, the typesetting appears to be set to default to use MathJax.

Otherwise, you need to get to a terminal and type jupyter notebook --generate-config to generate the configuration file jupyter_notebook_config.py. Then, edit this file and uncomment the following line:

# c.NotebookApp.enable_mathjax = True

This should change the defaults as far as I can tell. Unfortunately, I'm not set up to test this at the moment.

Preview: (hide)
link

Comments

I have this line in /usr/lib/sagemath/local/etc/jupyter_notebook_config.py but I still need to use %display typeset

marmistrz gravatar imagemarmistrz ( 9 years ago )

Is it uncommented?

Also, are you running your own stand-alone version of Sage Math Cloud, or if not, what is your configuration?

Finally, can you add an example to your original question of code that should produce typeset output but doesn't?

I will take another look at it.

calc314 gravatar imagecalc314 ( 9 years ago )

jupyter setting c.NotebookApp.enable_mathjax = True does not seem to affect Sagemath typesetting mode.

Šarūnas Burdulis gravatar imageŠarūnas Burdulis ( 5 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 9 years ago

Seen: 3,378 times

Last updated: Dec 28 '15