ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 20 Feb 2020 06:40:07 -0600Can I make MathJax output centered in the notebook?https://ask.sagemath.org/question/50002/can-i-make-mathjax-output-centered-in-the-notebook/ My problem is the same one described here:
[Equations in notebook jump from centered to L aligned upon rendering](https://github.com/ipython/ipython/issues/7827)
and
[Centered equations become left aligned if displayed through the markdown display hook](https://github.com/ipython/ipython/issues/11159)
When I use @interact on something that outputs latex in the notebook, the constant jumping to the left is very annoying and distracting.
E.g.:
@interact
def myfunc(n = slider(1,10)):
P = matrix([[1,2,n], [2,2,3]])
show(P)
Is there any way I can control the MathJax rendering in the notebook? Can I perhaps set it to render in the center so I don't have to deal with the jumping?
ThankseodThu, 20 Feb 2020 06:40:07 -0600https://ask.sagemath.org/question/50002/same-origin errors for SageMath tutorial inside Jupyterlabhttps://ask.sagemath.org/question/49940/same-origin-errors-for-sagemath-tutorial-inside-jupyterlab/Summary: When I select Help for sagemath from the menu in Jupyterlab, the browser throws "`allow-same-origin`" errors in the console and eventually stops processing pages completely, showing "`math processing error`" for all formulas.
I am trying to add SageMath to our existing JupyterLab 1.2.6 installation inside a docker with an Ubuntu 18.04 image. I installed SageMath 9.0 and added SageMath to Jupyter via `jupyter kernelspec install ./local/share/jupyter/kernels/sagemath`.
Everything seems to run fine, except for the help: When I select "Sage Documentation" from the Help menu, in the Web Browser console I get `The document is sandboxed and lacks the allow-same-origin flag`. While the document seems to be working anyway, going through the doucmentation yields an error for every single formula it encounters, specifically: `Access to font at XX from origin null has been blocked by CORS policy, No Access-Control-Allow-Origin header is present on the requested resource`.
Still, it seems to be working somewhat, I think with the wrong fonts, but readable. However, at some point MathJax stops processing formulas completely and shows `Math Processing Error` for each formula.
I already tried setting allow-origin in the notebook configuration, but that did not change anything.
Anybody has a clue?wuebbelSun, 16 Feb 2020 02:53:03 -0600https://ask.sagemath.org/question/49940/Jupyter doesn't use the built-in MathJaxhttps://ask.sagemath.org/question/31542/jupyter-doesnt-use-the-built-in-mathjax/I have two copies of MathJax. One in /usr/lib/sagemath/local/share/mathjax, another in /usr/share/javascript/mathjax.
I open up the jupyter notebook: `sage -n jupyter`. I open a notebook and what I get is
> Math/LaTeX rendering will be disabled.
>
> If you have administrative access to
> the notebook server and a working
> internet connection, you can install a
> local copy of MathJax for offline use
> with the following command on the
> server at a Python or Jupyter prompt:
>
> >>> from Jupyter.external import mathjax; mathjax.install_mathjax()
But I don't want a third (sic!) copy of MathJax on my computer! How can I make Jupyter use the existing ones?
I'm using Linux Mint 17.2, used the sagemath-upstream-binary package from the PPA.marmistrzSun, 13 Dec 2015 02:18:10 -0600https://ask.sagemath.org/question/31542/jupyter (ipython notebook) kernel math displayhttps://ask.sagemath.org/question/30163/jupyter-ipython-notebook-kernel-math-display/I'm trying to set up sage as a [jupyter](https://jupyter.org/) (ipython notebook 4.0+) kernel on my local machine.
To do this, I have installed sage in /usr/local/sage, and set up a kernel using the SageKernelSpec tool (following instructions [here](http://doc.sagemath.org/html/en/reference/repl/sage/repl/ipython_kernel/install.html)).
My sage kernel.json looks like this:
> {"display_name": "Sage 6.9", "argv": ["/usr/local/sage/sage", "-python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]}
The kernel starts from within jupyter, and I am able to run sage. However, math text is not rendered. As an example:
x, y = var('x y')
show(x/y)
> \newcommand{\Bold}[1]{\mathbf{#1}}\frac{x}{y}
The problem seems to be that the notebook is not recognising and formatting mathjax input properly. I have tried manually linking the sage mathjax library to ipython using:
use_local_mathjax()
But it still does not work.
I *can* get a properly functioning sage notebook by entering:
sage -n ipython
in terminal, but when starting the notebook from my standard jupyter environment (i.e. choosing the kernel from the dropdown list), the mathtype is not rendered.
I can't work out what's going on... any pointers appreciated.
Thanks!oscarbransonTue, 20 Oct 2015 20:25:38 -0500https://ask.sagemath.org/question/30163/