Edit online

How to View MathML Equations in HTML Output

By default, only Firefox can render MathML equations embedded in the HTML code. MathJax is a solution to properly view MathML equations embedded in HTML content in a variety of browsers.

If you have DocBook or DITA content that has embedded MathML equations and you want to properly view the equations in published HTML output types (WebHelp, CHM, EPUB, etc.), you need to add a reference to the MathJax script in the head element of all HTML files that have the equation embedded.

For example:
<script type="text/javascript"
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Alternate Method for DITA

For DITA documents, you can also use the following procedure:
  1. Create an XML file that contains a script similar to the one shown in the example above.
  2. Edit the DITA Map transformation scenario and open the Parameters tab.
  3. Set the following parameter to point to the XML file created in step 1:
    • WebHelp Responsive Systems - Set the webhelp.fragment.head parameter to point to your XML file.
    • WebHelp Classic Systems - Set the webhelp.head.script parameter to point to your XML file.
    • Any other type of HTML-based publishing - Set the args.hdf parameter to point to your XML file.
  4. Run the transformation scenario.

Result: The equation should now be properly rendered in other browsers, such as Edge, IE, or Chrome.