MathJax 4 warning and TeX conversion failure
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Issue Summary
In trying out v4, I get a warning "MathJax: Invalid option "enableAssisitiveMml" (no default value)."
I have
MathJax = {
loader: {load: ['input/tex', 'input/asciimath']},
options: {
enableMenu: false, // interferes with navigation
enableAssistiveMml: true,
}
};
I didn't see anything in https://github.com/mathjax/MathJax-src/releases/tag/4.0.0-alpha.1 about a change regarding that option. The application doesn't run.
After fixing the above by commenting out the line, the application (see #2937) doesn't run. The error in the console is:
(index):30 MathJax conversion error: Error: MathJax retry
at t.retryAfter (tex-mml-chtml.js:1:768405)
at a.enrich (tex-mml-chtml.js:1:43964)
at Object.renderMath (tex-mml-chtml.js:1:82401)
at t.renderConvert (tex-mml-chtml.js:1:83214)
at e.convert (tex-mml-chtml.js:1:92292)
at e.convert (tex-mml-chtml.js:1:86327)
at t.MathJax.<computed> [as tex2mml] (tex-mml-chtml.js:1:70018)
at ConvertToMathML ((index):25:28)
at imports.wbg.__wbg_ConvertToMathML_1ba3a1bdd5856d88 (index-efa97dbedd7f5bfc.js:317:21)
at <math_cat_demo::Model as yew::html::component::Component>::update::h0af6f1cc7b48c509 (index-efa97dbedd7f5bfc_bg.wasm:0x556ff)
The input is x = {-b \pm \sqrt{b^2-4ac} \over 2a} and the JS being run is
function ConvertToMathML(math_str, math_format) {
MathJax.startup.defaultReady();
let options = {display: true};
let mathml;
try {
if (math_format == 'ASCIIMath') {
mathml = MathJax.asciimath2mml(math_str, options);
} else if (math_format == 'TeX') {
mathml = MathJax.tex2mml(math_str, options);
} else { // should be "MathML"
mathml = MathJax.mathml2mml(math_str, options);
};
} catch (e) {
console.error("MathJax conversion error: ", e);
mathml = "<math><merror>MathJax conversion error</merror></math>"
}
console.log("ConvertToMathML:\n" + mathml.toString());
return mathml;
}
Environment
This is on Windows 10.
In Firefox, I only see the warning. In Chrome, I get the above error:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MathJax configuration and the ConvertToMathML function shown in the report, then reproduce the warning and TeX conversion failure in Chrome and Firefox using the provided input. Check the v4 alpha behavior referenced in the release notes and issue #2937; done means the invalid-option warning is resolved and the TeX conversion succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, latex
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100