Ask Your Question
2

Automatic typesetting in Jupyter

asked 2015-12-20 13:18:13 +0100

marmistrz gravatar image

updated 2015-12-23 20:21:28 +0100

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.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-12-28 09:18:32 +0100

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...

edit flag offensive delete link more

Comments

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

Šarūnas Burdulis gravatar imageŠarūnas Burdulis ( 2019-05-31 18:19:12 +0100 )edit
0

answered 2015-12-22 23:38:16 +0100

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.

edit flag offensive delete link more

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 ( 2015-12-23 20:20:47 +0100 )edit

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 ( 2015-12-24 21:13:35 +0100 )edit

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

Šarūnas Burdulis gravatar imageŠarūnas Burdulis ( 2019-05-31 18:37:33 +0100 )edit

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: 2015-12-20 13:18:13 +0100

Seen: 3,323 times

Last updated: Dec 28 '15