I am doing a website in html, and my website is on math. So, I need to write equations there, but I have no idea of how to do it. I has been searching and I found this website


I saw the source code of the page and it seems that it uses Latex notation for writing equations, for example

enter image description here

There appears the symbol "$" which yields the same results in this website as in LaTex, can anyone help me to know how this is done?


1 Answer 1


What is this?

It's done with MathJax; there's even a tag for it: . It is a JavaScript math display engine that work across all browsers. If you right-click on the equations, you should get 'about MathJax' and 'Help.' To view the notation, right-click the equation and select'show math as', then 'tex commands' or 'MathML.'

What is it doing?

Javascript scripts are used on websites. For a variety of purposes, one of them is to add special effects to your website's content, mostly text and data. (This is a very common decrption about JS)

Here MathJax loads a Javascript script to the website you are on, then searches for latex math surrounding by '$' or '(' characters (see this and this), and finally shows the math as a fancy equation.

For additional information, see LaTeX to MathML conversion: tools, limitations, and approaches?.

How to put this in my website?

Some info on versions

You have the option of using MathJax 3 or 2. Some version 2 features are still being migrated to version 3. Version 2 of MathJax is still there, and you can use it until version 3 provides the capabilities you want.


MathJax 3 Documentation

MathJax 2 Documentation


You can ask questions regarding converting issues and clarifying problems whether they are from MathJax in Tex.SE, as well as similar queries at - click the icon. Questions concerning MathJax, however, should be sent to https://groups.google.com/g/mathjax-users or https://stackoverflow.com/questions/tagged/mathjax.

Depending on the intricacy of the math you wish to express, you could consider using Emacs' orgmode to write the content once and then exporting it as '.html', '.tex' (and then '.pdf', too), or '.odt' (see section «Export and Publish» here). You may still apply your LaTeX expertise. However, it may assist you in keeping your thoughts in a single spot and exporting them when needed in the format you want. See, for example, John Kitchen's demo here.

  • Depending on the complexity of math you want to convey, you might consider Emacs' orgmode as an option for writing the material once, and subsequently exporting from this source in either .html, .tex (and then .pdf, too), .odt (see section «Export and Publish» here). You still may use your knowledge about LaTeX. However it may help you to maintain your ideas in one location only, and export it when needed in the format you actually need. See e.g., John Kitchen's demo here.
    – Buttonwood
    Commented Oct 13, 2021 at 10:21

Not the answer you're looking for? Browse other questions tagged .