cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Using MathJax version 3 for documentation

Open albert-github opened this issue 4 years ago • 5 comments

Currently the documentation uses MathJax version 2 to render formulas. Since some time MathJax version 3 exists and in due time the MathJax version 2 will not be available anymore ("not likely to be until 2022", see: https://groups.google.com/g/mathjax-users/c/MKQ9TdVXSSo). Since a little while the doxygen master supports MathJax version3 (see https://github.com/doxygen/doxygen/issues/7346 and https://github.com/doxygen/doxygen/pull/8496).

The construct used to see which version of MathJax to be used (from CDN or local) is quite complex, so no pull request but some code that indicates the required changes: BaseDoxyfile version 2

USE_MATHJAX            = YES
MATHJAX_FORMAT         = HTML-CSS
MATHJAX_RELPATH        = https://cdn.jsdelivr.net/npm/mathjax@2/
MATHJAX_EXTENSIONS     = TeX/AMSmath TeX/AMSsymbols
MATHJAX_CODEFILE       = CGAL_mathjax.js

version 3

USE_MATHJAX            = YES
MATHJAX_VERSION        = MathJax_3
MATHJAX_FORMAT         = chtml
MATHJAX_RELPATH        = https://cdn.jsdelivr.net/npm/mathjax@3
MATHJAX_EXTENSIONS     = ams boldsymbol
MATHJAX_CODEFILE       = CGAL_mathjax_v3.js

where the line regarding MATHJAX_RELPATH the line is mentioned above about CDN / local.

Furthermore the MATHJAX_CODEFILE syntax has slightly changed so the new file should have the contents as in this attachment: CGAL_mathjax_v3.js.gz

albert-github avatar May 12 '21 13:05 albert-github

After a little discussion in the MathJax discussion forum (see https://groups.google.com/g/mathjax-users/c/oS0yQLb5BMk) a small change was necessary for the attachment in the original issue, it now is: CGAL_mathjax_v3.js.tar.gz. The fix also requires that the proposed doxygen pull request https://github.com/doxygen/doxygen/pull/8554 is integrated.

albert-github avatar May 15 '21 17:05 albert-github

The proposed pull request #5715 introduces 2 new macros (that were previously omitted), hence they have also to be added to the v3 version: CGAL_mathjax_v3_2.js.tar.gz

albert-github avatar May 16 '21 09:05 albert-github

@MaelRL This issue does not have a pull request, the mentioned pull request is for something different (but those changes have to be introduced in this issue as well, hence the second attachment). There is no pull request like I mentioned in the issue:

The construct used to see which version of MathJax to be used (from CDN or local) is quite complex, so no pull request but some code that indicates the required changes.

albert-github avatar May 28 '21 07:05 albert-github

@albert-github do you know if this is still an issue as of today or all is know fine and nothing needs to be done on our side for our upcoming release?

sloriot avatar May 27 '24 15:05 sloriot

As far as I can tell with the current code base (e90842fd05bbbec3148a45a2a8608f494c2ff075 ) there are no changes in respect to switching to MathJax V3 and there is also no PR yet for this. For the upcoming release I wouldn't do anything anymore regarding the MathJax version, though for a future release this can / should be an issue to be fixed.

I could create a PR for this but I think this should be done independent of the 6.0 release (I will have to dive into it again).

Note the label "Has Pull Request" should be removed like already indicated in https://github.com/CGAL/cgal/issues/5707#issuecomment-850211266

albert-github avatar May 27 '24 16:05 albert-github