New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MathJax instead of jsMath #9774
Comments
comment:2
I've been experimenting a bit with
No need for a "process()" call at the end, etc.
|
comment:3
Thanks for comment, I feel that MathJax is much slower on cheap/older computer. This could be an important issue for using Sage in highschools and universities. Is it possible to keep both MathJax and jsMath and let the notebook admin to choose, which one will be used? |
comment:4
Replying to @rbeezer:
I think MathJax includes the equivalent of our jsmath-image-fonts spkg. If we added MathJax to Sage, it might be good to strip out the image fonts and distribute them separately as a mathjax-image-fonts spkg (mathjax faq tells how to do this, I believe). Somewhere I have a half-finished prototype of this solution. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:10
Replying to @jasongrout:
Just in case you haven't thought of this, what Gollum (the GitHub forum) folks did was host the MathJax fonts on Amazon S3, and then not include them in their distribution. I don't know if that would work for you, but I wanted to point it out. |
comment:11
Replying to @sagetrac-rminer:
That's a very interesting solution. I suppose we could host them on the main sage webserver, for example. Or maybe Google Code or something like that so we had redundant sources. |
comment:12
I just found the web page http://bitbucket.org/kevindunn/sphinx-extension-mathjax/wiki/Home, which allows the use of Sphinx with MathJax. Assuming it works, we could upgrade all of Sage (not just the notebook but also the docs), to use MathJax instead of jsMath. |
Screenshot of double integral |
Attachment: mathjax-double-integral-20110322.png Attachment: mathjax-matrix-20110322.png Screenshot of matrix |
comment:14
Steps that will install
$SAGE_ROOT/devel/sagenb/sagenb/data and rename the new directory: to be just the directory:
This will install
Screenshots attached: Double Integral: http://wiki.math.toronto.edu/TorontoMathWiki/index.php/JsMath/MathJax_%28TeX_for_Web%29
Matrix:
|
comment:16
I'm attaching a draft of a patch for the Sage library. The integration with Sphinx is completely untested, and is probably broken. See the top of the patch file for a list of things to do. |
Attachment: trac_9774-mathjax-flask-notebook.patch.gz |
comment:17
Added patch to Flask notebook code to support
|
comment:18
John's patch doesn't apply cleanly to stock 4.7; does it apply to the most recent alpha of 4.7.1?
|
comment:19
Replying to @jasongrout:
Yes.
|
comment:20
Don't we need the actual MathJax spkg or files somewhere? Rob: do you have instructions for putting these in the directory, or do we use my half-finished patch mentioned in the description, or something else? |
comment:21
Attached a patch to add New file is similar to, but not identical to, We did not delete the latter, but I think it can safely go away. |
comment:22
Replying to @jasongrout:
We need an spkg to be Internet-independent. We did not experiment with your old one. I think it would be best to make a new one. This requires a small edit (once you are sure all works with CDN version). Font suggestions coming up. |
comment:23
Davide Cervone says for an spkg we need only keep font subdirectories called
In particular Rob |
comment:24
ah; I bet it's because the svg fonts replace the png fonts for all browsers we care about, or something. Okay, Davide is the final authority on what browsers support what... |
This comment has been minimized.
This comment has been minimized.
comment:109
The patch has fuzz against 5.3.beta2. |
comment:110
The fuzz is caused by #13310 which was merged in 5.3.beta1 and is harmless. |
comment:111
Fixed. |
Attachment: trac_9774-mathjax-try7.patch.gz apply to $SAGE_ROOT/devel/sage |
comment:112
What thing needs "review" here? |
comment:113
Uh... hmm. The rebasing, I guess? Whatever, looks fine to me ;) |
Merged: sage-5.4.beta0 |
comment:116
This document does not compile anymore with SageTeX
because someone has replaced a verbatim spacer with a version that does not work, as was explicitly explained in the surrounding comment, and then deleted the comment altogether: --- a/sage/misc/latex.py
+++ b/sage/misc/latex.py
@@ -323,11 +323,7 @@
# 2) wrap each line into \verb;
# 3) assemble lines into a left-justified array.
- # There is a bug in verb-space treatment in jsMath...
- spacer = "\\phantom{%s}"
- # \phantom{\verb!%s!} is more accurate and it works, but it is not a valid
- # LaTeX and may cause problems, so let's live with the above variant until
- # spaces are properly treated in jsMath/MathJax and we don't need to worry.
+ spacer = r"\phantom{\verb!%s!}"
lines = []
for line in x.split("\n"):
parts = [] What was the motivation for this??? |
comment:117
Do you by chance see who changed it? If it was me, I don't recall the motivation. So +1 to making sure things work. |
comment:118
It is in the jumbo patch to Sage library uploaded by Keshav, I guess it is a flattening of others. Most of it was automatic, I imagine, but this part is definitely made by hand. |
comment:119
Another reason why we shouldn't flatten patches... |
comment:120
#14382 finally reverts the change, sorry for delay. |
MathJax is the successor to jsMath.
apply:
Also install the new notebook from #13121
Depends on #13121
Upstream: Fixed upstream, but not in a stable release.
CC: @rbeezer @robert-marik @jhpalmieri @rkirov @kcrisman @kini
Component: notebook
Keywords: sd41
Author: Rob Beezer, Davide Cervone, John Palmieri, Jason Grout, Nathan Carter
Reviewer: Jason Grout, John Palmieri, Punarbasu Purkayastha, Keshav Kini
Merged: sage-5.4.beta0
Issue created by migration from https://trac.sagemath.org/ticket/9774
The text was updated successfully, but these errors were encountered: