ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 31 May 2019 11:37:33 -0500Automatic typesetting in Jupyterhttps://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/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.Sun, 20 Dec 2015 06:18:13 -0600https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/Answer by calc314 for <p>When using the Jupyter notebook I always have to type</p>
<pre><code>%display typeset
</code></pre>
<p>as my first line so as to enable typesetting.</p>
<p>Is there any way to avoid it and have the answers typeset automatically?</p>
<p>I'm using sagemath-upstream-binary from the PPA and Linux Mint 17.3 Cinnamon.</p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?answer=31767#post-id-31767Your 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.Tue, 22 Dec 2015 16:38:16 -0600https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?answer=31767#post-id-31767Comment by Šarūnas Burdulis for <p>Your question does not specify whether you are using SageMath Cloud or just an standalone version of Jupyter.</p>
<p>In Sage Math Cloud, the typesetting appears to be set to default to use MathJax.</p>
<p>Otherwise, you need to get to a terminal and type <code>jupyter notebook --generate-config</code> to generate the configuration file <code>jupyter_notebook_config.py</code>. Then, edit this file and uncomment the following line:</p>
<pre><code># c.NotebookApp.enable_mathjax = True
</code></pre>
<p>This should change the defaults as far as I can tell. Unfortunately, I'm not set up to test this at the moment.</p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=46745#post-id-46745jupyter setting `c.NotebookApp.enable_mathjax = True` does not seem to affect Sagemath typesetting mode.Fri, 31 May 2019 11:37:33 -0500https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=46745#post-id-46745Comment by calc314 for <p>Your question does not specify whether you are using SageMath Cloud or just an standalone version of Jupyter.</p>
<p>In Sage Math Cloud, the typesetting appears to be set to default to use MathJax.</p>
<p>Otherwise, you need to get to a terminal and type <code>jupyter notebook --generate-config</code> to generate the configuration file <code>jupyter_notebook_config.py</code>. Then, edit this file and uncomment the following line:</p>
<pre><code># c.NotebookApp.enable_mathjax = True
</code></pre>
<p>This should change the defaults as far as I can tell. Unfortunately, I'm not set up to test this at the moment.</p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=31834#post-id-31834Is 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.Thu, 24 Dec 2015 14:13:35 -0600https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=31834#post-id-31834Comment by marmistrz for <p>Your question does not specify whether you are using SageMath Cloud or just an standalone version of Jupyter.</p>
<p>In Sage Math Cloud, the typesetting appears to be set to default to use MathJax.</p>
<p>Otherwise, you need to get to a terminal and type <code>jupyter notebook --generate-config</code> to generate the configuration file <code>jupyter_notebook_config.py</code>. Then, edit this file and uncomment the following line:</p>
<pre><code># c.NotebookApp.enable_mathjax = True
</code></pre>
<p>This should change the defaults as far as I can tell. Unfortunately, I'm not set up to test this at the moment.</p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=31813#post-id-31813I have this line in `/usr/lib/sagemath/local/etc/jupyter_notebook_config.py` but I still need to use `%display typeset`Wed, 23 Dec 2015 13:20:47 -0600https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=31813#post-id-31813Answer by slelievre for <p>When using the Jupyter notebook I always have to type</p>
<pre><code>%display typeset
</code></pre>
<p>as my first line so as to enable typesetting.</p>
<p>Is there any way to avoid it and have the answers typeset automatically?</p>
<p>I'm using sagemath-upstream-binary from the PPA and Linux Mint 17.3 Cinnamon.</p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?answer=31869#post-id-31869Use 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/reference/repl/startup.htmlMon, 28 Dec 2015 02:18:32 -0600https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?answer=31869#post-id-31869Comment by Šarūnas Burdulis for <p>Use the <code>init.sage</code> file and include this line in that file:</p>
<pre><code>pretty_print_default(True)
</code></pre>
<p>See the section about 'init.sage' on this page:</p>
<p><a href="http://doc.sagemath.org/html/en/reference/repl/startup.html">http://doc.sagemath.org/html/en/refer...</a></p>
https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=46744#post-id-46744This works. Set it in `~/.sage/init.sage`Fri, 31 May 2019 11:19:12 -0500https://ask.sagemath.org/question/31710/automatic-typesetting-in-jupyter/?comment=46744#post-id-46744