-
Notifications
You must be signed in to change notification settings - Fork 661
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
MathJax version 3 support #963
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks, there is an open issue about the macros; #917, but yeh we can make it clearer in the docs, the reason why it is not the default yet 👍 |
Thanks @chrisjsewell Yeah, I think the issue has to be fixed upstream in Sphinx first, to be able to add the configuration correctly. I'm not sure how they'll be able to support arbitrary configuration, if the |
You can set |
No, the configuration settings are Following the conversion guide here: https://mathjax.github.io/MathJax-demos-web/convert-configuration/convert-configuration.html This generated configuration with current JB (using Sphinx 3 and MathJax v2):
with this config parameter:
The last line there is handled by the |
thanks for the info! |
You can see the link there, but I cross posted this at sphinx-doc/sphinx#8195, since this is really a problem with Sphinx. I suppose depending on how the fix is handled there, the configuration in JB might have to change slightly. |
thanks, I also need to keep track of this for myst-parser, where I am currently overriding some of the default behaviour of Really, the ideal behaviour for MathJax, would be to only render text in specific HTML elements, like <math-block id="mylabel">a=1</math-block>
<p> <math-inline>\gamma</math-inline> </p> rather than arbitrarily searching in the text for delimiters like I wonder if this is possible with MathJax/KaTex; natively or with some minor JS additions? |
Can you encoded the output as MathML? See http://danielscully.co.uk/projects/mathml-guide/index.php and the W3 page https://www.w3.org/Math/ MathJax can be configured to load/render only MathML elements, see http://docs.mathjax.org/en/latest/basic/mathematics.html#mathml-input and http://docs.mathjax.org/en/latest/web/components/combined.html#mml-chtml You can also control the TeX delimiters, see http://docs.mathjax.org/en/latest/input/tex/delimiters.html#tex-delimiters |
I don't know whether that's possible, but it's possible to limit the search for delimiters to certain HTML elements. In the pre-MathJax-3 era this was done with With MathJax 3, this should become something like the following (but I haven't tested this yet!): window.MathJax = {
options: {
ignoreHtmlClass: "document",
processHtmlClass: "math|output_area"
}
}; |
This issue is still waiting for a solution: sphinx-doc/sphinx#8195 Does anyone here have a good idea how to tackle this? |
I've created a PR at sphinx-doc/sphinx#9094, are there any further comments or suggestions? |
Yes I just noticed that thanks, will check it out 👍 |
We have been looking into |
@mmcky do you have any update on the situation with Mathjax 3? Have you found it to improve at all since last May? |
@choldgraf just enabled
|
@choldgraf did some testing today and we are finding there are still incorrect renderings of math using |
FYI, I've been using Sphinx 4.1.2 with Mathjax 3 and I've had no problems that I've noticed. The book is over here: https://orbital-mechanics.space |
thanks @bryanwweber -- nice book! (coming from an ex: aerospace engineer :-)) We get issues with missing |
Thanks @mmcky! |
Hello Upgrading to sphinx 4.x breaks TeX macros in _config.yml. The jupyterbook own documentation renders it broken, see https://jupyterbook.org/advanced/sphinx.html#defining-tex-macros where the "\bmat" macro is shown in red. I stumbled upon this commit (unrelated to jupyterbook) which resolves the issue: in _config.yml, change "TeX" and "Macro" to lowercase:
and it works fine. Maybe this can be included in the migration notes? Thanks |
Several years later, I assume this issue is resolved? I don't notice any problems in my book, so I'll close it. It can be reopened if necessary 😁 |
On the Math & Equations page, there is a note that MathJax 3 can be used by configuring the
mathjax_path
. However, if you have any other MathJax configuration (e.g., custom macros) these will not be converted to the new configuration format for MathJax 3. It seems that Sphinx does not yet support the new configuration format either; the pull request that switched Sphinx over to MathJax version 3 didn't address the configuration changes. See also: http://docs.mathjax.org/en/latest/web/configuration.html#converting-your-v2-configuration-to-v3I think one way to resolve this issue would be to modify the note in the Jupyter Books docs to say something about other configuration options not being suported at the moment.
The text was updated successfully, but these errors were encountered: