[Debian-science-sagemath] A question about SageMath on Debian and MathJax

Jan Groenewald jan at aims.ac.za
Wed Sep 20 10:17:10 UTC 2017


Hi

On 20 September 2017 at 11:21, Ximin Luo <infinity0 at debian.org> wrote:

> Jan Groenewald:
> > Hi
> >
> > On 19 September 2017 at 21:18, Jan Groenewald <jan at aims.ac.za> wrote:
> >
> >> Thanks
> >>
> >> On 19 September 2017 at 21:08, Ximin Luo <infinity0 at debian.org> wrote:
> >>
> >>> Samuel Lelièvre:
> >>>> Dear debian-science-sagemath,
> >>>>
> >>>> There is a question on sage-devel about SageMath
> >>>> on Debian and MathJax:
> >>>>
> >>>> https://groups.google.com/d/topic/sage-devel/sL_iYHfFB2M/discussion
> >>>>
> >>>> Could anyone on this list answer it?
> >>>>
> >>>
> >>> Hi, (I think) the default is actually controlled by Jupyter Notebook
> and
> >>> not SageMath. You can hack it locally by editing:
> >>>
> >>> /usr/lib/python2.7/dist-packages/notebook/templates/notebook.html
> >>>
> >>> I believe you just need to change, near the top:
> >>>
> >>> {{mathjax_url}}?config=TeX-AMS_HTML-full
> >>> to:
> >>> {{mathjax_url}}?config=TeX-AMS_SVG-full
> >>>
> >>> Afterwards, restart the notebook server. You might also need to clear
> >>> your cookies / local storage if you've specifically overridden that
> setting
> >>> for particular formulas.
> >>>
> >>> I'm not sure the best way we could make this configurable across your
> >>> whole campus, but perhaps it's best to open an issue and discuss it
> with
> >>> the Jupyter Notebook people.
> >>>
> >>>
> >> Yes, seems to work! Discuss where with jupyter notebook people?  Seems
> irc
> >> and gitter is quiet. On github itself?
> >>
>
> Yes I meant on Github. But actually in the latest version of that file
> they have replaced the hardcoded config with a {{mathjax_config}}:
> https://github.com/jupyter/notebook/blob/master/notebook/
> templates/notebook.html#L8
>
> According to this https://jupyter-notebook.readthedocs.io/en/latest/
> config.html the user can set it in ~/.jupyter/jupyter_notebook_config.py
> NotebookApp.mathjax_config = 'TeX-AMS-MML_HTMLorMML-full,Safe'
>
> (This version is not packaged yet for Debian, but hopefully soon.)
>
> > Okay not sure from user feedback. Will have to check in person tomorrow.
> > whether it is working.
> >
>
> Did they reset their cookies / local storage? I'm not sure of the easiest
> way to selectively do that, but ctrl-shift-delete in Chrome and Firefox
> will get rid of a whole chunk of stuff.
>

Yes, I completely removed ~/.mozilla, it still does not work to edit
/usr/lib/python2.7/dist-packages/notebook/templates/notebook.html.
Maybe {{mathjax_url}} is not set and so that if statement is never entered?

Anyway, this worked for now, it seems. I will deploy this:

cd /usr/share/javascript/mathjax/config
mv TeX-AMS_HTML-full.js{,.orig}
ln -s TeX-AMS_CHTML-full.js tex-AIMS_HTML-full.js

so I get a symlink to use Common HTML instead of HTML-CSS:

root at muizenberg:/usr/share/javascript/mathjax/config#ls -l
TeX-AMS_HTML-full.js
lrwxrwxrwx 1 root root 21 Sep 20 12:16 TeX-AMS_HTML-full.js ->
TeX-AMS_CHTML-full.js

Regards,
Jan


-- 
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-science-sagemath/attachments/20170920/d8e9685d/attachment.html>


More information about the Debian-science-sagemath mailing list