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

formulas on glClipControl not rendering #104

Open
tycho opened this issue Aug 11, 2021 · 3 comments
Open

formulas on glClipControl not rendering #104

tycho opened this issue Aug 11, 2021 · 3 comments

Comments

@tycho
Copy link

tycho commented Aug 11, 2021

http://docs.gl/gl4/glClipControl

image

Presumably those should each render as a mathematical formula.

@tycho
Copy link
Author

tycho commented Aug 11, 2021

It looks like the glClipControl.xml file has tex commands instead of mathml blocks. I'm not sure where that file comes from (is there a way to fetch updated specifications in the docs.gl tree?)

The official reference pages seem to render properly:

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClipControl.xhtml

Perhaps it's just a mathjax config problem? I see that the official reference page has this in it:

    <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                MathML: {
                    extensions: ["content-mathml.js"]
                },
                tex2jax: {
                    inlineMath: [['$','$'], ['\\(','\\)']]
                }
            });
        </script>

@tycho
Copy link
Author

tycho commented Aug 11, 2021

OK, just did a test and this at least partially fixes that page:

diff --git a/compile.py b/compile.py
index 35b2f81..5a25079 100644
--- a/compile.py
+++ b/compile.py
@@ -58,8 +58,8 @@ while not os.path.exists(output_dir):
 JS_LIBS = [
   ('jquery', 'jquery.min.js', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/', None),
   ('jqueryui', 'jquery-ui.min.js', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/', None),
-  ('mathjax', 'MathJax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?config=MML_HTMLorMML'),
-  (None, 'config/MML_HTMLorMML.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
+  ('mathjax', 'MathJax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?config=TeX-AMS-MML_HTMLorMML'),
+  (None, 'config/TeX-AMS-MML_HTMLorMML.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
   (None, 'jax/output/HTML-CSS/jax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
   (None, 'jax/output/HTML-CSS/fonts/TeX/fontdata.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5')
 ]

Built and uploaded to here for demonstration:

https://gl.uplinklabs.net/gl4/glClipControl

EDIT: There's still some bits not rendering. Checking what else I missed.

@tycho
Copy link
Author

tycho commented Aug 11, 2021

Better patch, forgot to add the config I called out before 🤦

diff --git a/compile.py b/compile.py
index 35b2f81..5a25079 100644
--- a/compile.py
+++ b/compile.py
@@ -58,8 +58,8 @@ while not os.path.exists(output_dir):
 JS_LIBS = [
   ('jquery', 'jquery.min.js', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/', None),
   ('jqueryui', 'jquery-ui.min.js', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/', None),
-  ('mathjax', 'MathJax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?config=MML_HTMLorMML'),
-  (None, 'config/MML_HTMLorMML.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
+  ('mathjax', 'MathJax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?config=TeX-AMS-MML_HTMLorMML'),
+  (None, 'config/TeX-AMS-MML_HTMLorMML.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
   (None, 'jax/output/HTML-CSS/jax.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5'),
   (None, 'jax/output/HTML-CSS/fonts/TeX/fontdata.js', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/', '?V=2.7.5')
 ]
diff --git a/html/header.html b/html/header.html
index 90c0bd9..a1d9c57 100644
--- a/html/header.html
+++ b/html/header.html
@@ -12,6 +12,17 @@
   <link href="../jquery-bonsai/jquery.bonsai.css" rel="stylesheet" type="text/css" />
   <script src="../jquery-cookie/jquery.cookie.js"></script>

+  <script type="text/x-mathjax-config">
+         MathJax.Hub.Config({
+                               MathML: {
+                                       extensions: ["content-mathml.js"]
+                               },
+                               tex2jax: {
+                                       inlineMath: [['$','$'], ['\\(','\\)']]
+                               }
+                       });
+  </script>
+
   {$mathjax}

   <link href="../style.css" rel="stylesheet" type="text/css" />

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

No branches or pull requests

1 participant