-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Configure mathjax in sphinx config and upgrade to Mathjax v3 #33600
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:2
This seems to do the job for me. With the disclaimer that I could only test the tutorial and dev guide, since "reference" fails with a lot of errors on gitpod. Among them
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
See #30296 and references within for previous efforts / discussion regarding mathjax 3 |
comment:5
Thanks for the pointer. It seems the issues discussed in that ticket revolve around packaging problems. I circumvent these here by using the CDN. |
comment:6
I would expect that people want to keep an offline version without using the CDN. |
comment:7
Replying to @tobiasdiez:
One of the "references within" is #25833 for the upgrade to 3.x. |
comment:8
Replying to @mkoeppe:
That feature (not compatible with latex) of mathjax2 would be relevant only in online use of mathjax, such as in jupyter notebook. As far as I know, that "automatic line breaking" is not used in our documentation. If there is any, then that is something to be fixed. For us, there is no reason not to upgrade to mathjax3. |
comment:9
Sage cell has moved to mathjax3 (relatively) long time ago. It may be worth while to check the mathjax3 configuration used in sage cell: |
comment:10
You converted single quotes to double quotes. Single quotes are conventionally used for strings containing code (not plain English). You should not change them without compelling reasons. |
comment:11
Replying to @kwankyu:
Thanks for the clarification! |
comment:12
Replying to @kwankyu:
I wasn't aware that such a styleguide rule exists. The existing code in both files doesn't seem to follow it either - it's just a random mix of single and double quotes. I tried to make at least the lines homogeneous that I've touched. |
comment:13
Replying to @tobiasdiez:
I must say it's not a rule. But single quotes are commonly used for code strings.
Leaving single-quoted strings as they are will contribute overall homogeneity of the sage code base. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Replying to @kwankyu:
Sadly there is not much of a homogeneity. For example, latex-macros.py contains args = "("
for x in sample_args:
count += 1
args += str(x) + ','
args += ')' Anyway, I've reverted these changes. |
comment:16
Replying to @tobiasdiez:
Well.. that is embarrassing.
Thank you. |
comment:42
I think that offline sage documentation should be the default as it has been. So I renamed the config variable to |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:44
To build doc with mathjax cdn, we only need diff --git a/src/doc/Makefile b/src/doc/Makefile
index 90bea5dfac..82134ea3b4 100644
--- a/src/doc/Makefile
+++ b/src/doc/Makefile
@@ -21,7 +21,7 @@ doc-inventory--%:
# Matches doc-html--developer, doc-html--reference-manifolds etc.
doc-html--%:
- cd $(SAGE_ROOT) && ./sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-html--,,$@)) html $(SAGE_DOCBUILD_OPTS)
+ cd $(SAGE_ROOT) && ./sage --docbuild --use-cdns --no-pdf-links $(subst -,/,$(subst doc-html--,,$@)) html $(SAGE_DOCBUILD_OPTS)
# reference manual, inventory
ifndef SAGE_ROOT So |
comment:45
Any reason |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:47
Replying to @antonio-rojas:
No. You are right. Thanks. |
comment:49
Should we merge this ticket with #25833, since you replace the mathjax 2 package there, so one probably should upgrade the config in one go as well. What do you think? |
comment:50
Replying to @kwankyu:
I'm not sure what should be the default for developers (but I guess everyone has internet if they contribute to trac...so I guess cdn would make sense), but the server should use the cdn to increase the speed or not? Comparing the loading times from the cdn vs sage's server, the cdn is a factor 10 quicker (13 ms vs 140ms). |
comment:51
Replying to @tobiasdiez:
I agree. Let's do it. I will upload the branch of this ticket to #25833. |
comment:52
Replying to @tobiasdiez:
The default is aimed at sage users with lowest resources. I think we need to provide |
comment:54
Replying to @kwankyu:
No. We already have
before |
Changed author from Tobias Diez, Kwankyu Lee to none |
Reviewer: Kwankyu Lee |
comment:56
Replying to @tobiasdiez: https://doc.sagemath.org/html/en/developer/trac.html#reviewing-and-closing-tickets Okay. Let's close this. |
Configure mathjax in sphinx config, and not in a javascript file. In this way, we can get ride of the custom theme option
mathjax_macros
, which is not understood by other themes. This is preparation to support the furo theme, see #33601.We also upgrade Mathjax to v3. The configs were migrated using
https://mathjax.github.io/MathJax-demos-web/convert-configuration/convert-configuration.html
with the following manual changes:
Refs #25833
Depends on #25833
CC: @kwankyu @strogdon @haraldschilly @mkoeppe
Component: documentation
Branch/Commit: public/docs/mathjax_ext @
89ec417
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/33600
The text was updated successfully, but these errors were encountered: