Code Conflict?

35 views
Skip to first unread message

John Graham

unread,
Aug 24, 2021, 4:22:59 AM8/24/21
to MathJax Users

Hi,

Hope someone can help. 

I'm using https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js and https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js  on the same page and this error appears

"Uncaught TypeError: MathJax.tex2svgPromise is not a function".

Is there any way I can use both on the same page?

Thanks

Davide Cervone

unread,
Sep 24, 2021, 8:03:30 PM9/24/21
to mathja...@googlegroups.com
The combined components, like tex-mml-chtml.js and tex-svg.js are not designed to be used in combination, since they both include copies of the startup code that does things like setup the tex2svgPromise() routines, and one will wipe out the work of the other.

You can, however load one of them and configure it to load the pieces you need from the other.  For example

<script>
MathJax = {
  loader: {load: ['output/svg']}
};
</script>
<script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

would let you have both SVG- and CHTML-based typeset functions.

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/dca4fd01-495e-4156-ae82-239dda91746dn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages