Skip to content
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

Upgrade to MathJax 2.7.4 #25032

Closed
slel opened this issue Mar 25, 2018 · 26 comments
Closed

Upgrade to MathJax 2.7.4 #25032

slel opened this issue Mar 25, 2018 · 26 comments

Comments

@slel
Copy link
Member

slel commented Mar 25, 2018

Since #19875, Sage ships MathJax 2.6.1.

MathJax 2.7.4 was released 2018-04-03.

It brings accessibility improvements, among other things.

For a more exhaustive list of changes, see the changelogs for
MathJax 2.7,
MathJax 2.7.1,
MathJax 2.7.2,
MathJax 2.7.3,
MathJax 2.7.4.

Tarball: https://sites.math.washington.edu/~palmieri/Sage/mathjax-2.7.4.tar.gz

CC: @egourgoulhon @embray @kiwifb @jdemeyer @jhpalmieri @kcrisman @miguelmarco @novoselt @haraldschilly @slel @sagetrac-tmonteil @vbraun

Component: packages: standard

Keywords: mathjax

Author: John Palmieri

Branch/Commit: b7a8142

Reviewer: François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/25032

@slel slel added this to the sage-8.2 milestone Mar 25, 2018
@slel
Copy link
Member Author

slel commented Mar 25, 2018

comment:1

Cc potentially interested developers.

@slel
Copy link
Member Author

slel commented Mar 25, 2018

comment:2

On a related note,
open MathJax-related tickets
currently include:

@slel
Copy link
Member Author

slel commented Mar 25, 2018

comment:3

See also
other open tickets whose description mentions MathJax, currently:

@kiwifb
Copy link
Member

kiwifb commented Mar 25, 2018

comment:4

Currently in the html doc there is a lot of duplication of the _static folders (it seems like some subsections are now links to the top one but still lots of duplicates). Each of these duplicate carries what seems to be an almost full copy of mathjax including fonts. It would be good if we could avoid all that copying. In sage-on-gentoo where we do ship the png fonts with mathjax that's quite a lot of files and space.

@jhpalmieri
Copy link
Member

comment:5

I don't know if there is any way with Sphinx to automatically create these links, but we could do it ourselves in src/sage_setup/docbuild/__init__.py after building the documentation. That should be done independently from this ticket. See #25111.

@jhpalmieri

This comment has been minimized.

@jhpalmieri jhpalmieri changed the title Upgrade to MathJax 2.7.3 Upgrade to MathJax 2.7.4 May 23, 2018
@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

Branch: u/jhpalmieri/mathjax2.7.4

@jhpalmieri
Copy link
Member

New commits:

d17cbfdtrac 25032: update to MathJax 2.7.4

@jhpalmieri
Copy link
Member

Commit: d17cbfd

@jhpalmieri

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented May 23, 2018

comment:11

Just a question. I see there are two patches here that touch to some matter of configuration. I am wondering if instead of patching it could be moved to a local mathjax configuration inside the sage application itself.

@jhpalmieri
Copy link
Member

comment:12

Good question. I just kept the old method (modifying one patch so that it still worked), and I haven't looked into that. I may try to investigate, but others should also feel free to do that.

@jhpalmieri
Copy link
Member

comment:13

One of the patches comes from #18577, which unfortunately includes no explicit examples with which to test, so I have no idea if any changes to that patch will break things.

@jhpalmieri
Copy link
Member

comment:14

Theoretically, this might do the job:

diff --git a/build/pkgs/mathjax/patches/extend_maxbuffer.patch b/build/pkgs/mathjax/patches/extend_maxbuffer.patch
deleted file mode 100644
index 0f96a9a477..0000000000
--- a/build/pkgs/mathjax/patches/extend_maxbuffer.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/config/TeX-AMS_HTML-full.js.orig b/config/TeX-AMS_HTML-full.js
-index c98695d..209f71b 100755
---- a/config/TeX-AMS_HTML-full.js
-+++ b/config/TeX-AMS_HTML-full.js
-@@ -35,6 +35,14 @@ MathJax.Ajax.Preloading(
-   "[MathJax]/extensions/a11y/accessibility-menu.js"
- );
- 
-+//  This extends the limit on the size of the string being processed by MathJax
-+//  (whose aim is to avoid infinite loops) up to 50KB, see
-+//  http://docs.mathjax.org/en/latest/options/TeX.html#the-tex-input-processor
-+//
-+//  See trac ticket #18577.
-+//
-+MathJax.Hub.Config({TeX: {MAXBUFFER: 50*1024,},});
-+
- MathJax.Hub.Config({
-   extensions: ['[a11y]/accessibility-menu.js']
- });
diff --git a/build/pkgs/mathjax/patches/nopng_config.patch b/build/pkgs/mathjax/patches/nopng_config.patch
deleted file mode 100644
index eceec63062..0000000000
--- a/build/pkgs/mathjax/patches/nopng_config.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/config/default.js b/config/default.js
---- a/config/default.js
-+++ b/config/default.js
-@@ -693,7 +693,7 @@ MathJax.Hub.Config({
-     //  will be required to to download and install either the STIX fonts or the
-     //  MathJax TeX fonts.
-     //
--    imageFont: "TeX",
-+    imageFont: null,
-     
-     //
-     //  This is the font-family CSS value used for characters that are not
diff --git a/src/doc/common/themes/sage/static/mathjax_sage.js_t b/src/doc/common/themes/sage/static/mathjax_sage.js_t
index adafad53b3..b261f2265a 100644
--- a/src/doc/common/themes/sage/static/mathjax_sage.js_t
+++ b/src/doc/common/themes/sage/static/mathjax_sage.js_t
@@ -10,6 +10,8 @@ MathJax.Hub.Config({
     }
   },
   TeX: {
+    MAXBUFFER: 50*1024,
+
     Macros: {
      {{ theme_mathjax_macros|join(',\n') }}
     }

Regarding the patch which changes imageFont, imageFont is already set in mathjax_sage.js_t, and I hope that's good enough.

@kiwifb
Copy link
Member

kiwifb commented May 23, 2018

comment:15

I say we should try it like that. We shouldn't patch when we can configure.

@jhpalmieri
Copy link
Member

comment:16

With that experimental patch, everything builds and things seem to work: if I disable my internet connection, I can still build and view the documentation, and see LaTeX displayed in the Jupyter notebook. So I will push those changes here.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 23, 2018

Changed commit from d17cbfd to b7a8142

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 23, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

b7a8142trac 25032: remove patches, use config options instead

@fchapoton
Copy link
Contributor

comment:18

does somebody here have an idea for #22431 comment:36 ?

@kiwifb
Copy link
Member

kiwifb commented May 23, 2018

Reviewer: François Bissey

@kiwifb
Copy link
Member

kiwifb commented May 23, 2018

comment:19

Let's move this on.

@vbraun
Copy link
Member

vbraun commented May 24, 2018

comment:20

Author name...

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri
Copy link
Member

comment:22

Is there some trac plugin that will prevent a positive review unless the author name and reviewer name are present? I should know better, of course, but Volker shouldn't have to spend his time doing this.

@vbraun
Copy link
Member

vbraun commented May 27, 2018

Changed branch from u/jhpalmieri/mathjax2.7.4 to b7a8142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants