#9774: Upgrade the notebook to use MathJax instead of jsMath
---------------------------+------------------------------------------------
Reporter: mpatel | Owner: jason, was
Type: enhancement | Status: needs_work
Priority: major | Milestone:
Component: notebook | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
---------------------------+------------------------------------------------
Comment(by jhpalmieri):
By the way, one comment about the latest version of my patch: it fixes the
problem Rob mentioned about getting the appropriate invocation to !MathJax
in each piece of documentation. It does this by setting the variable
{{{mathjax_path}}} to
{{{
file://[path to MathJax.js]?config=TeX-AMS_HTML-full,file://[path to
mathjax_sage.js]
}}}
The paths here are absolute ones, in
{{{SAGE_ROOT/devel/sage/doc/output/html/en/_static/}}}. This directory is
created by {{{sage -docbuild website html}}}, so now if you build the docs
with the {{{-j}}} flag (to enable !MathJax), it first builds the website
target, then builds whatever you requested. There might be a better way
to do this, using relative paths, but I couldn't get it to work. For
example, using
{{{
<script type="text/javascript" src="_static/MathJax.js?config=TeX-
AMS_HTML-full"></script>
}}}
successfully turns on !MathJax, but without the local configuration
turning on the custom macros. Using
{{{
<script type="text/javascript" src="_static/MathJax.js?config=TeX-
AMS_HTML-full,mathjax_sage.js"></script>
}}}
doesn't work, nor does any variation of it that I tried. (Note that when
you change the path specifying the local configuration file, you also need
to change the last line of that configuration file to match it, according
to [http://www.mathjax.org/docs/1.1/configuration.html].) If we could
copy the file {{{mathjax_sage.js}}} to {{{_static/config/local/}}}, then
we could use
{{{
<script type="text/javascript" src="_static/MathJax.js?config=TeX-
AMS_HTML-full,local/mathjax_sage.js"></script>
}}}
for the invocation, and
{{{
MathJax.Ajax.loadComplete("[MathJax]/config/local/mathjax_sage.js")
}}}
for the last line in mathjax_sage.js. But I don't know how to put this
file in the right place: it's autogenerated, so we can't put it in the
!MathJax local directory ahead of time, and I can't figure out how to get
Sphinx to do it when it's building the documentation.
Another option would be to try to get Sphinx to write this into each html
file:
{{{
<script type="text/x-mathjax-config">
[contents of mathjax_sage.js]
</script>
<script type="text/javascript" src="_static/MathJax.js?config=TeX-
AMS_HTML-full"></script>
}}}
We can get the last line by specifing mathjax_path in conf.py, but I don't
know how to get the first part.
I'll keep working on it...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9774#comment:36>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.