Skip to content

Commit 76104d6

Browse files
mark up for punctuation
#32
1 parent 69f2ba7 commit 76104d6

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

Guidelines/Nordic MathML Guidelines 2024-1.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,91 @@ Note that some automatic MathML markup engines causes text in equations to be ca
271271

272272
The attribute `style` can be used to format text in the `<mtext>` element to reflect the source. Also make sure to include whitespace when necessary inside the `<mtext>` markup so that the display matches the source.
273273

274+
##### Punctuation
275+
276+
Since mathematical expressions are usually part of sentences (as is described in block vs inline) a punctuation mark such as a period, comma, exclamation mark, question mark and so on can be at the end of a mathematical expression.
277+
278+
For the visual layout of the mathematical expression to be correct, the punctuation has to be included inside the `<math>` element. Example of a sentence ending mathematical expression:
279+
280+
```html
281+
<p>
282+
This can be seen from the quadratic formula
283+
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
284+
<mi>x</mi>
285+
<mo>=</mo>
286+
<mfrac>
287+
<mrow>
288+
<mrow>
289+
<mo>−</mo>
290+
<mi>b</mi>
291+
</mrow>
292+
<mo>±</mo>
293+
<msqrt>
294+
<mrow>
295+
<msup>
296+
<mi>b</mi>
297+
<mn>2</mn>
298+
</msup>
299+
<mrow>
300+
<mo>−</mo>
301+
<mn>4</mn>
302+
<mo>⁢</mo>
303+
<mi>a</mi>
304+
<mo>⁢</mo>
305+
<mi>c</mi>
306+
</mrow>
307+
</mrow>
308+
</msqrt>
309+
</mrow>
310+
<mrow>
311+
<mn>2</mn>
312+
<mo>⁢</mo>
313+
<mi>a</mi>
314+
</mrow>
315+
</mfrac>
316+
<mtext>.</mtext>
317+
</math>
318+
</p>
319+
```
320+
321+
**Note!** If the mathematical expression also ends in text, the punctuation should be wrapped in its own `<mtext>` element and be a sibling to the other text node. Example mark up for this:
322+
323+
```html
324+
<p>
325+
If we have an equation such as
326+
<math display="block">
327+
<mo>(</mo>
328+
<mi>a</mi>
329+
<mo>
330+
<!---->
331+
</mo>
332+
<mi>b</mi>
333+
<mo>)</mo>
334+
<mo>
335+
<!---->
336+
</mo>
337+
<mi>c</mi>
338+
<mo>=</mo>
339+
<mi>a</mi>
340+
<mo>
341+
<!---->
342+
</mo>
343+
<mo>(</mo>
344+
<mi>b</mi>
345+
<mo>
346+
<!---->
347+
</mo>
348+
<mi>c</mi>
349+
<mo>)</mo>
350+
<mspace width="5em"></mspace>
351+
<mtext>(1.3)</mtext>
352+
<mtext>.</mtext>
353+
</math>
354+
</p>
355+
356+
357+
```
358+
274359
### General Layout Schemata
275360

276361
#### Grouping mathematical expressions with `<mrow>`

0 commit comments

Comments
 (0)