MathJax 3 in Blackboard

144 views
Skip to first unread message

Jeroen Wouters

unread,
Mar 17, 2021, 11:26:35 AM3/17/21
to MathJax Users

Hello,

I am trying to get MathJax 3 to work in my Blackboard course. I include the script element into the HTML code via the item editor.
This works for MathJax 2, but not for MathJax 3. For v3 I get the below error on the console in Chrome. Any suggestions as to how to debug this are most welcome.

Best wishes,
Jeroen


Uncaught (in promise) TypeError: Cannot set property 'parent' of undefined
    at t (tex-mml-chtml.js:1)
    at e (tex-mml-chtml.js:1)
    at r (tex-mml-chtml.js:1)
    at e (tex-mml-chtml.js:1)
    at new <anonymous> (3A92E765DECD9FABE0D8405893819AF4.js?v=3900.8.0-rel.34+a1b2d92:394)
    at Object.node.<computed> [as text] (tex-mml-chtml.js:1)
    at e.create (tex-mml-chtml.js:1)
    at e.t.compileError (tex-mml-chtml.js:1)
    at Object.compileError (tex-mml-chtml.js:1)
    at e.t.compileMath (tex-mml-chtml.js:1)

Davide Cervone

unread,
Mar 24, 2021, 6:58:18 AM3/24/21
to mathja...@googlegroups.com
Really hard to give you any advice without seeing the script tag that you used, any MathJax configuration you may have used, and the math expressions that you are trying to process.  We can't reproduce the error without that, and so can't diagnose the source of the problem.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/cc0599cc-bd94-4c7e-a4ef-18fefe4a5d94n%40googlegroups.com.

Jeroen Wouters

unread,
Mar 24, 2021, 10:37:45 AM3/24/21
to mathja...@googlegroups.com
Dear Davide,

Thanks for your reply. I am using the script tag provided on the MathJax homepage:
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

This is all I add to the HTML code.

No math expressions work, not even \( a = 0 \) or \[ b=1 \].

I have noticed that MathJax does work in the "Preview" in the Blackboard item editor, but not once they are saved.

I would be very grateful for any suggestions on how to debug this further.

Best wishes,
Jeroen
--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/EAjQNnGoMAk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/4D8AE4C3-200A-4720-9330-5F6236C37786%40mathjax.org.

Davide Cervone

unread,
Mar 24, 2021, 11:35:51 AM3/24/21
to mathja...@googlegroups.com
Can you view the source of the saved page, and see if the script tag is properly inserted, and check that the text of the math appears exactly as you entered it?  It may be that the editor is modifying it after saving and that it is no longer the same as you entered it.

Davide


Jeroen Wouters

unread,
Mar 24, 2021, 12:09:57 PM3/24/21
to mathja...@googlegroups.com
Dear Davide,

Thanks very much for the quick reply!

The code looks okay to me:

<div class="vtbegenerated"> 
 <div class="vtbegenerated_div"> 
  
 
 </div> 
 <div class="vtbegenerated_div">

  \( a = 0 \)
 </div> 
 <div class="vtbegenerated_div">
  \[ b = 1 \]
 </div> 
</div>

It also works in saved items if I use the script URL for v2 (https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML).

Best wishes,
Jeroen

Davide Cervone

unread,
Mar 24, 2021, 4:27:55 PM3/24/21
to mathja...@googlegroups.com
Well, I'm not able to reproduce a problem from this, so it probably has something to do with Blackboard's processing of the page.  For example, MathJax may be trying to typeset math while Blackboard is changing the page content.  If so, then perhaps delaying MathJax for a bit might help.  Try adding

<script>
MathJax = {
  startup: {
    ready() {
      setTimeout(function () {MathJax.startup.defaultReady()}, 1000);
    }
  }
}
</script>

just BEFORE the script that loads MathJax.  That should delay MathJax from processing the page for 1 second.  If that works, adjust the 1000 (milliseconds) to suit your needs.

That's the best I can suggest.

Davide


Reply all
Reply to author
Forward
0 new messages