Viewing Inserting code for mathjax

Inserting code for mathjax



User: Horst H. 2 years ago
Hello there,

I would like to use mathjax to insert mathematical formulas into my web page. I am designing a responsive page, so I am using flexboxes for content.

Based on the description at http://docs.mathjax.org/en/latest/web/start.html, I suppose that I need to put the script information into the page header. But in the flexbox widget, I can only insert "styled text" and I don't see how I can put an actual formula into the text. Should I be using a different widget?

Sorry if this is a dumb newbie question...
User: EverWeb Support 2 years ago
Hi Horst,

Thanks for reaching out.

Please watch this short video tutorial to help you with this question:

https://www.everwebapp.com/support/video-tutorials/header-and-footer-code.html

Let me know if any questions arise.

-------------------------------
EverWeb Customer Support
Submit Tickets or Learn More
User: Horst H. 2 years ago
Thank you for your reply!

My initial confusion was primarily due to the following: in many text-entry editors (for example, on Canvas), the "styled text" option means that everything is interpreted literally as typed and buttons are used for boldface, underline, lists, etc. There is then a "view html" option that shows the "styled text" as the corresponding html codes. However, in Everweb's styled text, there are the expected buttons, while at the same time, something like "ä" is not interpreted literally, but rather as "ä". This hybrid approach was new to me.

Now, just in case someone else happens to have the same question regarding math in Everweb, here's what worked for me: I used

<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['(',')']]}});
</script>
<script type="text/java script" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-MML-AM_CHTML">
</script>

as header code. Then I was able to write things like the following in the "styled text" component of a Flexbox widget:

"Suppose that in a game you have two possible outcomes, $A_1$ and $A_2$. These outcomes correspond to amounts of money $x_1$ and $x_2$ that you can win (positive value) or lose (negative value) when the corresponding event occurs. Then the expected outcome is defined as
$$E=x_1cdot P[A_1]+x_2cdot P[A_2].$$"

which led to the expected output. So my issue is resolved. Thank you again!

Last edit 2 years ago


Post Reply
You must login or signup to post.