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

Incompatibility with MathJax 3.0 #7346

Closed
drwells opened this issue Oct 21, 2019 · 7 comments
Closed

Incompatibility with MathJax 3.0 #7346

drwells opened this issue Oct 21, 2019 · 7 comments
Labels
enhancement a request to enhance doxygen, not a bug HTML HTML / XHTML output

Comments

@drwells
Copy link

drwells commented Oct 21, 2019

doxygen includes MathJax in the following way, from
https://github.com/doxygen/doxygen/blob/a1c6157bba48fe87c38428e75e9e3476e2f2faf1/templates/html/htmlbase.tpl:

</script>
<script type="text/javascript" src="{{ config.MATHJAX_RELPATH }}{% if config.MATHJAX_RELPATH|relative %}{{ page.relPath }}{% endif %}MathJax.js"></script>
{% endif %}{# MathJax #}

However, in MathJax 3.0 this file is no longer present: see
https://docs.mathjax.org/en/v3.0-latest/upgrading/v2.html#changes-in-loading-mathjax

so something else should be included instead.

@albert-github
Copy link
Collaborator

albert-github commented Oct 22, 2019

Interesting problem (and unfortunately expected), problem for doxygen is to keep the v2 and the v3 version working.
At the moment the file MathJax.js is loaded and in for v3.0 the file tex-chtml.js should be loaded.

I did some small tests and at first glance it looks like doxygen has no problem loading either file (from a local file or from a CDN).

So in principle one should do a test to see which one of the 2 files is present and load this file (problem is I don't know how to do this, yet, in javascript). @doxygen do you know how to do this.

A small test revealed that when trying to load both files from one place it looks like to work as well but in the "Firefox Inspector" I see a message like (depending on the version):

Loading failed for the <script> with source “file:///.../MathJax_2/tex-chtml.js”.

or

Loading failed for the <script> with source “file:///.../MathJax_3/MathJax.js”.

so to have this workaround it would be sufficient to duplicate the mentioned line in the htmlbase.tpl and change once the name to tex-chtml.js (and recreate doxygen).

For testing with a local version of MathJax a quick and dirty workaround is to copy the file tex-chtml.js to MathJax.js

@albert-github
Copy link
Collaborator

In the mean time I pushed 2 questions into the internet:

but sofar no satisfying answer (i.e. answer without warnings).

@heitorPB
Copy link

heitorPB commented Nov 8, 2019

I just tried:

MATHJAX_CODEFILE       = https://cdnjs.cloudflare.com/ajax/libs/mathjax@3/es5/tex-chtml.js

but it didn't work, doxygen complains that the file does not exists...

I think a solution would be to create a variable MATHJAX_JS_FILE with default value to MathJax.js and then we can change to tex-chtml.js without breaking much things.

@albert-github
Copy link
Collaborator

albert-github commented Nov 8, 2019

Unfortunately there were after 2 weeks no real solutions (i.e. getting rid of the warnings while attempting to load a file). On stackoverflow there were some comments on the mathjax forum there was no reaction at all.

The MATHJAX_CODEFILE does serve a different purpose (but was worth a try).

I don't think MATHJAX_JS_FILE is a good choice I'm more thinking about a MATHJAX_VERSION as this gives more flexibility as we also have to think about the startup code especially in respect to extra packages and this would probably be easier when we have the version variable . The extra packages are loaded in a different way and with different names in version 3.
At the moment I think it is sufficient to just look at the major MathJax version number.

albert-github added a commit to albert-github/doxygen that referenced this issue Apr 12, 2021
Implementing the possibility to use MathJax versie 3
- Added setting MATHJAX_VERSION
- made setting for MATHJAX_RELPATH so that is suited for version Mathjax version3, i.e. selecting right default
- made setting for MATHJAX_FORMAT so that is suited for version Mathjax version3, automatic conversion between MathJax 2 and MathJax3 format setting
@albert-github albert-github added enhancement a request to enhance doxygen, not a bug HTML HTML / XHTML output labels Apr 12, 2021
@albert-github
Copy link
Collaborator

I've just pushed a proposed patch, pull request #8496

doxygen added a commit that referenced this issue Apr 27, 2021
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Apr 28, 2021
@albert-github
Copy link
Collaborator

Code has been integrated in master on github (please don't close the issue as this will be done at the moment of an official release).

@doxygen
Copy link
Owner

doxygen commented Aug 18, 2021

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.2.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 18, 2021
@doxygen doxygen closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to enhance doxygen, not a bug HTML HTML / XHTML output
Projects
None yet
Development

No branches or pull requests

4 participants