Ask Your Question

Automatic typesetting in Jupyter

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

marmistrz gravatar image

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

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

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

slelievre gravatar image

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


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

edit flag offensive delete link more


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

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

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

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


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

marmistrz gravatar imagemarmistrz ( 2015-12-23 20:20:47 +0200 )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 +0200 )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 +0200 )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



Asked: 2015-12-20 13:18:13 +0200

Seen: 3,174 times

Last updated: Dec 28 '15