-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix #553 New Feature: mhchem support #554
Conversation
@@ -459,11 +459,13 @@ math: | |||
mathjax: | |||
# Use 2.7.1 as default, jsdelivr as default CDN, works everywhere even in China | |||
cdn: //cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML | |||
# For newMathJax CDN (cdnjs.cloudflare.com) with fallback to oldMathJax (cdn.mathjax.org). | |||
#cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this link – it's worked for now, i think no need to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
just make a redirect to https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js
, and you can see console.warn('WARNING: cdn.mathjax.org has been retired. Check https://www.mathjax.org/cdn-shutting-down/ for migration tips.')
in the script.
I suggest removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, remove it. Under your responsibility. =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=)
Also, need to add docs on site: https://theme-next.org/docs/third-party-services/math-equations/ |
OK, I'll add the docs for mathjax.mhchem and katex.copy_tex |
#cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML | ||
|
||
# See: https://mhchem.github.io/MathJax-mhchem/ | ||
#mhchem: //cdn.jsdelivr.net/npm/mathjax-mhchem@3 | ||
#mhchem: //cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this link not working. (403)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mathjax will request cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.3.0/mhchem.js
automatically, instead of cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.3.0
, it works fine
#cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML | ||
|
||
# See: https://mhchem.github.io/MathJax-mhchem/ | ||
#mhchem: //cdn.jsdelivr.net/npm/mathjax-mhchem@3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe this link wrong too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested it, mathjax will load //cdn.jsdelivr.net/npm/mathjax-mhchem@3.3.0/mhchem.js
, no problem here
TeX: {equationNumbers: { autoNumber: "AMS" }} | ||
TeX: { | ||
{% if theme.math.mathjax.mhchem %} | ||
extensions: ['[mhchem]/mhchem.js'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, i see. Maybe try to add in CDN's settings something like //cdn.jsdelivr.net/npm/mathjax-mhchem@3/mhchem.min.js
and stay here only extensions: ['[mhchem]']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, //cdn.jsdelivr.net/npm/mathjax-mhchem@3
is confusing... I'll fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that mathjax can't parse extensions: ['[mhchem]']
... The syntax follows https://mhchem.github.io/MathJax-mhchem/
is the correctly way
Maybe no need to change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mb because MathJax.Ajax.config.path
exists above.
Ok, don't stay it as is. Mb later we can optimize it. 🥇
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number(s): #553
What is the new behavior?
Description about this pull, in several words...
Removed invalid CDN due to https://www.mathjax.org/cdn-shutting-down/
How to use?
In NexT
_config.yml
:Does this PR introduce a breaking change?