MathJax output in SageNB

32 views
Skip to first unread message

Andrey Novoseltsev

unread,
Sep 2, 2015, 9:00:57 PM9/2/15
to sage-notebook
Hello,

Can somebody (e.g. William who started it 9 years ago ;-)) clarify why is it necessary to replace $...$ with <script ...>...</script> tags when displaying HTML in SageNB?

https://github.com/sagemath/sage/blob/master/src/sage/misc/html.py#L17

That is: MathJax does its own parsing for math delimiters, why do we need to fiddle with it? And we do need - skipping this step break math display in the output, while $..$ work in text cells. The output is wrapped in <pre> which MathJax skips by default, and I tried to use "process_class" setting for internal tags, but was not successful so far.

Thank you!
Andrey

William Stein

unread,
Sep 2, 2015, 9:24:03 PM9/2/15
to sage-n...@googlegroups.com


On Wednesday, September 2, 2015, Andrey Novoseltsev <novo...@gmail.com> wrote:
Hello,

Can somebody (e.g. William who started it 9 years ago ;-)) clarify why is it necessary to replace $...$ with <scri

Because when I implemented this mathjax didn't exist!  There was a predecessor that called jsmath and it worked that way.  I don't think I was involved in rewriting sagenb to use mathjax instead of jsmath. 

 
 
 ...>...</script> tags when displaying HTML in SageNB?

https://github.com/sagemath/sage/blob/master/src/sage/misc/html.py#L17

That is: MathJax does its own parsing for math delimiters, why do we need to fiddle with it? And we do need - skipping this step break math display in the output, while $..$ work in text cells. The output is wrapped in <pre> which MathJax skips by default, and I tried to use "process_class" setting for internal tags, but was not successful so far.

Thank you!
Andrey

--
You received this message because you are subscribed to the Google Groups "sage-notebook" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-noteboo...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-notebook.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.
Reply all
Reply to author
Forward
0 new messages