Skip to content

Commit 84ede69

Browse files
Fix rendering of examples in block vs. inline
1 parent 0e4d073 commit 84ede69

File tree

1 file changed

+19
-54
lines changed

1 file changed

+19
-54
lines changed

Nordic MathML Guidelines.md

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,8 @@ A mathematical expression being inline as part of an ongoing sentence or paragra
100100
</p>
101101
```
102102
The example will be rendered as follows:
103-
<p>Here is an inline equation:
104-
<math>
105-
<mi>x</mi>
106-
<mo>=</mo>
107-
<mn>5</mn>
108-
<mtext>.</mtext>
109-
</math>
110-
</p>
103+
104+
Here is an inline equation: $x = 5.$
111105

112106
**Note:** Make sure to have space between the normal text and the MathML markup.
113107

@@ -143,29 +137,14 @@ It is common in STEM books for a mathematical expression to be part of a sentenc
143137
```
144138
The example will be rendered as follows:
145139

146-
<p>To find the mean of a set of observations, add the values and divide by the number of observations:
147-
<math display="block">
148-
<mover><mi>x</mi><mo>&#8254;</mo></mover>
149-
<mo>=</mo>
150-
<mfrac>
151-
<mrow>
152-
<msub><mi>x</mi><mn>1</mn></msub><mo>+</mo><msub><mi>x</mi><mn>2</mn></msub><mo>+</mo><mi>&#x2026;</mi><mo>+</mo><msub><mi>x</mi><mi>n</mi></msub>
153-
</mrow>
154-
<mi>n</mi>
155-
</mfrac>
156-
<mtext>.</mtext>
157-
</math>
158-
</p>
159-
160-
<p> This can be written in more compact form:
161-
<math display="block">
162-
<mover><mi>x</mi><mo>&#8254;</mo></mover>
163-
<mo>=</mo>
164-
<mfrac><mn>1</mn><mi>n</mi></mfrac>
165-
<mo>∑</mo><msub><mi>x</mi><mi>i</mi></msub>
166-
<mtext>.</mtext>
167-
</math>
168-
</p>
140+
To find the mean of a set of observations, add the values and divide by the number of observations:
141+
``` math
142+
\bar{x} = \frac{x_1 + x_2 + … + x_n}{n}
143+
```
144+
This can be written in more compact form:
145+
``` math
146+
\bar{x} = \frac{1}{n}∑x_i.
147+
```
169148

170149
Other times the mathematical expression is a stand-alone element, not part of an ongoing sentence or paragraph. In such examples it is important to place the `<math>` element inside a `<p>` element or something similar. Here is an example:
171150

@@ -182,16 +161,11 @@ Other times the mathematical expression is a stand-alone element, not part of an
182161
</p>
183162
```
184163
The example will be rendered as follows:
185-
<p>Text preceding a stand-alone block of math content.</p>
186-
<p>
187-
<math display="block">
188-
<mi>a</mi>
189-
<mo>+</mo>
190-
<mi>b</mi>
191-
<mo>=</mo>
192-
<mi>c</mi>
193-
</math>
194-
</p>
164+
165+
Text preceding a stand-alone block of math content.
166+
``` math
167+
a + b = c.
168+
```
195169

196170
Sometimes a mathematical expression consists of multiple mathematical expressions, and they all appear on the same line. Examples are functions where the domain is a restricted interval, or a differential equation, with an intial value. In such cases, all the expressions should be captured in the same `<math>` element separated by `<mspace>`. Here is an example:
197171

@@ -211,19 +185,10 @@ Sometimes a mathematical expression consists of multiple mathematical expression
211185
</p>
212186
```
213187
The example will be rendered as follows:
214-
<p>The curve is represented by the equation
215-
<math display="block">
216-
<mi>r</mi>
217-
<mo>=</mo>
218-
<msqrt>
219-
<mo>|</mo><mi>sin</mi><mo>(</mo><mi>n</mi><mi>&#x3B8;</mi><mo>)</mo><mo>|</mo>
220-
</msqrt>
221-
<mo>,</mo>
222-
<mspace width="1em"></mspace>
223-
<mn>0</mn><mo>≤</mo><mi>&#x3B8;</mi><mo>≤</mo><mn>2</mn><mi>π</mi>
224-
<mtext>.</mtext>
225-
</math>
226-
</p>
188+
189+
``` math
190+
r = \sqrt{|\text{sin}(nθ)|}, \hspace{1em} 0 ≤ θ ≤ 2π
191+
```
227192

228193
### Semantics and Annotations
229194

0 commit comments

Comments
 (0)