- 
                Notifications
    You must be signed in to change notification settings 
- Fork 235
Closed
Description
Hi,
In version 2, I used to use MathJax.Hub.Typeset(<element>) to typeset dynamically loaded contents. In version 3, I am trying to use Mathjax.typeset(<element>), but I get the following error:
Uncaught TypeError: Object is not iterable.
I am following this doc. And here is my configuration:
/* === other codes === */
case "/academic":
    const loadMathJax = document.createElement("script"), configMathJax = document.createElement("script");
    document.head.appendChild(configMathJax);
    document.head.appendChild(loadMathJax);
    loadMathJax.src = "scripts/mathjax.js"; // this file is carbon-copy of 'tex-mml-chtml.js'
    configMathJax.innerText = `window.MathJax = { options: { ignoreHtmlClass: "tex2jax_ignore", processHtmlClass: "tex2jax_process" }, tex: { autoload: { color: [], colorV2: ["color"] }, packages: { "[+]": ["noerrors"] } }, loader: { load: ["input/asciimath", "[tex]/noerrors", "[tex]/mhchem"] } }`;
    /* === other codes === */
    li.onclick = () => {
        const res = document.createElement("div");
        /* === other codes === */
        inner.appendChild(res);
        res.innerHTML = each.content;
        window.MathJax.typeset(res); // this line is kicking the error
    };
/* === other codes === */Maybe I am missing something, can I get a little more guideline on how this function works?
Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels