6.4. Equations

An example is a figure element which has a class attribute containing "role-equation". This kind of figure is listed in the "List of Equations" (that is, book element loe) only if it also has a figcaption child element. Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<figure class="role-equation">
  <figcaption>Special relativity</figcaption>
  <div>
    <math display="block"
          xmlns="http://www.w3.org/1998/Math/MathML">
      <mrow>
        <mrow>
          <mi>t</mi>
          <mo></mo>
        </mrow>
        <mo>=</mo>
        <mrow>
          <mi>t</mi>
          <mo>&#x2062;</mo>
          <mfrac>
            <mn>1</mn>
            <msqrt>
              <mrow>
                <mn>1</mn>
                <mo>-</mo>
                <mfrac>
                  <msup>
                    <mi>v</mi>
                    <mn>2</mn>
                  </msup>
                  <msup>
                    <mi>c</mi>
                    <mn>2</mn>
                  </msup>
                </mfrac>
              </mrow>
            </msqrt>
          </mfrac>
        </mrow>
      </mrow>
    </math>
  <div>
</figure>

is rendered as:

Equation 6-1. Special relativity
t = t 1 1 - v 2 c 2

Few web browsers natively support MathML, so it's recommended to add a link to the MathJax script to your input HTML pages containing equations[1]. This typically done as follows (this loads latest 3.x version of the MathJax mml-chtml component):

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="UTF-8" />
    <title>...</title>

    <script async="async" id="MathJax-script"
            src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js"
            type="text/javascript"></script>
    
  </head>
  ...

[1] Even simpler, add the link to MathJax script to the headcommon element of your book.