Sage: Ticket #13143: Use MathJax by default when building docs from Makefile
https://trac.sagemath.org/ticket/13143
<p>
At the moment, running <code>make</code> runs <code>make doc</code>, which in turn runs <code>make doc-html</code>. This runs Sphinx without the <code>-j</code> option, so MathJax (or jsMath, pre <a class="closed ticket" href="https://trac.sagemath.org/ticket/9774" title="enhancement: Use MathJax instead of jsMath (closed: fixed)">#9774</a>) is not used: png image files are used instead. Using png images is much slower, so we should use MathJax (or jsMath) by default.
</p>
<p>
Timing and disk space information:
</p>
<p>
Tutorial without MathJax:
</p>
<pre class="wiki">$ rm -rf devel/sage/doc/output
$ time sage --docbuild tutorial html
...
real 2m17.950s
user 1m29.441s
sys 0m15.478s
$ du -s -h devel/sage/doc/output
3.9M output/
</pre><p>
With MathJax:
</p>
<pre class="wiki">$ rm -rf devel/sage/doc/output
$ time sage --docbuild tutorial html -j
...
real 0m9.871s
user 0m6.530s
sys 0m1.739s
$ du -s -h devel/sage/doc/output
8.5M output/
</pre><p>
When building all of the documentation, the disk space actually drops, going from about 320M (without MathJax) to about 295M (with).
</p>
<hr />
<ul><li>Apply <a class="attachment" href="https://trac.sagemath.org/attachment/ticket/13143/trac_13143-root.v2.patch" title="Attachment 'trac_13143-root.v2.patch' in Ticket #13143">trac_13143-root.v2.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/13143/trac_13143-root.v2.patch" title="Download"></a> to the root repo.
</li><li>Apply <a class="attachment" href="https://trac.sagemath.org/attachment/ticket/13143/trac_13143-sage.v2.patch" title="Attachment 'trac_13143-sage.v2.patch' in Ticket #13143">trac_13143-sage.v2.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/13143/trac_13143-sage.v2.patch" title="Download"></a> and <a class="attachment" href="https://trac.sagemath.org/attachment/ticket/13143/trac_13143-pictures.patch" title="Attachment 'trac_13143-pictures.patch' in Ticket #13143">trac_13143-pictures.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/13143/trac_13143-pictures.patch" title="Download"></a> to the Sage library.
</li></ul><p>
This change was discussed <a class="ext-link" href="https://groups.google.com/d/topic/sage-devel/eHPVwaaqWSA/discussion"><span class="icon"></span>on sage-devel</a>.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/13143
Trac 1.1.6jhpalmieriWed, 20 Jun 2012 18:27:41 GMTattachment set
https://trac.sagemath.org/ticket/13143
https://trac.sagemath.org/ticket/13143
<ul>
<li><strong>attachment</strong>
set to <em>trac_13143-use-mathjax.patch</em>
</li>
</ul>
<p>
root repo
</p>
TicketjhpalmieriWed, 20 Jun 2012 18:28:05 GMTstatus changed
https://trac.sagemath.org/ticket/13143#comment:1
https://trac.sagemath.org/ticket/13143#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
</ul>
TicketjhpalmieriWed, 20 Jun 2012 18:28:32 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:2
https://trac.sagemath.org/ticket/13143#comment:2
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=2">diff</a>)
</li>
</ul>
TicketjhpalmieriWed, 20 Jun 2012 20:59:13 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:3
https://trac.sagemath.org/ticket/13143#comment:3
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=3">diff</a>)
</li>
</ul>
TicketkcrismanThu, 05 Jul 2012 16:39:14 GMT
https://trac.sagemath.org/ticket/13143#comment:4
https://trac.sagemath.org/ticket/13143#comment:4
<p>
Here's a question. I've noticed that sometimes looking at MathJax stuff when I'm not on the internet is less than great. What is the story then?
</p>
<p>
But this certainly looks right.
</p>
<p>
Maybe something should then also be added to the developer or installation guide (wherever the make options are documented other than in the Makefile) that points out how <em>not</em> to use MathJax in a build. Like to do <code>make build doc-html</code> or whatever the correct syntax would be.
</p>
TicketjhpalmieriMon, 09 Jul 2012 20:21:10 GMTdescription changed; cc set
https://trac.sagemath.org/ticket/13143#comment:5
https://trac.sagemath.org/ticket/13143#comment:5
<ul>
<li><strong>cc</strong>
<em>nthiery</em> added
</li>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=5">diff</a>)
</li>
</ul>
TicketjhpalmieriMon, 09 Jul 2012 22:19:02 GMT
https://trac.sagemath.org/ticket/13143#comment:6
https://trac.sagemath.org/ticket/13143#comment:6
<p>
The "v2" patches do the following:
</p>
<ul><li>turn MathJax on by default, by modifying the script sage-env and by modifying how the variable's value is checked in the doc building files
</li><li>pass the "no-pdf-links" option only when building the website document, so its presence (or lack) on the command-line doesn't cause the reference manual to be rebuilt.
</li></ul>
TicketjhpalmieriTue, 10 Jul 2012 03:41:47 GMT
https://trac.sagemath.org/ticket/13143#comment:7
https://trac.sagemath.org/ticket/13143#comment:7
<p>
In response to Karl-Dieter's comment, I've added some documentation, to the "environment variables" section of the installation guide.
</p>
TicketkcrismanTue, 10 Jul 2012 03:49:10 GMT
https://trac.sagemath.org/ticket/13143#comment:8
https://trac.sagemath.org/ticket/13143#comment:8
<p>
Ok, this is more minimalist than I would like (i.e., have all the make targets documented somewhere) but I think it's appropriate for this ticket. I'm sorry that I don't have time to give this full review, though again it seems ok.
</p>
TicketjhpalmieriTue, 10 Jul 2012 04:50:47 GMT
https://trac.sagemath.org/ticket/13143#comment:9
https://trac.sagemath.org/ticket/13143#comment:9
<p>
See <a class="closed ticket" href="https://trac.sagemath.org/ticket/13219" title="enhancement: Document 'make' targets (closed: fixed)">#13219</a> for documentation of the make targets.
</p>
TicketjhpalmieriTue, 10 Jul 2012 04:52:53 GMTdependencies changed
https://trac.sagemath.org/ticket/13143#comment:10
https://trac.sagemath.org/ticket/13143#comment:10
<ul>
<li><strong>dependencies</strong>
changed from <em>#9774</em> to <em>#9774, #13121</em>
</li>
</ul>
TicketjhpalmieriTue, 10 Jul 2012 12:45:04 GMTkeywords changed
https://trac.sagemath.org/ticket/13143#comment:11
https://trac.sagemath.org/ticket/13143#comment:11
<ul>
<li><strong>keywords</strong>
<em>sd40</em> added
</li>
</ul>
TicketdrkirkbyTue, 24 Jul 2012 20:33:59 GMT
https://trac.sagemath.org/ticket/13143#comment:12
https://trac.sagemath.org/ticket/13143#comment:12
<p>
I had a problem with Latex creating thousands of errors on CentOS 4.7 (an old version of Linux, which I need to run for some commercial software). See discussion at:
</p>
<p>
<a class="ext-link" href="http://groups.google.com/forum/?fromgroups#!topic/sage-devel/7erAQRbHYUU"><span class="icon"></span>http://groups.google.com/forum/?fromgroups#!topic/sage-devel/7erAQRbHYUU</a>
</p>
<p>
At John Palmieri's suggestion, I run:
</p>
<pre class="wiki">$ rm -rf SAGE_ROOT/devel/sage/doc/output
$ sage --docbuild all html -j
</pre><p>
and the documentation built OK, with no errors.
</p>
<p>
Dave
</p>
TicketjhpalmieriTue, 11 Sep 2012 21:58:45 GMTdependencies changed
https://trac.sagemath.org/ticket/13143#comment:13
https://trac.sagemath.org/ticket/13143#comment:13
<ul>
<li><strong>dependencies</strong>
changed from <em>#9774, #13121</em> to <em>#9774, #13121, #6495</em>
</li>
</ul>
TicketjhpalmieriTue, 11 Sep 2012 22:03:26 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:14
https://trac.sagemath.org/ticket/13143#comment:14
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=14">diff</a>)
</li>
</ul>
TicketjhpalmieriMon, 01 Oct 2012 15:46:40 GMTdependencies, description changed
https://trac.sagemath.org/ticket/13143#comment:15
https://trac.sagemath.org/ticket/13143#comment:15
<ul>
<li><strong>dependencies</strong>
changed from <em>#9774, #13121, #6495</em> to <em>#9774, #13121</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=15">diff</a>)
</li>
</ul>
TicketjhpalmieriMon, 01 Oct 2012 18:48:11 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:16
https://trac.sagemath.org/ticket/13143#comment:16
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=16">diff</a>)
</li>
</ul>
TicketjhpalmieriMon, 01 Oct 2012 20:35:28 GMTattachment set
https://trac.sagemath.org/ticket/13143
https://trac.sagemath.org/ticket/13143
<ul>
<li><strong>attachment</strong>
set to <em>trac_13143-root.v2.patch</em>
</li>
</ul>
<p>
root repo
</p>
TicketjhpalmieriMon, 01 Oct 2012 20:35:42 GMTattachment set
https://trac.sagemath.org/ticket/13143
https://trac.sagemath.org/ticket/13143
<ul>
<li><strong>attachment</strong>
set to <em>trac_13143-sage.v2.patch</em>
</li>
</ul>
<p>
Sage library
</p>
TickethivertThu, 04 Oct 2012 12:01:29 GMT
https://trac.sagemath.org/ticket/13143#comment:17
https://trac.sagemath.org/ticket/13143#comment:17
<p>
Hi John,
</p>
<p>
As a prerequisite of <a class="closed ticket" href="https://trac.sagemath.org/ticket/6495" title="enhancement: Build the reference manual incrementally (closed: fixed)">#6495</a> I'm starting to review this one.
</p>
<p>
Florent
</p>
TicketjhpalmieriThu, 04 Oct 2012 14:14:49 GMT
https://trac.sagemath.org/ticket/13143#comment:18
https://trac.sagemath.org/ticket/13143#comment:18
<p>
Hi Florent,
</p>
<p>
Great. Please let me know if you have any questions or comments.
</p>
<blockquote>
<p>
John
</p>
</blockquote>
TickethivertFri, 05 Oct 2012 15:35:35 GMT
https://trac.sagemath.org/ticket/13143#comment:19
https://trac.sagemath.org/ticket/13143#comment:19
<blockquote>
<p>
Hi John,
</p>
</blockquote>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:18" title="Comment 18">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
Great. Please let me know if you have any questions or comments.
</p>
</blockquote>
<p>
I'm running into some problems. Here are what I did: on a fresh 5.4.rc0, I
made a clone and imported the two <code>v2</code> patches. Then I removed the
<code>doc/output</code> directory and issued a
</p>
<pre class="wiki">sage -docbuild reference html
</pre><p>
After that some pages are perfectly Ok but for some other (I can't find a
pattern) there is a line in the bottom saying
</p>
<pre class="wiki">Loading [MathJax]/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
And after somehow ten seconds the text changes to
</p>
<pre class="wiki">File failed to load: file:///home/data/Sage-Install/sage-5.4.rc0/devel/sage-doc/doc/output/html/en/reference/_static/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
Indeed the file doesn't exists on my filesystem. By the way, I'm using
Firefox 15.0 on openSuSE 12.1 64 bits.
</p>
<p>
Am I missing something trivial ?
</p>
<p>
Cheers,
</p>
<p>
Florent
</p>
TickethivertFri, 05 Oct 2012 15:37:31 GMT
https://trac.sagemath.org/ticket/13143#comment:20
https://trac.sagemath.org/ticket/13143#comment:20
<p>
Sorry for the two answers.
</p>
<blockquote class="citation">
<p>
And after somehow ten seconds the text changes to
</p>
<pre class="wiki">File failed to load: file:///home/data/Sage-Install/sage-5.4.rc0/devel/sage-doc/doc/output/html/en/reference/_static/fonts/HTML-CSS/TeX/png/imagedata.js
</pre></blockquote>
<p>
You probably guessed it but after that the maths are replaced by a red
<code>[Math Processing Error]</code>.
</p>
<p>
Cheers,
</p>
<p>
Florent
</p>
TicketjhpalmieriFri, 05 Oct 2012 18:18:56 GMT
https://trac.sagemath.org/ticket/13143#comment:21
https://trac.sagemath.org/ticket/13143#comment:21
<p>
Hi Florent,
</p>
<p>
I have no idea. I tried on my machine (OS X). I browsed through 10-20 pages of the reference manual and saw no problems. Does this depend on this ticket? If you don't apply the patches and run
</p>
<pre class="wiki">sage -docbuild reference html -j
</pre><p>
do you see the same problem?
</p>
<pre class="wiki">File failed to load: file:///home/data/Sage-Install/sage-5.4.rc0/devel/sage-doc/doc/output/html/en/reference/_static/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
I don't even see a "png" directory. I see "eot", "otf", and "svg" directories.
</p>
TickethivertSat, 06 Oct 2012 08:07:49 GMT
https://trac.sagemath.org/ticket/13143#comment:22
https://trac.sagemath.org/ticket/13143#comment:22
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:21" title="Comment 21">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
Hi Florent,
</p>
<p>
I have no idea. I tried on my machine (OS X). I browsed through 10-20 pages of the reference manual and saw no problems. Does this depend on this ticket? If you don't apply the patches and run
</p>
<pre class="wiki">sage -docbuild reference html -j
</pre><p>
do you see the same problem?
</p>
</blockquote>
<p>
Running... I can't wait having <a class="closed ticket" href="https://trac.sagemath.org/ticket/6495" title="enhancement: Build the reference manual incrementally (closed: fixed)">#6495</a> ;-)
</p>
<blockquote class="citation">
<pre class="wiki">File failed to load: file:///home/data/Sage-Install/sage-5.4.rc0/devel/sage-doc/doc/output/html/en/reference/_static/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
I don't even see a "png" directory. I see "eot", "otf", and "svg" directories.
</p>
</blockquote>
<p>
Sorry I wasn't precise enough. The same holds for me.
</p>
TickethivertSat, 06 Oct 2012 10:33:05 GMT
https://trac.sagemath.org/ticket/13143#comment:23
https://trac.sagemath.org/ticket/13143#comment:23
<p>
Apparently it has nothing to do with the patch... I'm trying with sage-5.3...
</p>
<p>
Florent
</p>
TickethivertSun, 07 Oct 2012 14:56:17 GMT
https://trac.sagemath.org/ticket/13143#comment:24
https://trac.sagemath.org/ticket/13143#comment:24
<p>
So the problem has nothing to do with the patch here. <a class="missing wiki">MathJax?</a> math seems to be Ok on my laptop with sage 5.3 but are both broken with sage 5.4.rc0 and 5.4.rc1. More precisely I just did the following:
</p>
<ul><li>Build from sources a fresh 5.4.rc1
</li><li>removed <code>devel/sage-main/doc/output/html/en/reference</code>
</li><li>issued <code>./sage -docbuild reference html --mathjax</code>
</li></ul><p>
then the file <code>index.html</code> displayed correctly in firefox but <code>devel/sage-main/doc/output/html/en/reference/sage/modular/modsym/p1list.html</code> was broken. The error message is the same as before. Any idea ? May this be related to <a class="closed ticket" href="https://trac.sagemath.org/ticket/9774" title="enhancement: Use MathJax instead of jsMath (closed: fixed)">#9774</a> ?
</p>
<p>
Florent
</p>
TickethivertSun, 07 Oct 2012 19:47:08 GMT
https://trac.sagemath.org/ticket/13143#comment:25
https://trac.sagemath.org/ticket/13143#comment:25
<p>
There is also a problem with compiling the doc with <code>MathJax</code>. Some pages use advanced LateX stuff such as pictures. Unfortunately they doesn't work with <code>MathJax</code> activated. See eg:
</p>
<pre class="wiki">sage/graphs/base/static_sparse_graph.pyx
</pre><p>
Cheers,
</p>
<p>
Florent
</p>
TicketjhpalmieriMon, 08 Oct 2012 05:46:00 GMT
https://trac.sagemath.org/ticket/13143#comment:26
https://trac.sagemath.org/ticket/13143#comment:26
<p>
Ideally, this would be dealt with by Sphinx (and I'm glad you wrote to sphinx-devel about it). But the documentation should be written so that it looks good with or without MathJax (or jsMath, in older versions of Sage). The <code>picture</code> mode LaTeX code isn't processed correctly with these: it only works with the pngmath Sphinx extension. (I checked some older versions of Sage, and it didn't work with jsMath either.) So I think the documentation should be changed: for pictures like these, someone should just produce some pngs and then include them, as is done in several other places in the docs. Indeed, that documentation should never have been allowed in Sage in the first place, since it didn't build using Sphinx's jsMath extension.
</p>
<p>
I've been playing around with Sphinx, trying to see if there is a way to turn extensions like pngmath on or off using a function <code>process_mathjax</code> called like
</p>
<pre class="wiki"> app.connect('autodoc-process-docstring', process_mathjax)
</pre><p>
in the <code>setup</code> function at the end of devel/sage/doc/common/conf.py, but I haven't gotten anywhere yet.
</p>
TicketjhpalmieriMon, 08 Oct 2012 20:26:32 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:27
https://trac.sagemath.org/ticket/13143#comment:27
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=27">diff</a>)
</li>
</ul>
<p>
Here is a patch which replaces several picture environments with pngs. I tried searching the Sage library for possible problems, but I don't know exactly what MathJax cannot handle, so I searched for files containing both ".. math" and "begin{". These were the only instances I found which didn't render correctly with MathJax. I'm afraid it would be almost impossible to search the whole reference manual to look for other problems, since I think they only appear upon rendering in the web browser.
</p>
TicketjhpalmieriMon, 08 Oct 2012 20:39:21 GMT
https://trac.sagemath.org/ticket/13143#comment:28
https://trac.sagemath.org/ticket/13143#comment:28
<p>
If this approach (pngs instead of picture environments) looks okay, I'll rebase <a class="closed ticket" href="https://trac.sagemath.org/ticket/6495" title="enhancement: Build the reference manual incrementally (closed: fixed)">#6495</a> on top of it.
</p>
TicketjhpalmieriTue, 09 Oct 2012 16:06:10 GMT
https://trac.sagemath.org/ticket/13143#comment:29
https://trac.sagemath.org/ticket/13143#comment:29
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:19" title="Comment 19">hivert</a>:
</p>
<blockquote class="citation">
<blockquote>
<p>
Hi John,
</p>
</blockquote>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:18" title="Comment 18">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
Great. Please let me know if you have any questions or comments.
</p>
</blockquote>
<p>
I'm running into some problems. Here are what I did: on a fresh 5.4.rc0, I
made a clone and imported the two <code>v2</code> patches. Then I removed the
<code>doc/output</code> directory and issued a
</p>
<pre class="wiki">sage -docbuild reference html
</pre><p>
After that some pages are perfectly Ok but for some other (I can't find a
pattern) there is a line in the bottom saying
</p>
<pre class="wiki">Loading [MathJax]/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
And after somehow ten seconds the text changes to
</p>
<pre class="wiki">File failed to load: file:///home/data/Sage-Install/sage-5.4.rc0/devel/sage-doc/doc/output/html/en/reference/_static/fonts/HTML-CSS/TeX/png/imagedata.js
</pre><p>
Indeed the file doesn't exists on my filesystem. By the way, I'm using
Firefox 15.0 on openSuSE 12.1 64 bits.
</p>
</blockquote>
<p>
I still don't know what's going on with this. On several systems (OS X and sage.math.washington.edu), I don't see this. A few weeks ago, I made a version of the documentation using MathJax and <a class="closed ticket" href="https://trac.sagemath.org/ticket/6495" title="enhancement: Build the reference manual incrementally (closed: fixed)">#6495</a>: <a class="ext-link" href="http://sage.math.washington.edu/home/palmieri/misc/6495-jsmath/html/en/index.html"><span class="icon"></span>http://sage.math.washington.edu/home/palmieri/misc/6495-jsmath/html/en/index.html</a>. I skimmed through some pages, and don't see any of these problems. Do you have any ideas what could be causing it? I can't imagine why it would make a difference, but did you run <code>sage -b</code> in addition to removing <code>doc/output</code>? Is it repeatable, and are the web pages on which the problems occur repeatable?
</p>
TicketjhpalmieriTue, 09 Oct 2012 22:56:44 GMT
https://trac.sagemath.org/ticket/13143#comment:30
https://trac.sagemath.org/ticket/13143#comment:30
<p>
As far as other possibly incompatible pieces of LaTeX in the Sage library, I haven't found any. I ran
</p>
<pre class="wiki">sage: search_src('\\\\[a-zA-Z]', interact=False)
</pre><p>
to get a list of all strings starting with a backslash and then a letter, then turned this into a list of all of the potential LaTeX commands used in Sage, and compared it to <a class="ext-link" href="http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands"><span class="icon"></span>MathJax's list</a>. For items on Sage's list that aren't recognized by MathJax, I looked at how they were used in the Sage library. This wasn't a very long list, and I admit that I wasn't extremely careful, but I didn't find any problems.
</p>
TicketjhpalmieriThu, 18 Oct 2012 20:31:10 GMT
https://trac.sagemath.org/ticket/13143#comment:31
https://trac.sagemath.org/ticket/13143#comment:31
<p>
(I just fixed a typo in the commit message.)
</p>
TicketdimpaseSat, 27 Oct 2012 14:42:58 GMTstatus changed
https://trac.sagemath.org/ticket/13143#comment:32
https://trac.sagemath.org/ticket/13143#comment:32
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
</ul>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:30" title="Comment 30">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
As far as other possibly incompatible pieces of LaTeX in the Sage library, I haven't found any. I ran
</p>
<pre class="wiki">sage: search_src('\\\\[a-zA-Z]', interact=False)
</pre><p>
to get a list of all strings starting with a backslash and then a letter, then turned this into a list of all of the potential LaTeX commands used in Sage, and compared it to <a class="ext-link" href="http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands"><span class="icon"></span>MathJax's list</a>. For items on Sage's list that aren't recognized by MathJax, I looked at how they were used in the Sage library. This wasn't a very long list, and I admit that I wasn't extremely careful, but I didn't find any problems.
</p>
</blockquote>
<p>
Here is one thing I found: compare <a href="http://www.sagemath.org/doc/thematic_tutorials/numtheory_rsa.html">http://www.sagemath.org/doc/thematic_tutorials/numtheory_rsa.html</a> and
the corresponding page in your output, somewhere in the middle:<br />
</p>
<pre class="wiki">Formally, let
Σ={A,B,C,...,Z}
be the set of capital letters of the English alphabet. Furthermore, let
</pre><p>
On your pages (and also on my own build with this patch), the formula \Sigma={A,B,C,...,Z} is broken (viewed on OSX10.6.8, with Chrome or with Safari). Namely,
it looks like Σ={\textttA,\textttB,\textttC,...,\textttZ}, with \texttt typeset in red.
</p>
<p>
In the source I see
</p>
<pre class="wiki">.. MATH::
\Sigma
=
\{ \texttt{A}, \texttt{B}, \texttt{C}, \dots, \texttt{Z} \}
</pre><p>
which look like 100% kosher TeX to me.
</p>
<p>
Can you fix this in <code>MathJax</code> config?
</p>
TicketdimpaseSat, 27 Oct 2012 15:19:59 GMTstatus changed
https://trac.sagemath.org/ticket/13143#comment:33
https://trac.sagemath.org/ticket/13143#comment:33
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_info</em>
</li>
</ul>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:32" title="Comment 32">dimpase</a>:
</p>
<blockquote class="citation">
<p>
Can you fix this in <code>MathJax</code> config?
</p>
</blockquote>
<p>
This appears to be a mathjax bug, of sorts, according to <a class="ext-link" href="http://www.mail-archive.com/wikibugs-l@lists.wikimedia.org/msg134519.html"><span class="icon"></span>google</a>.
If I put the following into <code>Macro:</code> section of <code>mathjax_sage.js</code> in <code>output/html/en/thematic_tutorials/_static/</code> then it displays just right (<code>textfs</code> and <code>emph</code> are added just for good measure, as they suffer the same fate, apparently).
</p>
<pre class="wiki">texttt: ['\\mathord{\\tt{\\text{#1}}}',1],
textsf: ['\\mathord{\\sf{\\text{#1}}}',1],
emph: ['\\textit{#1}',1]
</pre><p>
apparently this should be added to the appropriate <code>mathjax_sage.js_t</code> file, although how to rebuild the docs to take care of this change this way, I don't know. If someone tells me this, I could come up with a patch.
</p>
TicketjhpalmieriSat, 27 Oct 2012 15:22:50 GMT
https://trac.sagemath.org/ticket/13143#comment:34
https://trac.sagemath.org/ticket/13143#comment:34
<p>
<code>\texttt</code> is supposed to be used in text mode, not math mode, so whether it's a MathJax bug, we should replace it with <code>\mathtt</code>. That fixes the problem for me. I'll add this patch in a few minutes. I also don't know what version of MathJax we have; at some point we should probably upgrade.
</p>
TicketjhpalmieriSat, 27 Oct 2012 15:32:32 GMTstatus changed
https://trac.sagemath.org/ticket/13143#comment:35
https://trac.sagemath.org/ticket/13143#comment:35
<ul>
<li><strong>status</strong>
changed from <em>needs_info</em> to <em>needs_review</em>
</li>
</ul>
<p>
In fact, I think that MathJax is only designed to handle math mode, so we shouldn't expect <code>\texttt</code> or <code>\textsf</code> to work, or <code>\emph</code> in text mode. (Sphinx won't even call MathJax on text not between single backquotes, i.e., on non-math.) Using <code>\emph</code> in math mode is not very common, so I suggest not worrying about it.
</p>
TicketjhpalmieriSat, 27 Oct 2012 15:42:14 GMT
https://trac.sagemath.org/ticket/13143#comment:36
https://trac.sagemath.org/ticket/13143#comment:36
<p>
Note that <code>\texttt</code> appears in two more places in the Sage library, but not in the documentation: in combinat/posets/linear_extension.py and in modules/vector_space_morphism.py. In the first of these, it should be replace by <code>\mathtt</code>, and in the second, probably by <code>\text</code>. These changes are not related to this ticket, but we can add them on anyway...
</p>
TicketdimpaseSat, 27 Oct 2012 15:50:40 GMT
https://trac.sagemath.org/ticket/13143#comment:37
https://trac.sagemath.org/ticket/13143#comment:37
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:36" title="Comment 36">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
Note that <code>\texttt</code> appears in two more places in the Sage library, but not in the documentation: in combinat/posets/linear_extension.py and in modules/vector_space_morphism.py. In the first of these, it should be replace by <code>\mathtt</code>, and in the second, probably by <code>\text</code>. These changes are not related to this ticket, but we can add them on anyway...
</p>
</blockquote>
<p>
Right, let's do this, and hopefully be done with! Indeed, I didn't think straight about <code>\texttt{</code>}.
</p>
TicketjhpalmieriSat, 27 Oct 2012 15:51:33 GMTattachment set
https://trac.sagemath.org/ticket/13143
https://trac.sagemath.org/ticket/13143
<ul>
<li><strong>attachment</strong>
set to <em>trac_13143-optional.patch</em>
</li>
</ul>
<p>
optional patch, independent of the others
</p>
TicketjhpalmieriSat, 27 Oct 2012 15:54:37 GMT
https://trac.sagemath.org/ticket/13143#comment:38
https://trac.sagemath.org/ticket/13143#comment:38
<p>
If you think we should apply the "optional" patch, please add it to the ticket description (under the list of patches to be applied).
</p>
TicketdimpaseSat, 27 Oct 2012 16:29:11 GMT
https://trac.sagemath.org/ticket/13143#comment:39
https://trac.sagemath.org/ticket/13143#comment:39
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/13143#comment:38" title="Comment 38">jhpalmieri</a>:
</p>
<blockquote class="citation">
<p>
If you think we should apply the "optional" patch, please add it to the ticket description (under the list of patches to be applied).
</p>
</blockquote>
<p>
In both cases it's inside the docs for _latex function, which do not appear in the HTML documentation at all, for some reason.
I guess sphynx skips stuff beginning from _. I don't know whether it's a bug or a feature.
</p>
TicketdimpaseSat, 27 Oct 2012 17:01:13 GMTstatus changed
https://trac.sagemath.org/ticket/13143#comment:40
https://trac.sagemath.org/ticket/13143#comment:40
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
</ul>
TicketjdemeyerMon, 29 Oct 2012 21:28:35 GMTmilestone changed; reviewer set
https://trac.sagemath.org/ticket/13143#comment:41
https://trac.sagemath.org/ticket/13143#comment:41
<ul>
<li><strong>reviewer</strong>
set to <em>Dmitrii Pasechnik</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-5.4</em> to <em>sage-5.5</em>
</li>
</ul>
TicketjdemeyerThu, 01 Nov 2012 12:46:29 GMTattachment set
https://trac.sagemath.org/ticket/13143
https://trac.sagemath.org/ticket/13143
<ul>
<li><strong>attachment</strong>
set to <em>trac_13143-pictures.patch</em>
</li>
</ul>
<p>
Sage library
</p>
TicketjdemeyerThu, 01 Nov 2012 12:47:11 GMTstatus changed; resolution, merged set
https://trac.sagemath.org/ticket/13143#comment:42
https://trac.sagemath.org/ticket/13143#comment:42
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>merged</strong>
set to <em>sage-5.5.beta2</em>
</li>
</ul>
<p>
Rebased to sage-5.5.beta1.
</p>
TicketchapotonSun, 06 Sep 2015 17:27:02 GMTdescription changed
https://trac.sagemath.org/ticket/13143#comment:43
https://trac.sagemath.org/ticket/13143#comment:43
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/13143?action=diff&version=43">diff</a>)
</li>
</ul>
Ticket